model

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBlockKeyPrefix

func DecodeBlockKeyPrefix(rowid types.Rowid) (segmentId, blockId uint64)

func DecodePhyAddrKey added in v0.6.0

func DecodePhyAddrKey(src types.Rowid) (segmentId, blockId uint64, offset uint32)

func DecodePhyAddrKeyFromValue added in v0.6.0

func DecodePhyAddrKeyFromValue(v any) (segmentId, blockId uint64, offset uint32)

func EncodeBlockKeyPrefix

func EncodeBlockKeyPrefix(segmentId, blockId uint64) []byte

EncodeBlockKeyPrefix [48 Bit (BlockID) + 48 Bit (SegmentID)]

func EncodePhyAddrKey added in v0.6.0

func EncodePhyAddrKey(segmentId, blockId uint64, offset uint32) types.Rowid

func EncodePhyAddrKeyWithPrefix added in v0.6.0

func EncodePhyAddrKeyWithPrefix(prefix []byte, offset uint32) types.Rowid

func PreparePhyAddrData added in v0.6.0

func PreparePhyAddrData(typ types.Type, prefix []byte, startRow, length uint32) (col containers.Vector, err error)

func PreparePhyAddrDataWithPool added in v0.6.0

func PreparePhyAddrDataWithPool(typ types.Type, prefix []byte, startRow, length uint32, pool *mpool.MPool) (col containers.Vector, err error)

Types

type BlockView

type BlockView struct {
	Ts               types.TS
	Columns          map[int]*ColumnView
	DeleteMask       *roaring.Bitmap
	DeleteLogIndexes []*wal.Index
}

func NewBlockView

func NewBlockView(ts types.TS) *BlockView

func (*BlockView) Close

func (view *BlockView) Close()

func (*BlockView) Eval

func (view *BlockView) Eval(clear bool) (err error)

func (*BlockView) GetColumnData

func (view *BlockView) GetColumnData(i int) containers.Vector

func (*BlockView) Orphan

func (view *BlockView) Orphan(i int) containers.Vector

func (*BlockView) SetBatch

func (view *BlockView) SetBatch(bat *containers.Batch)

func (*BlockView) SetData

func (view *BlockView) SetData(i int, data containers.Vector)

func (*BlockView) SetLogIndexes

func (view *BlockView) SetLogIndexes(i int, indexes []*wal.Index)

func (*BlockView) SetUpdates

func (view *BlockView) SetUpdates(i int, mask *roaring.Bitmap, vals map[uint32]any)

type ColumnView

type ColumnView struct {
	ColIdx int
	Ts     types.TS

	UpdateMask *roaring.Bitmap
	UpdateVals map[uint32]any
	DeleteMask *roaring.Bitmap
	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) 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 PageT added in v0.6.0

type PageT[T common.IRef] interface {
	common.IRef
	Pin() *common.PinnedItem[T]
	TTL(time.Time, time.Duration) bool
	ID() *common.ID
}

type PreparedCompactedBlockData

type PreparedCompactedBlockData struct {
	Columns *containers.Batch
	SortKey containers.Vector
}

func NewPreparedCompactedBlockData

func NewPreparedCompactedBlockData() *PreparedCompactedBlockData

func (*PreparedCompactedBlockData) Close

func (preparer *PreparedCompactedBlockData) Close()

type TransferHashPage added in v0.6.0

type TransferHashPage struct {
	common.RefHelper
	// contains filtered or unexported fields
}

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 (*TransferHashPage) String added in v0.6.0

func (page *TransferHashPage) String() string

func (*TransferHashPage) TTL added in v0.6.0

func (page *TransferHashPage) TTL(now time.Time, ttl time.Duration) bool

func (*TransferHashPage) Train added in v0.6.0

func (page *TransferHashPage) Train(from uint32, to types.Rowid)

func (*TransferHashPage) Transfer added in v0.6.0

func (page *TransferHashPage) Transfer(from uint32) (dest types.Rowid, ok bool)

type TransferTable added in v0.6.0

type TransferTable[T PageT[T]] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL