Documentation ¶
Index ¶
- func DecodeBlockKeyPrefix(rowid types.Rowid) (segmentId, blockId uint64)
- func DecodePhyAddrKey(src types.Rowid) (segmentId, blockId uint64, offset uint32)
- func DecodePhyAddrKeyFromValue(v any) (segmentId, blockId uint64, offset uint32)
- func EncodeBlockKeyPrefix(segmentId, blockId uint64) []byte
- func EncodePhyAddrKey(segmentId, blockId uint64, offset uint32) types.Rowid
- func EncodePhyAddrKeyWithPrefix(prefix []byte, offset uint32) types.Rowid
- func PreparePhyAddrData(typ types.Type, prefix []byte, startRow, length uint32) (col containers.Vector, err error)
- func PreparePhyAddrDataWithPool(typ types.Type, prefix []byte, startRow, length uint32, pool *mpool.MPool) (col containers.Vector, err error)
- type AOT
- func (aot *AOT[B, R]) Append(rows R) (err error)
- func (aot *AOT[B, R]) BlockCount() int
- func (aot *AOT[B, R]) Close()
- func (aot *AOT[B, R]) Max() (b B)
- func (aot *AOT[B, R]) Min() (b B)
- func (aot *AOT[B, R]) Scan(fn func(_ B) bool)
- func (aot *AOT[B, R]) Snapshot() AOTSnapshot[B, R]
- func (aot *AOT[B, R]) String() string
- func (aot *AOT[B, R]) Truncate(stopFn func(_ B) bool) (cnt int)
- type AOTSnapshot
- type BaseView
- type BatchBlock
- type BlockT
- type BlockView
- func (view *BlockView) ApplyDeletes()
- func (view *BlockView) Close()
- func (view *BlockView) Eval(clear bool) (err error)
- func (view *BlockView) GetColumnData(i int) containers.Vector
- func (view *BlockView) Orphan(i int) containers.Vector
- func (view *BlockView) SetBatch(bat *containers.Batch)
- func (view *BlockView) SetData(i int, data containers.Vector)
- func (view *BlockView) SetLogIndexes(i int, indexes []*wal.Index)
- func (view *BlockView) SetUpdates(i int, mask *roaring.Bitmap, vals map[uint32]any)
- type ColumnView
- func (view *ColumnView) ApplyDeletes() containers.Vector
- func (view *ColumnView) Close()
- func (view *ColumnView) Eval(clear bool) (err error)
- func (view *ColumnView) GetData() containers.Vector
- func (view *ColumnView) GetValue(row int) any
- func (view *ColumnView) IsDeleted(row int) bool
- func (view *ColumnView) Length() int
- func (view *ColumnView) Orphan() containers.Vector
- func (view *ColumnView) SetData(data containers.Vector)
- func (view *ColumnView) String() string
- type HashPageTable
- type PageT
- type PreparedCompactedBlockData
- type RowsT
- type TimedSliceBlock
- type TransferHashPage
- func (page *TransferHashPage) BornTS() time.Time
- func (page *TransferHashPage) Close()
- func (page *TransferHashPage) ID() *common.ID
- func (page *TransferHashPage) Pin() *common.PinnedItem[*TransferHashPage]
- func (page *TransferHashPage) String() string
- func (page *TransferHashPage) TTL(now time.Time, ttl time.Duration) bool
- func (page *TransferHashPage) Train(from uint32, to types.Rowid)
- func (page *TransferHashPage) Transfer(from uint32) (dest types.Rowid, ok bool)
- type TransferTable
- func (table *TransferTable[T]) AddPage(page T) (dup bool)
- func (table *TransferTable[T]) Close()
- func (table *TransferTable[T]) DeletePage(id *common.ID) (deleted bool)
- func (table *TransferTable[T]) Len() int
- func (table *TransferTable[T]) Pin(id common.ID) (pinned *common.PinnedItem[T], err error)
- func (table *TransferTable[T]) RunTTL(now time.Time)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBlockKeyPrefix ¶
func DecodePhyAddrKey ¶ added in v0.6.0
func DecodePhyAddrKeyFromValue ¶ added in v0.6.0
func EncodeBlockKeyPrefix ¶
EncodeBlockKeyPrefix [48 Bit (BlockID) + 48 Bit (SegmentID)]
func EncodePhyAddrKey ¶ added in v0.6.0
func EncodePhyAddrKeyWithPrefix ¶ added in v0.6.0
func PreparePhyAddrData ¶ added in v0.6.0
Types ¶
type AOT ¶ added in v0.7.0
AOT stands for append-only-table append-only is the most common form of data organization. A basic data structure is abstracted here, which can cover most scenarios, such as logtail data and checkpoint data
func (*AOT[B, R]) BlockCount ¶ added in v0.7.0
func (*AOT[B, R]) Snapshot ¶ added in v0.7.0
func (aot *AOT[B, R]) Snapshot() AOTSnapshot[B, R]
func (*AOT[B, R]) Truncate ¶ added in v0.7.0
Truncate prunes the blocks. Deletable blocks are those have all txns prepared before the given timestamp For example: truncate the table by timestamp blocks: (Page1[bornTs=1], Page2[bornTs=10], Page3[bornTs=20]) Call Remain Delete Truncate(ts=5): (Page1,Page2,Page3), () Truncate(ts=12): (Page2,Page3), (Page1) Truncate(ts=30): (Page3), (Page1,Page2)
type AOTSnapshot ¶ added in v0.7.0
type AOTSnapshot[B BlockT[R], R RowsT[R]] interface { // Ascend the table within the range [pivot, last] Ascend(pivot B, iter func(blk B) bool) // Descend the table within the range [pivot, first] Descend(pivot B, iter func(blk B) bool) }
AOTSnapshot represents the snapshot of a AOT
type BatchBlock ¶ added in v0.7.0
type BatchBlock struct { *containers.Batch ID uint64 }
func NewBatchBlock ¶ added in v0.7.0
func NewBatchBlock( id uint64, attrs []string, colTypes []types.Type, nullables []bool, opts containers.Options) *BatchBlock
func (*BatchBlock) IsAppendable ¶ added in v0.7.0
func (blk *BatchBlock) IsAppendable() bool
type BlockT ¶ added in v0.7.0
type BlockT[R RowsT[R]] interface { // Append appends a group of rows into the block Append(R) error // IsAppendable specifies wether the block is appendable IsAppendable() bool // Length specifies the row count of the block Length() int String() string // Close release the block bound resources // It should be called when the block is not used Close() }
BlockT represents a block of rows
type BlockView ¶
type BlockView struct { *BaseView Columns map[int]*ColumnView DeleteLogIndexes []*wal.Index }
func NewBlockView ¶
func (*BlockView) ApplyDeletes ¶ added in v0.7.0
func (view *BlockView) ApplyDeletes()
func (*BlockView) GetColumnData ¶
func (view *BlockView) GetColumnData(i int) containers.Vector
func (*BlockView) SetBatch ¶
func (view *BlockView) SetBatch(bat *containers.Batch)
type ColumnView ¶
type ColumnView struct { *BaseView ColIdx int UpdateMask *roaring.Bitmap UpdateVals map[uint32]any LogIndexes []*wal.Index // contains filtered or unexported fields }
func NewColumnView ¶
func NewColumnView(ts types.TS, colIdx int) *ColumnView
func (*ColumnView) ApplyDeletes ¶
func (view *ColumnView) ApplyDeletes() containers.Vector
func (*ColumnView) Close ¶
func (view *ColumnView) Close()
func (*ColumnView) Eval ¶
func (view *ColumnView) Eval(clear bool) (err error)
func (*ColumnView) GetData ¶
func (view *ColumnView) GetData() containers.Vector
func (*ColumnView) GetValue ¶
func (view *ColumnView) GetValue(row int) any
func (*ColumnView) IsDeleted ¶ added in v0.7.0
func (view *ColumnView) IsDeleted(row int) bool
func (*ColumnView) Length ¶
func (view *ColumnView) Length() int
func (*ColumnView) Orphan ¶
func (view *ColumnView) Orphan() containers.Vector
func (*ColumnView) SetData ¶
func (view *ColumnView) SetData(data containers.Vector)
func (*ColumnView) String ¶
func (view *ColumnView) String() string
type HashPageTable ¶ added in v0.6.0
type HashPageTable = TransferTable[*TransferHashPage]
type PreparedCompactedBlockData ¶
type PreparedCompactedBlockData struct { Columns *containers.Batch SortKey containers.Vector }
func NewPreparedCompactedBlockData ¶
func NewPreparedCompactedBlockData() *PreparedCompactedBlockData
func (*PreparedCompactedBlockData) Close ¶
func (preparer *PreparedCompactedBlockData) Close()
type RowsT ¶ added in v0.7.0
type RowsT[T any] interface { // row count Length() int // returns a window of the group of rows Window(offset, length int) T }
RowsT represents a group of rows
type TimedSliceBlock ¶ added in v0.7.0
func NewTimedSliceBlock ¶ added in v0.7.0
func NewTimedSliceBlock[R any](ts types.TS) *TimedSliceBlock[R]
func (*TimedSliceBlock[R]) Append ¶ added in v0.7.0
func (blk *TimedSliceBlock[R]) Append(rows R) (err error)
func (*TimedSliceBlock[R]) Close ¶ added in v0.7.0
func (blk *TimedSliceBlock[R]) Close()
func (*TimedSliceBlock[R]) IsAppendable ¶ added in v0.7.0
func (blk *TimedSliceBlock[R]) IsAppendable() bool
func (*TimedSliceBlock[R]) Length ¶ added in v0.7.0
func (blk *TimedSliceBlock[R]) Length() int
func (*TimedSliceBlock[R]) String ¶ added in v0.7.0
func (blk *TimedSliceBlock[R]) String() string
type TransferHashPage ¶ added in v0.6.0
func NewTransferHashPage ¶ added in v0.6.0
func NewTransferHashPage(id *common.ID, ts time.Time) *TransferHashPage
func (*TransferHashPage) BornTS ¶ added in v0.6.0
func (page *TransferHashPage) BornTS() time.Time
func (*TransferHashPage) Close ¶ added in v0.6.0
func (page *TransferHashPage) Close()
func (*TransferHashPage) ID ¶ added in v0.6.0
func (page *TransferHashPage) ID() *common.ID
func (*TransferHashPage) Pin ¶ added in v0.6.0
func (page *TransferHashPage) Pin() *common.PinnedItem[*TransferHashPage]
func (*TransferHashPage) String ¶ added in v0.6.0
func (page *TransferHashPage) String() string
type TransferTable ¶ added in v0.6.0
func NewTransferTable ¶ added in v0.6.0
func NewTransferTable[T PageT[T]](ttl time.Duration) *TransferTable[T]
func (*TransferTable[T]) AddPage ¶ added in v0.6.0
func (table *TransferTable[T]) AddPage(page T) (dup bool)
func (*TransferTable[T]) Close ¶ added in v0.6.0
func (table *TransferTable[T]) Close()
func (*TransferTable[T]) DeletePage ¶ added in v0.6.0
func (table *TransferTable[T]) DeletePage(id *common.ID) (deleted bool)
func (*TransferTable[T]) Len ¶ added in v0.6.0
func (table *TransferTable[T]) Len() int
func (*TransferTable[T]) Pin ¶ added in v0.6.0
func (table *TransferTable[T]) Pin(id common.ID) (pinned *common.PinnedItem[T], err error)
func (*TransferTable[T]) RunTTL ¶ added in v0.6.0
func (table *TransferTable[T]) RunTTL(now time.Time)