ckwriter

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 15 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) error

func IsNil

func IsNil(i interface{}) bool

Types

type CKItem

type CKItem interface {
	WriteBlock(block *ckdb.Block)
	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) (*CKWriter, error)

func (*CKWriter) Close

func (w *CKWriter) Close()

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, items []CKItem)

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"`
	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