Documentation ¶
Index ¶
- Constants
- func IsDefaultOrgID(orgID uint16) bool
- func IsValidOrgID(orgID uint16) bool
- func OrgDatabasePrefix(orgID uint16) string
- type Block
- type CodecType
- type ColdStorage
- type Column
- func (c *Column) MakeModifyTimeZoneSQL(database, table, timeZone string) string
- func (c *Column) SetCodec(ct CodecType) *Column
- func (c *Column) SetComment(comment string) *Column
- func (c *Column) SetGroupBy() *Column
- func (c *Column) SetIndex(i IndexType) *Column
- func (c *Column) SetTypeArgs(args string) *Column
- type ColumnType
- type DiskType
- type EngineType
- type IndexType
- type Table
- func (t *Table) MakeGlobalTableCreateSQL() string
- func (t *Table) MakeLocalTableCreateSQL() string
- func (t *Table) MakeOrgGlobalTableCreateSQL(orgID uint16) string
- func (t *Table) MakeOrgLocalTableCreateSQL(orgID uint16) string
- func (t *Table) MakeOrgPrepareTableInsertSQL(orgID uint16) string
- func (t *Table) MakePrepareTableInsertSQL() string
- func (t *Table) MakeViewsCreateSQLForDeepflowSystem(orgID uint16) []string
- func (t *Table) OrgDatabase(orgID uint16) string
- type TimeFuncType
Constants ¶
View Source
const ( Distributed EngineType = iota MergeTree ReplicatedMergeTree AggregatingMergeTree ReplicatedAggregatingMergeTree ReplacingMergeTree SummingMergeTree EngineByconityOffset CnchMergeTree = MergeTree + EngineByconityOffset CnchAggregatingMergeTree = AggregatingMergeTree + EngineByconityOffset CnchReplacingMergeTree = ReplacingMergeTree + EngineByconityOffset CnchSummingMergeTree = SummingMergeTree + EngineByconityOffset )
View Source
const ( DF_STORAGE_POLICY = "df_storage" DF_CLUSTER = "df_cluster" DF_REPLICATED_CLUSTER = "df_replicated_cluster" DF_TIMEZONE = "Asia/Shanghai" CKDBTypeClickhouse = "clickhouse" CKDBTypeByconity = "byconity" )
View Source
const ( DEFAULT_ORG_ID = 1 INVALID_ORG_ID = 0 DEFAULT_TEAM_ID = 1 INVALID_TEAM_ID = 0 ORG_ID_LEN = 4 // length of 'xxxx' ORG_ID_PREFIX_LEN = 5 // length of 'xxxx_' MAX_ORG_ID = 1024 )
View Source
const ( METRICS_DB = "flow_metrics" LOCAL_SUBFFIX = "_local" )
View Source
const DEFAULT_COLUMN_COUNT = 256
Variables ¶
This section is empty.
Functions ¶
func IsDefaultOrgID ¶
func IsValidOrgID ¶
func OrgDatabasePrefix ¶
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
func (*Block) WriteDateTime ¶
type ColdStorage ¶
type ColdStorage struct { Enabled bool Type DiskType Name string TTLToMove int // after 'TTLToMove' hours, then move data to cold storage }
func GetColdStorage ¶
func GetColdStorage(coldStorages map[string]*ColdStorage, db, table string) *ColdStorage
type Column ¶
type Column struct { Name string // 列名 Type ColumnType // 数据类型 TypeArgs string Codec CodecType // 压缩算法 Index IndexType // 二级索引 GroupBy bool // 在AggregatingMergeTree表中用于group by的字段 Comment string // 列注释 }
func NewColumn ¶
func NewColumn(name string, t ColumnType) *Column
func NewColumnWithGroupBy ¶
func NewColumnWithGroupBy(name string, t ColumnType) *Column
func NewColumns ¶
func NewColumns(names []string, t ColumnType) []*Column
func NewColumnsWithComment ¶
func NewColumnsWithComment(nameComments [][2]string, t ColumnType) []*Column
nameComments: 需要同时创建的列列表,列表元素是长度为2的字符串数组, 第一个元素是列名,第二个是注释内容
func (*Column) MakeModifyTimeZoneSQL ¶
func (*Column) SetComment ¶
func (*Column) SetGroupBy ¶
func (*Column) SetTypeArgs ¶
type ColumnType ¶
type ColumnType uint8
const ( UInt64 ColumnType = iota UInt64Nullable UInt32 UInt32Nullable UInt16 UInt16Nullable UInt8 UInt8Nullable Int64 Int64Nullable Int32 Int32Nullable Int16 Int16Nullable Int8 Int8Nullable Float64 Float64Nullable String IPv6 IPv4 ArrayString ArrayUInt8 ArrayUInt16 ArrayUInt32 ArrayInt64 ArrayFloat64 DateTime DateTime64 DateTime64ms DateTime64us FixString8 LowCardinalityString ArrayLowCardinalityString ENUM8 )
func (ColumnType) HasDFTimeZone ¶
func (t ColumnType) HasDFTimeZone() bool
func (ColumnType) String ¶
func (t ColumnType) String() string
type EngineType ¶
type EngineType uint8
func (EngineType) String ¶
func (t EngineType) String() string
type Table ¶
type Table struct { Version string // 表版本,用于表结构变更时,做自动更新 ID uint8 // id Database string // 所属数据库名 DBType string // clickhouse or byconity LocalName string // 本地表名 GlobalName string // 全局表名 Columns []*Column // 表列结构 TimeKey string // 时间字段名,用来设置partition和ttl SummingKey string // When using SummingMergeEngine, this field is used for Summing aggregation TTL int // 数据默认保留时长。 单位:小时 ColdStorage ColdStorage // 冷存储配置 PartitionFunc TimeFuncType // partition函数作用于Time, Cluster string // 对应的cluster StoragePolicy string // 存储策略 Engine EngineType // 表引擎 OrderKeys []string // 排序的key PrimaryKeyCount int // 一级索引的key的个数, 从orderKeys中数前n个, }
func (*Table) MakeGlobalTableCreateSQL ¶
func (*Table) MakeLocalTableCreateSQL ¶
func (*Table) MakeOrgGlobalTableCreateSQL ¶
func (*Table) MakeOrgLocalTableCreateSQL ¶
func (*Table) MakeOrgPrepareTableInsertSQL ¶
func (*Table) MakePrepareTableInsertSQL ¶
func (*Table) MakeViewsCreateSQLForDeepflowSystem ¶
database 'xxxx_deepflow_system' adds 'deepflow_system' view pointing to the 'deepflow_system_agent' and 'deepflow_system_server' table
func (*Table) OrgDatabase ¶
type TimeFuncType ¶
type TimeFuncType uint8
const ( TimeFuncNone TimeFuncType = iota TimeFuncMinute TimeFuncTenMinute TimeFuncHour TimeFuncTwoHour TimeFuncFourHour TimeFuncTwelveHour TimeFuncDay TimeFuncWeek TimeFuncMonth TimeFuncYYYYMM TimeFuncYYYYMMDD )
func (TimeFuncType) String ¶
func (t TimeFuncType) String(timeKey string) string
Click to show internal directories.
Click to hide internal directories.