pub enum BlockType {
Show 13 variants
Data,
Index,
Filter,
Meta,
RangeTombstone,
Manifest,
ManifestFooter,
BlockLayout,
Locator,
SeqnoBounds,
ZoneMap,
Columnar,
DeleteBitmap,
}Expand description
The mutually-exclusive ROLE of a block within a table file.
BlockType answers “what is this block and which parser decodes
its logical structure” — not “how was its payload post-processed”.
Orthogonal, composable transform layers (compression, encryption,
Reed-Solomon ECC, per-KV checksum footer) are NOT roles: they
stack on top of a block of any role and are recorded in the block
header’s block_flags bitfield, not here. A compressed, encrypted,
per-KV-checked data block is still BlockType::Data with three
transform bits set.
Variants§
Data
User key/value entries (the SST data payload).
Index
Block handles (offset/size/key/seqno) pointing at data blocks.
Filter
Bloom / Ribbon filter bit arrays.
Meta
Sorted key/value table properties (the SST metadata section).
RangeTombstone
Range tombstone entries, written as a separate block.
Manifest
One section of the Blocks-based manifest (e.g. tables,
blob_files, format_version). Payload is the raw section
bytes that the manifest writer puts there. All Block-level
protections (XXH3, optional ECC, optional AEAD) apply, so
the section gains bit-rot defence + (optional) encryption /
recovery automatically.
Footer Block of the Blocks-based manifest. Payload carries
manifest_layout_version, flags, section count, and the
table of contents (TOC) for the surrounding Manifest
section Blocks. Written last (primary read target) and
mirrored at file offset 0 in a 4 KiB padded region for
partial-write recovery.
BlockLayout
Optional per-table index of inner zstd-block layouts: for each data block that compressed into >= 2 inner zstd blocks, its file offset and the cumulative decompressed END offsets of those inner blocks. Lets a range query partial-decode only the inner blocks covering a key range. Absent unless the table has at least one such multi-inner-block block.
Locator
Optional per-table retrieval-ribbon locator section: maps each key to a
packed (block_id, slot) for O(1) point reads. Present by default (block
precision); absent when the level’s locator policy is disabled or the
per-SST ribbon could not be built.
SeqnoBounds
Optional per-table seqno-bounds section: maps each data block’s file
offset to its [seqno_min, seqno_max], powering the scan_since_seqno
block-skip without bloating the index entries. Absent unless
seqno_in_index is on.
ZoneMap
Optional per-table zone-map section: maps each data block’s file offset
to per-column (min, max, null_count, row_count) statistics, letting a
range / analytical scan skip a block whose stats prove no predicate
match without decoding it. Kept parallel to the index (like
Self::SeqnoBounds) so point reads never load it. Off by default;
absent unless the zone-map policy is enabled.
Columnar
A PAX / rowgroup columnar block: a row-group laid out as per-column
chunks rather than row-major key/value entries. Each chunk is a typed,
codec-tagged opaque byte array plus a validity bitmap. Produced by the
transpose on flush / major-compaction for a columnar tree / CF and read
as a ColumnBatch. The wire tag is reserved unconditionally; the codec
framework that fills these blocks is built only with the columnar
feature.
DeleteBitmap
Optional per-table positional delete-bitmap section: marks, by row
position, which rows of the table’s columnar segment are deleted. A pure
membership set (MVCC reconciled at materialization via the compaction
watermark), applied as a mask at scan time. Kept parallel to the data
(like Self::ZoneMap) so a read without deletes pays nothing. Absent
unless the segment has materialized deletes.
Trait Implementations§
impl Copy for BlockType
impl Eq for BlockType
impl StructuralPartialEq for BlockType
Auto Trait Implementations§
impl Freeze for BlockType
impl RefUnwindSafe for BlockType
impl Send for BlockType
impl Sync for BlockType
impl Unpin for BlockType
impl UnsafeUnpin for BlockType
impl UnwindSafe for BlockType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more