datasource

package
v0.0.0-...-9634a1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ORIGIN_TABLE_1M = "1m"
	ORIGIN_TABLE_1S = "1s"
	FLOW_LOG_L4     = "flow_log.l4"
	FLOW_LOG_L7     = "flow_log.l7"
)
View Source
const (
	DATASOURCE_PORT = 20106
)

Variables

This section is empty.

Functions

func MakeCreateTableLocal

func MakeCreateTableLocal(t *ckdb.Table, dstTable, aggrSummable, aggrUnsummable string) string

func MakeGlobalTableCreateSQL

func MakeGlobalTableCreateSQL(t *ckdb.Table, dstTable string) string

func MakeMVTableCreateSQL

func MakeMVTableCreateSQL(t *ckdb.Table, dstTable, aggrSummable, aggrUnsummable string, aggrTimeFunc ckdb.TimeFuncType) string

Types

type ActionEnum

type ActionEnum uint8
const (
	ADD ActionEnum = iota
	DEL
	MOD
)

func ActionToEnum

func ActionToEnum(action string) (ActionEnum, error)

type AddBody

type AddBody struct {
	BaseRP       string `json:"base-rp"`
	DB           string `json:"db"`
	Interval     int    `json:"interval"`
	Name         string `json:"name"`
	Duration     int    `json:"retention-time"`
	SummableOP   string `json:"summable-metrics-op"`
	UnsummableOP string `json:"unsummable-metrics-op"`
}

type AggrEnum

type AggrEnum uint8
const (
	SUM AggrEnum = iota
	MAX
	MIN
	AVG
)

func AggrToEnum

func AggrToEnum(aggr string) (AggrEnum, error)

type DatasourceManager

type DatasourceManager struct {
	// contains filtered or unexported fields
}

func NewDatasourceManager

func NewDatasourceManager(cfg *config.Config, readTimeout int) *DatasourceManager

func (*DatasourceManager) Close

func (m *DatasourceManager) Close() error

func (*DatasourceManager) Handle

func (m *DatasourceManager) Handle(dbGroup, action, baseTable, dstTable, aggrSummable, aggrUnsummable string, interval, duration int) error

func (*DatasourceManager) RegisterHandlers

func (m *DatasourceManager) RegisterHandlers()

func (*DatasourceManager) Start

func (m *DatasourceManager) Start()

type DelBody

type DelBody struct {
	DB   string `json:"db"`
	Name string `json:"name"`
}

type IntervalEnum

type IntervalEnum uint8
const (
	IntervalHour IntervalEnum = iota
	IntervalDay
)

type JsonResp

type JsonResp struct {
	OptStatus   string `json:"OPT_STATUS"`
	Description string `json:"DESCRIPTION,omitempty"`
}

type ModBody

type ModBody struct {
	DB       string `json:"db"`
	Name     string `json:"name"`
	Duration int    `json:"retention-time"`
}

type TableType

type TableType uint8
const (
	AGG    TableType = iota // 聚合后的原始表, 存储数据
	MV                      // view 无实际数据, 用来从local或agg表,读取数据写入到agg表
	LOCAL                   // view 无实际数据, 用来简化读取agg表的数据
	GLOBAL                  // 以local表为基础,建立全局表
)

func (TableType) String

func (v TableType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL