Documentation ¶
Index ¶
- func PreparePhyAddrData(id *objectio.Blockid, startRow, length uint32, pool *containers.VectorPool) (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]) GetBlocks() *btree.BTreeG[B]
- 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 BaseTreeVisitor
- func (visitor *BaseTreeVisitor) String() string
- func (visitor *BaseTreeVisitor) VisitBlock(dbID, tableID uint64, segmentID *objectio.Segmentid, Num, Seq uint16) (err error)
- func (visitor *BaseTreeVisitor) VisitSegment(dbID, tableID uint64, segmentID *objectio.Segmentid) (err error)
- func (visitor *BaseTreeVisitor) VisitTable(dbID, tableID uint64) (err error)
- type BatchBlock
- type BlockT
- type HashPageTable
- type LRUCache
- type PageT
- type PreparedCompactedBlockData
- type RowsT
- type SegmentTree
- func (stree *SegmentTree) AddBlock(Num, Seq uint16)
- func (stree *SegmentTree) Equal(o *SegmentTree) bool
- func (stree *SegmentTree) IsEmpty() bool
- func (stree *SegmentTree) Merge(ot *SegmentTree)
- func (stree *SegmentTree) ReadFrom(r io.Reader) (n int64, err error)
- func (stree *SegmentTree) Shrink(id *objectio.Blockid) (empty bool)
- func (stree *SegmentTree) WriteTo(w io.Writer) (n int64, err error)
- type TableTree
- func (ttree *TableTree) AddBlock(id *objectio.Blockid)
- func (ttree *TableTree) AddSegment(sid *objectio.Segmentid)
- func (ttree *TableTree) Compact() (empty bool)
- func (ttree *TableTree) Equal(o *TableTree) bool
- func (ttree *TableTree) GetSegment(id types.Uuid) *SegmentTree
- func (ttree *TableTree) IsEmpty() bool
- func (ttree *TableTree) Merge(ot *TableTree)
- func (ttree *TableTree) ReadFrom(r io.Reader) (n int64, err error)
- func (ttree *TableTree) ShortBlocksString() string
- func (ttree *TableTree) Shrink(segID types.Uuid) (empty bool)
- func (ttree *TableTree) WriteTo(w io.Writer) (n int64, err error)
- type TimedSliceBlock
- type TransDels
- type TransDelsForBlks
- type TransferHashPage
- func (page *TransferHashPage) BornTS() time.Time
- func (page *TransferHashPage) Close()
- func (page *TransferHashPage) ID() *common.ID
- func (page *TransferHashPage) Length() int
- 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)
- type Tree
- func (tree *Tree) AddBlock(dbID, tableID uint64, id *objectio.Blockid)
- func (tree *Tree) AddSegment(dbID, tableID uint64, id *objectio.Segmentid)
- func (tree *Tree) AddTable(dbID, id uint64)
- func (tree *Tree) Compact() (empty bool)
- func (tree *Tree) Equal(o *Tree) bool
- func (tree *Tree) GetSegment(tableID uint64, segID types.Uuid) *SegmentTree
- func (tree *Tree) GetTable(id uint64) *TableTree
- func (tree *Tree) HasTable(id uint64) bool
- func (tree *Tree) IsEmpty() bool
- func (tree *Tree) Merge(ot *Tree)
- func (tree *Tree) ReadFrom(r io.Reader) (n int64, err error)
- func (tree *Tree) Reset()
- func (tree *Tree) Shrink(tableID uint64) (empty bool)
- func (tree *Tree) String() string
- func (tree *Tree) TableCount() int
- func (tree *Tree) Visit(visitor TreeVisitor) (err error)
- func (tree *Tree) WriteTo(w io.Writer) (n int64, err error)
- type TreeVisitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PreparePhyAddrData ¶ added in v0.6.0
func PreparePhyAddrData( id *objectio.Blockid, startRow, length uint32, pool *containers.VectorPool, ) (col containers.Vector, err error)
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 BaseTreeVisitor ¶ added in v0.8.0
type BaseTreeVisitor struct { TableFn func(uint64, uint64) error SegmentFn func(uint64, uint64, *objectio.Segmentid) error BlockFn func(uint64, uint64, *objectio.Segmentid, uint16, uint16) error }
func (*BaseTreeVisitor) String ¶ added in v0.8.0
func (visitor *BaseTreeVisitor) String() string
func (*BaseTreeVisitor) VisitBlock ¶ added in v0.8.0
func (*BaseTreeVisitor) VisitSegment ¶ added in v0.8.0
func (visitor *BaseTreeVisitor) VisitSegment(dbID, tableID uint64, segmentID *objectio.Segmentid) (err error)
func (*BaseTreeVisitor) VisitTable ¶ added in v0.8.0
func (visitor *BaseTreeVisitor) VisitTable(dbID, tableID uint64) (err error)
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, 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 HashPageTable ¶ added in v0.6.0
type HashPageTable = TransferTable[*TransferHashPage]
type LRUCache ¶ added in v0.8.0
type LRUCache interface { Set(ctx context.Context, k any, v []byte) Get(ctx context.Context, k any) ([]byte, bool) Size() int64 }
func NewSimpleLRU ¶ added in v0.8.0
type PreparedCompactedBlockData ¶
type PreparedCompactedBlockData struct { Columns *containers.Batch SortKey containers.Vector SchemaVersion uint32 Seqnums []uint16 }
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 SegmentTree ¶ added in v0.8.0
func NewSegmentTree ¶ added in v0.8.0
func NewSegmentTree(id *objectio.Segmentid) *SegmentTree
func (*SegmentTree) AddBlock ¶ added in v0.8.0
func (stree *SegmentTree) AddBlock(Num, Seq uint16)
func (*SegmentTree) Equal ¶ added in v0.8.0
func (stree *SegmentTree) Equal(o *SegmentTree) bool
func (*SegmentTree) IsEmpty ¶ added in v0.8.0
func (stree *SegmentTree) IsEmpty() bool
func (*SegmentTree) Merge ¶ added in v0.8.0
func (stree *SegmentTree) Merge(ot *SegmentTree)
func (*SegmentTree) ReadFrom ¶ added in v0.8.0
func (stree *SegmentTree) ReadFrom(r io.Reader) (n int64, err error)
type TableTree ¶ added in v0.8.0
type TableTree struct { DbID uint64 ID uint64 Segs map[objectio.Segmentid]*SegmentTree }
func NewTableTree ¶ added in v0.8.0
func (*TableTree) AddSegment ¶ added in v0.8.0
func (*TableTree) GetSegment ¶ added in v0.8.0
func (ttree *TableTree) GetSegment(id types.Uuid) *SegmentTree
func (*TableTree) ShortBlocksString ¶ added in v1.0.0
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 TransDels ¶ added in v1.0.0
type TransDels struct { // row -> commit ts Mapping map[int]types.TS // contains filtered or unexported fields }
func NewTransDels ¶ added in v1.0.0
type TransDelsForBlks ¶ added in v1.0.0
func NewTransDelsForBlks ¶ added in v1.0.0
func NewTransDelsForBlks() *TransDelsForBlks
func (*TransDelsForBlks) GetDelsForBlk ¶ added in v1.0.0
func (t *TransDelsForBlks) GetDelsForBlk(blkid types.Blockid) *TransDels
func (*TransDelsForBlks) Prune ¶ added in v1.0.0
func (t *TransDelsForBlks) Prune(gap time.Duration)
func (*TransDelsForBlks) SetDelsForBlk ¶ added in v1.0.0
func (t *TransDelsForBlks) SetDelsForBlk(blkid types.Blockid, dels *TransDels)
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) Length ¶ added in v1.0.0
func (page *TransferHashPage) Length() int
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)
type Tree ¶ added in v0.8.0
func (*Tree) AddSegment ¶ added in v0.8.0
func (*Tree) GetSegment ¶ added in v0.8.0
func (tree *Tree) GetSegment(tableID uint64, segID types.Uuid) *SegmentTree
func (*Tree) TableCount ¶ added in v0.8.0
func (*Tree) Visit ¶ added in v0.8.0
func (tree *Tree) Visit(visitor TreeVisitor) (err error)