Documentation
¶
Index ¶
- type BatchedIteratorAsc
- type BatchedIteratorDesc
- type Block
- type BlockPacker
- type Counter
- type Cursor
- type IteratorAsc
- type IteratorDesc
- type Loader
- type Table
- func (t *Table) GetAdjustedMinTID(blockIndex uint32) uint32
- func (t *Table) GetChunkIndex(blockIndex, tid uint32) int
- func (t *Table) GetChunksCount(blockIndex uint32) uint32
- func (t *Table) GetFirstBlockIndexForTID(tid uint32) uint32
- func (t *Table) GetLastBlockIndexForTID(tid uint32) uint32
- func (t *Table) HasTIDInNextBlock(blockIndex, tid uint32) bool
- func (t *Table) HasTIDInPrevBlock(blockIndex, tid uint32) bool
- func (t *Table) SeekBlockGeq(index, tid, nextLID uint32) uint32
- func (t *Table) SeekBlockLeq(index, tid, nextLID uint32) uint32
- type UnpackBuffer
- type UnpackedBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchedIteratorAsc ¶ added in v0.77.0
type BatchedIteratorAsc struct {
Cursor
}
func NewBatchedIteratorAsc ¶ added in v0.77.0
func NewBatchedIteratorAsc(it *IteratorAsc) *BatchedIteratorAsc
func (*BatchedIteratorAsc) NextBatch ¶ added in v0.77.0
func (it *BatchedIteratorAsc) NextBatch() node.LIDBatch
func (*BatchedIteratorAsc) NextBatchGeq ¶ added in v0.77.0
func (it *BatchedIteratorAsc) NextBatchGeq(nextID node.LID) node.LIDBatch
func (*BatchedIteratorAsc) String ¶ added in v0.77.0
func (*BatchedIteratorAsc) String() string
type BatchedIteratorDesc ¶ added in v0.77.0
type BatchedIteratorDesc struct {
Cursor
}
func NewBatchedIteratorDesc ¶ added in v0.77.0
func NewBatchedIteratorDesc(it *IteratorDesc) *BatchedIteratorDesc
func (*BatchedIteratorDesc) NextBatch ¶ added in v0.77.0
func (it *BatchedIteratorDesc) NextBatch() node.LIDBatch
func (*BatchedIteratorDesc) NextBatchGeq ¶ added in v0.77.0
func (it *BatchedIteratorDesc) NextBatchGeq(nextID node.LID) node.LIDBatch
func (*BatchedIteratorDesc) String ¶ added in v0.77.0
func (*BatchedIteratorDesc) String() string
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block contains LIDs in variable format. It's used during search/queries processing. Each posting list is either a roaring bitmap or a delta-encoded slice. bitmapIndexes holds the list indexes that were stored as bitmaps.
On-disk format:
[bitmapsCount: uint32] — number of lists stored as roaring bitmaps [bitmaps: bitmapsCount × roaring bitmap, serial format] [bitmapIndexes: delta-bitpack []uint32] — sorted list indices encoded as bitmaps [offsets: delta-bitpack []uint32] — slice boundaries in the delta-encoded LIDs array [lids: delta-bitpack []uint32] — concatenated delta-encoded LID values
func (*Block) AppendLIDsTo ¶ added in v0.77.0
func (*Block) GetSizeBytes ¶
func (*Block) Unpack ¶
func (b *Block) Unpack(data []byte, fracVer config.BinaryDataVersion, buf *UnpackBuffer) error
type BlockPacker ¶ added in v0.77.0
type BlockPacker struct {
LidsBitmapThreshold int
// contains filtered or unexported fields
}
func NewBlockPacker ¶ added in v0.77.0
func NewBlockPacker() *BlockPacker
func (*BlockPacker) Pack ¶ added in v0.77.0
func (p *BlockPacker) Pack(b *UnpackedBlock, dst []byte) []byte
type IteratorAsc ¶
type IteratorAsc struct {
Cursor
// contains filtered or unexported fields
}
func NewIteratorAsc ¶ added in v0.77.0
func (*IteratorAsc) Next ¶
func (it *IteratorAsc) Next() node.LID
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 struct {
Cursor
// contains filtered or unexported fields
}
func NewIteratorDesc ¶ added in v0.77.0
func (*IteratorDesc) Next ¶
func (it *IteratorDesc) Next() node.LID
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
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
FirstLIDs []uint32
LastLIDs []uint32
FracVer config.BinaryDataVersion
IsContinued []bool // legacy field, only used in BinaryDataV0-BinaryDataV4 (inclusive)
}
func (*Table) GetAdjustedMinTID ¶
func (*Table) GetChunkIndex ¶
func (*Table) GetChunksCount ¶
func (*Table) GetFirstBlockIndexForTID ¶
GetFirstBlockIndexForTID finds first block index in file for TID
func (*Table) GetLastBlockIndexForTID ¶
GetLastBlockIndexForTID finds last block index in file for TID
func (*Table) HasTIDInNextBlock ¶
func (*Table) HasTIDInPrevBlock ¶
func (*Table) SeekBlockGeq ¶ added in v0.77.0
SeekBlockGeq finds next block for provided TID which contains lid greater or equal to provided LID starting from provided index (inclusive). - index: an index of block which is already suits and contains next portion of LIDs. Safe to return for old fractions.
func (*Table) SeekBlockLeq ¶ added in v0.77.0
SeekBlockLeq finds next block with lowest index for provided TID which contains LIDs less or equal to provided LID starting from provided index (inclusive). - index: an index of block which is already suits and contains next portion of LIDs. Safe to return for old fractions.
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)
type UnpackedBlock ¶ added in v0.77.0
UnpackedBlock contains accumulated LIDs ready to pack. It's only used on sealing/compaction (index writing) time.