checkpoint

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCheckpointNotFound = fmt.Errorf("checkpoint not found")
)

Functions

This section is empty.

Types

type OperationMeta

type OperationMeta struct {
	OperationID string    `json:"operation_id"`
	StartTime   time.Time `json:"start_time"`
	ConfigHash  string    `json:"config_hash"`
}

OperationMeta tracks top-level metadata for a migration or backup.

type PartitionCheckpoint

type PartitionCheckpoint struct {
	PartitionID   string          `json:"partition_id"`
	Status        PartitionStatus `json:"status"`
	LastCommitted any             `json:"last_committed"` // last primary key / offset
	RowsWritten   int64           `json:"rows_written"`
	ErrorCount    int64           `json:"error_count"`
	UpdatedAt     time.Time       `json:"updated_at"`
}

PartitionCheckpoint tracks the progress of a single partition.

type PartitionStatus

type PartitionStatus string
const (
	StatusPending    PartitionStatus = "Pending"
	StatusInProgress PartitionStatus = "InProgress"
	StatusDone       PartitionStatus = "Done"
	StatusFailed     PartitionStatus = "Failed"
)

type Store

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

Store is a bbolt-backed checkpoint store.

func NewStore

func NewStore(path string) (*Store, error)

NewStore opens a bbolt database at the given path.

func (*Store) Close

func (s *Store) Close() error

Close closes the underlying database.

func (*Store) GetPartition

func (s *Store) GetPartition(opID, partitionID string) (*PartitionCheckpoint, error)

GetPartition retrieves a partition checkpoint.

func (*Store) SaveMeta

func (s *Store) SaveMeta(meta OperationMeta) error

SaveMeta saves the operation metadata.

func (*Store) SavePartition

func (s *Store) SavePartition(opID string, cp PartitionCheckpoint) error

SavePartition saves a partition checkpoint.

func (*Store) SaveStatus

func (s *Store) SaveStatus(opID, partitionID string, status PartitionStatus) error

SaveStatus updates only the status of a partition.

Jump to

Keyboard shortcuts

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