Documentation ¶
Index ¶
Constants ¶
const HeaderSize = 16
SegmentOffset describes the general offset in a segment until the data starts, it is comprised of 2 bytes for level, 2 bytes for version, 2 bytes for secondary index count, 2 bytes for strategy, 8 bytes for the pointer to the index part
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiskTree ¶
type DiskTree struct {
// contains filtered or unexported fields
}
DiskTree is a read-only wrapper around a marshalled index search tree, which can be used for reading, but cannot change the underlying structure. It is thus perfectly suited as an index for an (immutable) LSM disk segment, but pretty much useless for anything else
func NewDiskTree ¶
func (*DiskTree) AllKeys ¶
AllKeys is a relatively expensive operation as it basically does a full disk read of the index. It is meant for one of operations, such as initializing a segment where we need access to all keys, e.g. to build a bloom filter. This should not run at query time.
The binary tree is traversed in Level-Order so keys have no meaningful order. Do not use this method if an In-Order traversal is required, but only for use cases who don't require a specific order, such as building a bloom filter.
type Header ¶ added in v1.18.0
type Header struct { Level uint16 Version uint16 SecondaryIndices uint16 Strategy Strategy IndexStart uint64 }
func (*Header) PrimaryIndex ¶ added in v1.18.0
func (*Header) SecondaryIndex ¶ added in v1.18.0
type Key ¶ added in v1.18.0
Key is a helper struct that can be used to build the key nodes for the segment index. It contains the primary key and an arbitrary number of secondary keys, as well as valueStart and valueEnd indicator. Those are used to find the correct payload for each key.
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}