ckwriter

package
v0.0.0-...-4bc2d17 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FLUSH_TIMEOUT  = 10 * time.Second
	SQL_LOG_LENGTH = 256
)

Variables

This section is empty.

Functions

func ExecSQL

func ExecSQL(conn clickhouse.Conn, query string) error

func InitTable

func InitTable(addr, user, password, timeZone string, t *ckdb.Table, orgID uint16) error

func IsNil

func IsNil(i interface{}) bool

Types

type CKItem

type CKItem interface {
	WriteBlock(block *ckdb.Block)
	OrgID() uint16
	Release()
}

type CKWriter

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

func NewCKWriter

func NewCKWriter(addrs []string, user, password, counterName, timeZone string, table *ckdb.Table, queueCount, queueSize, batchSize, flushTimeout int, ckdbwatcher *config.Watcher) (*CKWriter, error)

func (*CKWriter) Close

func (w *CKWriter) Close()

func (*CKWriter) InitTable

func (w *CKWriter) InitTable(orgID uint16) error

func (*CKWriter) Put

func (w *CKWriter) Put(items ...interface{})

func (*CKWriter) ResetConnection

func (w *CKWriter) ResetConnection(connID int) error

func (*CKWriter) Run

func (w *CKWriter) Run()

func (*CKWriter) Write

func (w *CKWriter) Write(queueID int, cache *Cache)

type Cache

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

func (*Cache) Release

func (c *Cache) Release()

type Counter

type Counter struct {
	WriteSuccessCount int64 `statsd:"write-success-count"`
	WriteFailedCount  int64 `statsd:"write-failed-count"`
	RetryCount        int64 `statsd:"retry-count"`
	RetryFailedCount  int64 `statsd:"retry-failed-count"`
	OrgInvalidCount   int64 `statsd:"org-invalid-count"`
	utils.Closable
}

func (*Counter) GetCounter

func (i *Counter) GetCounter() interface{}

Jump to

Keyboard shortcuts

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