Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - 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, ObjectID *objectio.ObjectId, Seq uint16) (err error)
 - func (visitor *BaseTreeVisitor) VisitObject(dbID, tableID uint64, ObjectID *objectio.ObjectId) (err error)
 - func (visitor *BaseTreeVisitor) VisitTable(dbID, tableID uint64) (err error)
 
- type BatchBlock
 - type BlockT
 - type HashPageTable
 - type ObjectTree
 - func (stree *ObjectTree) Equal(o *ObjectTree) bool
 - func (stree *ObjectTree) Merge(ot *ObjectTree)
 - func (stree *ObjectTree) ReadFromV2(r io.Reader) (n int64, err error)
 - func (stree *ObjectTree) ReadFromV3(r io.Reader) (n int64, err error)
 - func (stree *ObjectTree) WriteTo(w io.Writer) (n int64, err error)
 
- type PageT
 - type PreparedCompactedBlockData
 - type RowsT
 - type TableTree
 - func (ttree *TableTree) AddObject(sid *objectio.ObjectId)
 - func (ttree *TableTree) Compact() (empty bool)
 - func (ttree *TableTree) Equal(o *TableTree) bool
 - func (ttree *TableTree) GetObject(id types.Objectid) *ObjectTree
 - func (ttree *TableTree) IsEmpty() bool
 - func (ttree *TableTree) Merge(ot *TableTree)
 - func (ttree *TableTree) ReadFromWithVersion(r io.Reader, ver uint16) (n int64, err error)
 - func (ttree *TableTree) ShortBlocksString() string
 - func (ttree *TableTree) Shrink(objID types.Objectid) (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)
 - 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) AddObject(dbID, tableID uint64, id *objectio.ObjectId)
 - func (tree *Tree) AddTable(dbID, id uint64)
 - func (tree *Tree) Compact() (empty bool)
 - func (tree *Tree) Equal(o *Tree) bool
 - func (tree *Tree) GetObject(tableID uint64, objID types.Objectid) *ObjectTree
 - 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) ReadFromWithVersion(r io.Reader, ver uint16) (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 ¶
const ( MemoTreeVersion1 uint16 = iota MemoTreeVersion2 MemoTreeVersion3 )
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
	ObjectFn func(uint64, uint64, *objectio.ObjectId) error
	BlockFn  func(uint64, uint64, *objectio.ObjectId, 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) VisitObject ¶ added in v1.1.0
func (visitor *BaseTreeVisitor) VisitObject(dbID, tableID uint64, ObjectID *objectio.ObjectId) (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 ObjectTree ¶ added in v1.1.0
func NewObjectTree ¶ added in v1.1.0
func NewObjectTree(id *objectio.ObjectId) *ObjectTree
func ReadObjectTreesV1 ¶ added in v1.1.0
func ReadObjectTreesV1(r io.Reader) (strees []*ObjectTree, n int64, err error)
func (*ObjectTree) Equal ¶ added in v1.1.0
func (stree *ObjectTree) Equal(o *ObjectTree) bool
func (*ObjectTree) Merge ¶ added in v1.1.0
func (stree *ObjectTree) Merge(ot *ObjectTree)
func (*ObjectTree) ReadFromV2 ¶ added in v1.1.0
func (stree *ObjectTree) ReadFromV2(r io.Reader) (n int64, err error)
func (*ObjectTree) ReadFromV3 ¶ added in v1.2.0
func (stree *ObjectTree) ReadFromV3(r io.Reader) (n int64, err error)
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 TableTree ¶ added in v0.8.0
type TableTree struct {
	DbID uint64
	ID   uint64
	Objs map[objectio.ObjectId]*ObjectTree
}
    func NewTableTree ¶ added in v0.8.0
func (*TableTree) GetObject ¶ added in v1.1.0
func (ttree *TableTree) GetObject(id types.Objectid) *ObjectTree
func (*TableTree) ReadFromWithVersion ¶ added in v1.1.0
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) Delete ¶ added in v1.2.3
func (t *TransDelsForBlks) Delete(blkID types.Blockid)
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 (*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)
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) GetObject ¶ added in v1.1.0
func (tree *Tree) GetObject(tableID uint64, objID types.Objectid) *ObjectTree
func (*Tree) ReadFromWithVersion ¶ added in v1.1.0
func (*Tree) TableCount ¶ added in v0.8.0
func (*Tree) Visit ¶ added in v0.8.0
func (tree *Tree) Visit(visitor TreeVisitor) (err error)