Documentation
¶
Overview ¶
-------------------------------------------------------------------------
* * dao.go * data access object for database backend * * * Copyright (c) 2021, Alibaba Group Holding Limited * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * IDENTIFICATION * plugins/db_backend/dao/dao.go *-------------------------------------------------------------------------
Index ¶
- Constants
- Variables
- type Aggregation
- type AsyncInsertData
- type Column
- type DBInfo
- type DBManager
- type Database
- type DimKey
- type DimensionTable
- type FactTable
- type InsInfo
- type Instance
- func (ins *Instance) AsyncInsert(name string, schema []string, data [][]interface{}) error
- func (ins *Instance) DeepCopy() *Instance
- func (ins *Instance) Init(name string, insinfo *InsInfo, dbinfo *DBInfo, initsqls []db_config.QueryCtx) error
- func (ins *Instance) Insert(name string, schema []string, data [][]interface{}) error
- func (ins *Instance) IsLowPriority(name string) bool
- func (ins *Instance) Stop() error
- type TimeSeriesTable
Constants ¶
View Source
const ( RETENTION_HOUR = 03 RETENTION_MIN = 23 RETENTION_SECOND = 43 MIN_TRACKLOG_TIME = 500 )
View Source
const ASYNC_CHANNEL_SIZE = 50
View Source
const DATAMODEL_CONFIG_TABLE = "meta_data_model_config"
View Source
const DBConnTimeout = 10
View Source
const DBQueryTimeout = 60
View Source
const TABLE_CONFIG_VERSION = "meta_data_model_version"
Variables ¶
View Source
var RETENTION_INTERVAL int = 3600
View Source
var RETENTION_TIME int = 3 * 24 * 60 * 60
Functions ¶
This section is empty.
Types ¶
type Aggregation ¶
type AsyncInsertData ¶
type AsyncInsertData struct {
// contains filtered or unexported fields
}
type Column ¶
type Column struct {
Name string `json:"name"`
Type string `json:"type"`
DimTable *DimensionTable `json:"dimtable"`
AggType string `json:"aggtype"`
}
type DBManager ¶
type DBManager struct {
Databases []*Database `json:"db_schemas"`
// contains filtered or unexported fields
}
func NewDBManager ¶
func NewDBManager() *DBManager
func (*DBManager) GetOrInitInstance ¶
type DimensionTable ¶
type DimensionTable struct {
Name string
DimKey DimKey `json:"dimkey"`
DimValue []string `json:"dimvalue"`
}
func (*DimensionTable) DeepCopy ¶
func (dim *DimensionTable) DeepCopy() *DimensionTable
type Instance ¶
type Instance struct {
DataType string
Name string
InsInfo *InsInfo
DBInfo *DBInfo
Tables []*TimeSeriesTable `json:"tables"`
TableMap map[string]*TimeSeriesTable
HighPriorityAsyncChannel chan *AsyncInsertData
LowPriorityAsyncChannel chan *AsyncInsertData
AsyncInsertStopper chan int
// contains filtered or unexported fields
}
func (*Instance) AsyncInsert ¶
func (*Instance) IsLowPriority ¶
type TimeSeriesTable ¶
type TimeSeriesTable struct {
Name string `json:"name"`
Tags []*Column `json:"tags"`
Values []*Column `json:"values"`
TagMap map[string]*Column
ValueMap map[string]*Column
FactTable *FactTable
DimensionTableMap map[string]*DimensionTable
Aggregations []Aggregation `json:"aggregations"`
AggregationMap map[string]Aggregation
Retention int `json:"retention"`
}
func (*TimeSeriesTable) DeepCopy ¶
func (t *TimeSeriesTable) DeepCopy() *TimeSeriesTable
Click to show internal directories.
Click to hide internal directories.