bulk

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchItem

type BatchItem struct {
	Action *elasticsearch2.Action
	Bytes  []byte
}

type Bulk

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

func NewBulk

func NewBulk(
	config *config.Config,
	esClient *elasticsearch.Client,
	pqCDC cdc.Connector,
	options ...Option,
) (*Bulk, error)

func (*Bulk) AddActions

func (b *Bulk) AddActions(
	ctx *replication.ListenerContext,
	eventTime time.Time,
	actions []elasticsearch2.Action,
	tableNamespace, tableName string,
	isLastChunk bool,
)

func (*Bulk) Close

func (b *Bulk) Close()

func (*Bulk) GetMetric

func (b *Bulk) GetMetric() Metric

func (*Bulk) StartBulk

func (b *Bulk) StartBulk()

type Indexer

type Indexer interface {
	StartBulk()
	AddActions(
		ctx *replication.ListenerContext,
		eventTime time.Time,
		actions []elasticsearch2.Action,
		tableNamespace, tableName string,
		isLastChunk bool,
	)
	GetMetric() Metric
	Close()
}

type Metric

type Metric interface {
	SetProcessLatency(latency int64)
	SetBulkRequestProcessLatency(latency int64)
	PrometheusCollectors() []prometheus.Collector
	// contains filtered or unexported methods
}

func NewMetric

func NewMetric(pqCDC cdc.Connector, slotName string) Metric

type Option

type Option func(*Bulk)

func WithResponseHandler

func WithResponseHandler(respHandler elasticsearch.ResponseHandler) Option

type Options

type Options []Option

func (Options) Apply

func (ops Options) Apply(c *Bulk)

Jump to

Keyboard shortcuts

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