logtailreplay

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 25 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 IsObjTable added in v1.1.0

func IsObjTable(name string) bool

Types

type BlockDeltaEntry added in v1.0.0

type BlockDeltaEntry struct {
	BlockID types.Blockid

	CommitTs types.TS
	DeltaLoc catalog.ObjectLocation
}

func (BlockDeltaEntry) DeltaLocation added in v1.0.0

func (b BlockDeltaEntry) DeltaLocation() objectio.Location

func (BlockDeltaEntry) Less added in v1.0.0

func (b BlockDeltaEntry) Less(than BlockDeltaEntry) bool

type BlockEntry

type BlockEntry struct {
	catalog.BlockInfo

	CreateTime types.TS
	DeleteTime types.TS
}

func (BlockEntry) Less

func (b BlockEntry) Less(than BlockEntry) bool

type BlocksIter

type BlocksIter interface {
	Next() bool
	Close() error
	Entry() types.Blockid
}

type ObjectEntry added in v1.0.0

type ObjectEntry struct {
	ObjectInfo
}

func (ObjectEntry) Less added in v1.0.0

func (o ObjectEntry) Less(than ObjectEntry) bool

func (ObjectEntry) Location added in v1.0.0

func (o ObjectEntry) Location() objectio.Location

func (*ObjectEntry) Visible added in v1.0.0

func (o *ObjectEntry) Visible(ts types.TS) bool

type ObjectIndexByCreateTSEntry added in v1.0.0

type ObjectIndexByCreateTSEntry struct {
	ObjectInfo
}

func (ObjectIndexByCreateTSEntry) Less added in v1.0.0

func (*ObjectIndexByCreateTSEntry) Visible added in v1.0.0

func (o *ObjectIndexByCreateTSEntry) Visible(ts types.TS) bool

type ObjectIndexByTSEntry added in v1.0.0

type ObjectIndexByTSEntry struct {
	Time         types.TS // insert or delete time
	ShortObjName objectio.ObjectNameShort

	IsDelete     bool
	IsAppendable bool
}

func (ObjectIndexByTSEntry) Less added in v1.0.0

type ObjectInfo added in v1.0.0

type ObjectInfo struct {
	objectio.ObjectStats

	EntryState  bool
	Sorted      bool
	HasDeltaLoc bool
	CommitTS    types.TS
	CreateTime  types.TS
	DeleteTime  types.TS
}

func (ObjectInfo) Location added in v1.0.0

func (o ObjectInfo) Location() objectio.Location

func (ObjectInfo) StatsValid added in v1.1.1

func (o ObjectInfo) StatsValid() bool

func (ObjectInfo) String added in v1.1.0

func (o ObjectInfo) String() string

type ObjectsIter added in v1.0.0

type ObjectsIter interface {
	Next() bool
	Close() error
	Entry() ObjectEntry
}

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) ConsumeCheckpoints added in v1.0.0

func (p *Partition) ConsumeCheckpoints(
	ctx context.Context,
	fn func(
		checkpoint string,
		state *PartitionState,
	) error,
) (
	err error,
)

func (*Partition) Lock

func (p *Partition) Lock(ctx context.Context) error

func (*Partition) MutateState

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

func (*Partition) Snapshot

func (p *Partition) Snapshot() *PartitionState

func (*Partition) Truncate added in v1.0.0

func (p *Partition) Truncate(ctx context.Context, ids [2]uint64, ts types.TS) error

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, partiton *Partition)

func (*PartitionState) ApproxObjectsNum added in v1.0.0

func (p *PartitionState) ApproxObjectsNum() int

not accurate! only used by stats

func (*PartitionState) BlockPersisted added in v1.0.0

func (p *PartitionState) BlockPersisted(blockID types.Blockid) bool

func (*PartitionState) Copy

func (p *PartitionState) Copy() *PartitionState

func (*PartitionState) GetBockDeltaLoc added in v1.0.0

func (p *PartitionState) GetBockDeltaLoc(bid types.Blockid) (catalog.ObjectLocation, types.TS, bool)

func (*PartitionState) GetChangedObjsBetween added in v1.0.0

func (p *PartitionState) GetChangedObjsBetween(
	begin types.TS,
	end types.TS,
) (
	deleted map[objectio.ObjectNameShort]struct{},
	inserted map[objectio.ObjectNameShort]struct{},
)

GetChangedObjsBetween get changed objects between [begin, end], notice that if an object is created after begin and deleted before end, it will be ignored

func (*PartitionState) GetObject added in v1.0.0

func (p *PartitionState) GetObject(name objectio.ObjectNameShort) (ObjectInfo, bool)

func (*PartitionState) HandleLogtailEntry

func (p *PartitionState) HandleLogtailEntry(
	ctx context.Context,
	fs fileservice.FileService,
	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,
	fs fileservice.FileService,
	input *api.Batch)

func (*PartitionState) HandleObjectDelete added in v1.1.0

func (p *PartitionState) HandleObjectDelete(bat *api.Batch)

func (*PartitionState) HandleObjectInsert added in v1.1.0

func (p *PartitionState) HandleObjectInsert(bat *api.Batch, fs fileservice.FileService)

func (*PartitionState) HandleRowsDelete

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

func (*PartitionState) HandleRowsInsert

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

func (*PartitionState) NewDirtyBlocksIter

func (p *PartitionState) NewDirtyBlocksIter() *dirtyBlocksIter

func (*PartitionState) NewObjectsIter added in v1.0.0

func (p *PartitionState) NewObjectsIter(ts types.TS) (*objectsIter, error)

func (*PartitionState) NewPrimaryKeyDelIter added in v1.1.0

func (p *PartitionState) NewPrimaryKeyDelIter(
	ts types.TS,
	spec PrimaryKeyMatchSpec,
	bid types.Blockid,
) *primaryKeyDelIter

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(
	from types.TS,
	to types.TS,
	keys [][]byte,
) 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
	Time    types.TS
}

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