snapshot

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSnapshotInvalidated = fmt.Errorf("snapshot invalidated by coordinator restart")

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	ClaimedAt      *time.Time
	HeartbeatAt    *time.Time
	CompletedAt    *time.Time
	RangeEnd       *int64
	RangeStart     *int64
	RangeEndText   *string
	RangeStartText *string
	Status         ChunkStatus
	TableName      string
	ClaimedBy      string
	TableSchema    string
	SlotName       string
	PKColumn       string
	ID             int64
	ChunkIndex     int
	ChunkStart     int64
	ChunkSize      int64
	UseCtid        bool
}

type ChunkStatus

type ChunkStatus string
const (
	ChunkStatusPending    ChunkStatus = "pending"
	ChunkStatusInProgress ChunkStatus = "in_progress"
	ChunkStatusCompleted  ChunkStatus = "completed"
)

type ConnectionPool

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

func NewConnectionPool

func NewConnectionPool(ctx context.Context, dsn string, size int) (*ConnectionPool, error)

func (*ConnectionPool) Close

func (p *ConnectionPool) Close(ctx context.Context)

func (*ConnectionPool) Get

func (*ConnectionPool) Put

func (p *ConnectionPool) Put(conn pg.Connection)

type DecoderCache

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

func NewDecoderCache

func NewDecoderCache() *DecoderCache

func (*DecoderCache) Get

func (c *DecoderCache) Get(oid uint32) *TypeDecoder

func (*DecoderCache) Size

func (c *DecoderCache) Size() int

type Handler

type Handler func(event *format.Snapshot) error

type Job

type Job struct {
	StartedAt       time.Time
	SlotName        string
	SnapshotID      string
	SnapshotLSN     pg.LSN
	TotalChunks     int
	CompletedChunks int
	Completed       bool
}

type Snapshotter

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

func New

func New(ctx context.Context, snapshotConfig config.SnapshotConfig, tables publication.Tables, dsn string) (*Snapshotter, error)

func (*Snapshotter) Close

func (s *Snapshotter) Close(ctx context.Context)

func (*Snapshotter) Execute

func (s *Snapshotter) Execute(ctx context.Context, handler Handler, slotName string) error

func (*Snapshotter) LoadJob

func (s *Snapshotter) LoadJob(ctx context.Context, slotName string) (*Job, error)

func (*Snapshotter) Prepare

func (s *Snapshotter) Prepare(ctx context.Context, slotName string) error

type TypeDecoder

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

func (*TypeDecoder) Decode

func (d *TypeDecoder) Decode(typeMap *pgtype.Map, data []byte) (any, error)

Jump to

Keyboard shortcuts

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