logtailreplay

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodePrimaryKey

func EncodePrimaryKey(v any, packer *types.Packer) []byte

func EncodePrimaryKeyVector

func EncodePrimaryKeyVector(vec *vector.Vector, packer *types.Packer) (ret [][]byte)

func IsBlkTable

func IsBlkTable(name string) bool

func IsMetaTable

func IsMetaTable(name string) bool

func IsSegTable

func IsSegTable(name string) bool

Types

type BlockEntry

type BlockEntry struct {
	catalog.BlockInfo

	CreateTime types.TS
	DeleteTime types.TS
}

func (BlockEntry) Less

func (b BlockEntry) Less(than BlockEntry) bool

func (*BlockEntry) Visible

func (b *BlockEntry) Visible(ts types.TS) bool

type BlocksIter

type BlocksIter interface {
	Next() bool
	Close() error
	Entry() BlockEntry
}

type Partition

type Partition struct {
	TS timestamp.Timestamp // last updated timestamp
	// contains filtered or unexported fields
}

a partition corresponds to a dn

func NewPartition

func NewPartition() *Partition

func (*Partition) CheckPoint

func (*Partition) CheckPoint(ctx context.Context, ts timestamp.Timestamp) error

func (*Partition) Lock

func (p *Partition) Lock() <-chan struct{}

func (*Partition) MutateState

func (p *Partition) MutateState() (*PartitionState, func())

func (*Partition) Snapshot

func (p *Partition) Snapshot() *PartitionState

func (*Partition) Unlock

func (p *Partition) Unlock()

type PartitionState

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

func NewPartitionState

func NewPartitionState(noData bool) *PartitionState

func (*PartitionState) AppendCheckpoint

func (p *PartitionState) AppendCheckpoint(checkpoint string)

func (*PartitionState) BlockVisible

func (p *PartitionState) BlockVisible(blockID types.Blockid, ts types.TS) bool

func (*PartitionState) ConsumeCheckpoints

func (p *PartitionState) ConsumeCheckpoints(
	fn func(checkpoint string) error,
) error

func (*PartitionState) Copy

func (p *PartitionState) Copy() *PartitionState

func (*PartitionState) HandleLogtailEntry

func (p *PartitionState) HandleLogtailEntry(
	ctx context.Context,
	entry *api.Entry,
	primarySeqnum int,
	packer *types.Packer,
)

func (*PartitionState) HandleMetadataDelete

func (p *PartitionState) HandleMetadataDelete(ctx context.Context, input *api.Batch)

func (*PartitionState) HandleMetadataInsert

func (p *PartitionState) HandleMetadataInsert(ctx context.Context, tableId uint64, input *api.Batch)

func (*PartitionState) HandleRowsDelete

func (p *PartitionState) HandleRowsDelete(ctx context.Context, input *api.Batch)

func (*PartitionState) HandleRowsInsert

func (p *PartitionState) HandleRowsInsert(
	ctx context.Context,
	input *api.Batch,
	primarySeqnum int,
	packer *types.Packer,
) (
	primaryKeys [][]byte,
)

func (*PartitionState) NewBlocksIter

func (p *PartitionState) NewBlocksIter(ts types.TS) *blocksIter

func (*PartitionState) NewDirtyBlocksIter

func (p *PartitionState) NewDirtyBlocksIter() *dirtyBlocksIter

func (*PartitionState) NewPrimaryKeyIter

func (p *PartitionState) NewPrimaryKeyIter(
	ts types.TS,
	spec PrimaryKeyMatchSpec,
) *primaryKeyIter

func (*PartitionState) NewRowsIter

func (p *PartitionState) NewRowsIter(ts types.TS, blockID *types.Blockid, iterDeleted bool) *rowsIter

func (*PartitionState) PrimaryKeyMayBeModified

func (p *PartitionState) PrimaryKeyMayBeModified(
	tableID uint64,
	from types.TS,
	to types.TS,
	key []byte,
) bool

func (*PartitionState) PrimaryKeysMayBeModified

func (p *PartitionState) PrimaryKeysMayBeModified(
	tableID uint64,
	from types.TS,
	to types.TS,
	keysVector *vector.Vector,
	packer *types.Packer,
) bool

func (*PartitionState) RowExists

func (p *PartitionState) RowExists(rowID types.Rowid, ts types.TS) bool

type PrimaryIndexEntry

type PrimaryIndexEntry struct {
	Bytes      []byte
	RowEntryID int64

	// fields for validating
	BlockID types.Blockid
	RowID   types.Rowid
}

func (*PrimaryIndexEntry) Less

func (p *PrimaryIndexEntry) Less(than *PrimaryIndexEntry) bool

type PrimaryKeyMatchSpec

type PrimaryKeyMatchSpec struct {
	Seek  []byte
	Match func(key []byte) bool
}

func Exact

func Exact(key []byte) PrimaryKeyMatchSpec

func MinMax

func MinMax(min []byte, max []byte) PrimaryKeyMatchSpec

func Prefix

func Prefix(prefix []byte) PrimaryKeyMatchSpec

type RowEntry

type RowEntry struct {
	BlockID types.Blockid // we need to iter by block id, so put it first to allow faster iteration
	RowID   types.Rowid
	Time    types.TS

	ID                int64 // a unique version id, for primary index building and validating
	Deleted           bool
	Batch             *batch.Batch
	Offset            int64
	PrimaryIndexBytes []byte
}

RowEntry represents a version of a row

func (RowEntry) Less

func (r RowEntry) Less(than RowEntry) bool

type RowID

type RowID types.Rowid

func (RowID) Less

func (r RowID) Less(than RowID) bool

type RowsIter

type RowsIter interface {
	Next() bool
	Close() error
	Entry() RowEntry
}

Jump to

Keyboard shortcuts

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