lids

package
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	LIDs    []uint32
	Offsets []uint32
	// todo remove this legacy field
	IsLastLID bool
}

func (*Block) GetLIDs added in v0.74.0

func (b *Block) GetLIDs(i int) []uint32

func (*Block) GetSizeBytes

func (b *Block) GetSizeBytes() int

func (*Block) Pack

func (b *Block) Pack(dst []byte, buf []uint32) []byte

func (*Block) Unpack

func (b *Block) Unpack(data []byte, fracVer config.BinaryDataVersion, buf *UnpackBuffer) error

type Counter

type Counter interface {
	AddLIDsCount(int)
}

type Cursor

type Cursor struct {
	// contains filtered or unexported fields
}

func NewLIDsCursor

func NewLIDsCursor(
	table *Table,
	loader *Loader,
	startIndex uint32,
	tid uint32,
	counter Counter,
	minLID, maxLID uint32,
) *Cursor

type IteratorAsc

type IteratorAsc Cursor

func (*IteratorAsc) Next

func (it *IteratorAsc) Next() node.LID

func (*IteratorAsc) NextBatch added in v0.72.0

func (it *IteratorAsc) NextBatch() node.LIDBatch

func (*IteratorAsc) NextBatchGeq added in v0.72.0

func (it *IteratorAsc) NextBatchGeq(nextID node.LID) node.LIDBatch

func (*IteratorAsc) NextGeq added in v0.69.0

func (it *IteratorAsc) NextGeq(nextID node.LID) node.LID

NextGeq returns the next (in reverse iteration order) LID that is <= maxLID.

func (*IteratorAsc) String

func (*IteratorAsc) String() string

type IteratorDesc

type IteratorDesc Cursor

func (*IteratorDesc) Next

func (it *IteratorDesc) Next() node.LID

func (*IteratorDesc) NextBatch added in v0.72.0

func (it *IteratorDesc) NextBatch() node.LIDBatch

func (*IteratorDesc) NextBatchGeq added in v0.72.0

func (it *IteratorDesc) NextBatchGeq(nextID node.LID) node.LIDBatch

func (*IteratorDesc) NextGeq added in v0.69.0

func (it *IteratorDesc) NextGeq(nextID node.LID) node.LID

NextGeq finds next greater or equal

func (*IteratorDesc) String

func (*IteratorDesc) String() string

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader is responsible for reading from disk, unpacking and caching LID. NOT THREAD SAFE. Do not use concurrently. Use your own Loader instance for each search query

func NewLoader

func NewLoader(fracVer config.BinaryDataVersion, r *storage.IndexReader, c *cache.Cache[*Block]) *Loader

func (*Loader) GetLIDsBlock

func (l *Loader) GetLIDsBlock(blockIndex uint32) (*Block, error)

type Table

type Table struct {
	StartBlockIndex uint32
	MaxTIDs         []uint32 // defines last tid for each block
	MinTIDs         []uint32 // defines first not continued tid for each block

	// TODO: We need fix MinTID issue that we have to compensate with DiskBlock.getAdjustedMinTID()
	// TODO: After that we do not need store IsContinued flag, and able calc it as MaxTIDs[i] == MinTIDs[i+1]
	IsContinued []bool
}

func NewTable

func NewTable(startOfLIDsBlockIndex uint32, minTIDs, maxTIDs []uint32, isContinued []bool) *Table

func (*Table) GetAdjustedMinTID

func (t *Table) GetAdjustedMinTID(blockIndex uint32) uint32

func (*Table) GetChunkIndex

func (t *Table) GetChunkIndex(blockIndex, tid uint32) int

func (*Table) GetChunksCount

func (t *Table) GetChunksCount(blockIndex uint32) uint32

func (*Table) GetFirstBlockIndexForTID

func (t *Table) GetFirstBlockIndexForTID(tid uint32) uint32

GetFirstBlockIndexForTID finds first block index in file for TID

func (*Table) GetLastBlockIndexForTID

func (t *Table) GetLastBlockIndexForTID(tid uint32) uint32

GetLastBlockIndexForTID finds last block index in file for TID

func (*Table) HasTIDInNextBlock

func (t *Table) HasTIDInNextBlock(blockIndex, tid uint32) bool

func (*Table) HasTIDInPrevBlock

func (t *Table) HasTIDInPrevBlock(blockIndex, tid uint32) bool

type UnpackBuffer

type UnpackBuffer struct {
	// contains filtered or unexported fields
}

UnpackBuffer keeps intermediate temporary buffers for decoding. Used only for a single fraction.

func (*UnpackBuffer) Reset added in v0.72.0

func (b *UnpackBuffer) Reset(fracVer config.BinaryDataVersion)

Jump to

Keyboard shortcuts

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