taos

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScanTableInterval    = 24 * 3600 // scan all tables once everyday
	BestScanStartHour    = 6         // start scan at 6am every day, I guess that is low peak time of most business
	DaysToDeleteOldTable = 10        // delete tables that are not updated for these days
	ShowStablesSql       = "SHOW stables;"
	OldTableSqlFormat    = "select * from (select last_row(_ts) as last_ts,tbname from `%s` group by tbname) where last_ts < now - %dd;"
	DropTableSqlFormat   = "DROP TABLE IF EXISTS %s;"
)

Variables

This section is empty.

Functions

func StartScanTables

func StartScanTables(pool *ConnPool)

StartScanTables used to scan all tables and delete too old tables that not updated for days

Types

type ConnPool

type ConnPool struct {
	TaosServer config.TaosConfig
	PrepareSQL string
	ConnCount  int32
	// contains filtered or unexported fields
}

func CreateConnPool

func CreateConnPool(taosServer config.TaosConfig) *ConnPool

func (*ConnPool) GetConn

func (p *ConnPool) GetConn() (*af.Connector, error)

func (*ConnPool) PutConn

func (p *ConnPool) PutConn(conn *af.Connector)

func (*ConnPool) SchemalessWrite

func (p *ConnPool) SchemalessWrite(payload string) error

Jump to

Keyboard shortcuts

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