Documentation ¶
Index ¶
- func EncodePrimaryKey(v any, packer *types.Packer) []byte
- func EncodePrimaryKeyVector(vec *vector.Vector, packer *types.Packer) (ret [][]byte)
- func IsBlkTable(name string) bool
- func IsMetaTable(name string) bool
- func IsObjTable(name string) bool
- type BlockDeltaEntry
- type BlockEntry
- type BlocksIter
- type Filter
- type ObjectEntry
- type ObjectIndexByCreateTSEntry
- type ObjectIndexByTSEntry
- type ObjectInfo
- type ObjectsIter
- type Partition
- func (p *Partition) CanServe(ts types.TS) bool
- func (*Partition) CheckPoint(ctx context.Context, ts timestamp.Timestamp) error
- func (p *Partition) ConsumeCheckpoints(ctx context.Context, fn func(checkpoint string, state *PartitionState) error) (err error)
- func (p *Partition) ConsumeSnapCkps(_ context.Context, ckps []*checkpoint.CheckpointEntry, ...) (err error)
- func (p *Partition) GetDuration() (types.TS, types.TS)
- func (p *Partition) IsEmpty() bool
- func (p *Partition) IsValid() bool
- func (p *Partition) Lock(ctx context.Context) error
- func (p *Partition) MutateState() (*PartitionState, func())
- func (p *Partition) Snapshot() *PartitionState
- func (p *Partition) Truncate(ctx context.Context, ids [2]uint64, ts types.TS) error
- func (p *Partition) Unlock()
- func (p *Partition) UpdateDuration(start types.TS, end types.TS)
- func (p *Partition) UpdateStart(ts types.TS)
- type PartitionState
- func (p *PartitionState) AppendCheckpoint(checkpoint string, partiton *Partition)
- func (p *PartitionState) ApproxObjectsNum() int
- func (p *PartitionState) BlockPersisted(blockID types.Blockid) bool
- func (p *PartitionState) CacheCkpDuration(start types.TS, end types.TS, partition *Partition)
- func (p *PartitionState) Copy() *PartitionState
- func (p *PartitionState) GetBlockDeltaLoc(bid types.Blockid) (objectio.ObjectLocation, types.TS, bool)
- func (p *PartitionState) GetChangedObjsBetween(begin types.TS, end types.TS) (deleted map[objectio.ObjectNameShort]struct{}, ...)
- func (p *PartitionState) GetObject(name objectio.ObjectNameShort) (ObjectInfo, bool)
- func (p *PartitionState) HandleLogtailEntry(ctx context.Context, fs fileservice.FileService, entry *api.Entry, ...)
- func (p *PartitionState) HandleMetadataDelete(ctx context.Context, tableID uint64, input *api.Batch)
- func (p *PartitionState) HandleMetadataInsert(ctx context.Context, fs fileservice.FileService, input *api.Batch)
- func (p *PartitionState) HandleObjectDelete(tableID uint64, bat *api.Batch)
- func (p *PartitionState) HandleObjectInsert(ctx context.Context, bat *api.Batch, fs fileservice.FileService)
- func (p *PartitionState) HandleRowsDelete(ctx context.Context, input *api.Batch, packer *types.Packer)
- func (p *PartitionState) HandleRowsInsert(ctx context.Context, input *api.Batch, primarySeqnum int, packer *types.Packer) (primaryKeys [][]byte)
- func (p *PartitionState) LastFlushTimestamp() types.TS
- func (p *PartitionState) NewDirtyBlocksIter() BlocksIter
- func (p *PartitionState) NewObjectsIter(ts types.TS) (ObjectsIter, error)
- func (p *PartitionState) NewPrimaryKeyDelIter(ts types.TS, spec PrimaryKeyMatchSpec, bid types.Blockid) *primaryKeyDelIter
- func (p *PartitionState) NewPrimaryKeyIter(ts types.TS, spec PrimaryKeyMatchSpec) *primaryKeyIter
- func (p *PartitionState) NewRowsIter(ts types.TS, blockID *types.Blockid, iterDeleted bool) *rowsIter
- func (p *PartitionState) PKExistInMemBetween(from types.TS, to types.TS, keys [][]byte) (bool, bool)
- func (p *PartitionState) RowExists(rowID types.Rowid, ts types.TS) bool
- type PrimaryIndexEntry
- type PrimaryKeyMatchSpec
- func BetweenKind(lb, ub []byte, kind int) PrimaryKeyMatchSpec
- func Exact(key []byte) PrimaryKeyMatchSpec
- func GreatKind(lb []byte, closed bool) PrimaryKeyMatchSpec
- func InKind(encodes [][]byte, kind int) PrimaryKeyMatchSpec
- func LessKind(ub []byte, closed bool) PrimaryKeyMatchSpec
- func MinMax(min []byte, max []byte) PrimaryKeyMatchSpec
- func Prefix(prefix []byte) PrimaryKeyMatchSpec
- type RowEntry
- type RowID
- type RowsIter
- type TableInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePrimaryKeyVector ¶
func IsBlkTable ¶
func IsMetaTable ¶
func IsObjTable ¶ added in v1.1.0
Types ¶
type BlockDeltaEntry ¶ added in v1.0.0
type BlockDeltaEntry struct { BlockID types.Blockid CommitTs types.TS DeltaLoc objectio.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 ¶
func (BlockEntry) Less ¶
func (b BlockEntry) Less(than BlockEntry) bool
type Filter ¶ added in v1.2.0
type Filter interface {
Filter([]ObjectInfo) []ObjectInfo
}
func NewOverlap ¶ added in v1.2.0
type ObjectEntry ¶ added in v1.0.0
type ObjectEntry struct {
ObjectInfo
}
func (ObjectEntry) IsEmpty ¶ added in v1.2.0
func (o ObjectEntry) IsEmpty() bool
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
type ObjectIndexByCreateTSEntry ¶ added in v1.0.0
type ObjectIndexByCreateTSEntry struct {
ObjectInfo
}
func (ObjectIndexByCreateTSEntry) Less ¶ added in v1.0.0
func (o ObjectIndexByCreateTSEntry) Less(than ObjectIndexByCreateTSEntry) 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
func (b ObjectIndexByTSEntry) Less(than ObjectIndexByTSEntry) bool
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 { TableInfo TableInfo TableInfoOK bool // contains filtered or unexported fields }
a partition corresponds to a dn
func NewPartition ¶
func NewPartition() *Partition
func (*Partition) CheckPoint ¶
func (*Partition) ConsumeCheckpoints ¶ added in v1.0.0
func (p *Partition) ConsumeCheckpoints( ctx context.Context, fn func( checkpoint string, state *PartitionState, ) error, ) ( err error, )
ConsumeCheckpoints load and consumes all checkpoints in the partition, if consumed, it will return immediately.
func (*Partition) ConsumeSnapCkps ¶ added in v1.2.0
func (p *Partition) ConsumeSnapCkps( _ context.Context, ckps []*checkpoint.CheckpointEntry, fn func( ckp *checkpoint.CheckpointEntry, state *PartitionState, ) error, ) ( err error, )
func (*Partition) GetDuration ¶ added in v1.2.0
func (*Partition) MutateState ¶
func (p *Partition) MutateState() (*PartitionState, func())
func (*Partition) Snapshot ¶
func (p *Partition) Snapshot() *PartitionState
func (*Partition) UpdateDuration ¶ added in v1.2.0
[start, end]
func (*Partition) UpdateStart ¶ added in v1.2.0
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) CacheCkpDuration ¶ added in v1.2.0
func (*PartitionState) Copy ¶
func (p *PartitionState) Copy() *PartitionState
func (*PartitionState) GetBlockDeltaLoc ¶ added in v1.2.2
func (p *PartitionState) GetBlockDeltaLoc(bid types.Blockid) (objectio.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 (*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( tableID uint64, bat *api.Batch)
func (*PartitionState) HandleObjectInsert ¶ added in v1.1.0
func (p *PartitionState) HandleObjectInsert(ctx context.Context, bat *api.Batch, fs fileservice.FileService)
func (*PartitionState) HandleRowsDelete ¶
func (*PartitionState) HandleRowsInsert ¶
func (*PartitionState) LastFlushTimestamp ¶ added in v1.2.0
func (p *PartitionState) LastFlushTimestamp() types.TS
func (*PartitionState) NewDirtyBlocksIter ¶
func (p *PartitionState) NewDirtyBlocksIter() BlocksIter
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 (*PartitionState) PKExistInMemBetween ¶ added in v1.2.0
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 { // Move moves to the target Move func(p *primaryKeyIter) bool Name string }
func BetweenKind ¶ added in v1.2.1
func BetweenKind(lb, ub []byte, kind int) PrimaryKeyMatchSpec
func Exact ¶
func Exact(key []byte) PrimaryKeyMatchSpec
func GreatKind ¶ added in v1.2.1
func GreatKind(lb []byte, closed bool) PrimaryKeyMatchSpec
func InKind ¶ added in v1.2.1
func InKind(encodes [][]byte, kind int) PrimaryKeyMatchSpec
func LessKind ¶ added in v1.2.1
func LessKind(ub []byte, closed bool) 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
Click to show internal directories.
Click to hide internal directories.