writer

package
v0.0.0-...-0ffc857 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeFrameSize

func EncodeFrameSize(dataBytes int) (lenField uint64, padBytes int)

EncodeFrameSize encodes the frame size for etcd wal which uses code from etcd wal/encoder.go. Ref: https://github.com/etcd-io/etcd/pull/5250

Types

type LogWriterConfig

type LogWriterConfig struct {
	config.ConsistentConfig
	LogType      string
	CaptureID    model.CaptureID
	ChangeFeedID model.ChangeFeedID

	URI                *url.URL
	UseExternalStorage bool
	Dir                string
	MaxLogSizeInBytes  int64
}

LogWriterConfig is the config for redo log writer.

func (LogWriterConfig) String

func (cfg LogWriterConfig) String() string

type LogWriterOptions

type LogWriterOptions struct {
	GetLogFileName   func() string
	GetUUIDGenerator func() uuid.Generator
}

LogWriterOptions is the options for writer

type Option

type Option func(writer *LogWriterOptions)

Option define the writerOptions

func WithLogFileName

func WithLogFileName(f func() string) Option

WithLogFileName provide the Option for fileName

func WithUUIDGenerator

func WithUUIDGenerator(f func() uuid.Generator) Option

WithUUIDGenerator provides the Option for uuid generator

type RedoEvent

type RedoEvent interface {
	ToRedoLog() *model.RedoLog
}

RedoEvent is the interface for redo event.

type RedoLogWriter

type RedoLogWriter interface {
	// WriteEvents writes DDL or DML events to the redo log.
	WriteEvents(ctx context.Context, events ...RedoEvent) error

	// FlushLog flushes all events written by `WriteEvents` into redo storage.
	FlushLog(ctx context.Context) error

	// Close is used to close the writer.
	Close() error
}

RedoLogWriter defines the interfaces used to write redo log, all operations are thread-safe.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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