pub enum BlockType {
Show 16 variants
Data,
Index,
Filter,
Meta,
RangeTombstone,
Manifest,
ManifestFooter,
BlockLayout,
Locator,
SeqnoBounds,
ZoneMap,
DeleteBitmap,
ColumnPageDirectory,
ColumnPage,
ColumnZones,
OwnedBlobObjects,
}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.
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.
ColumnPageDirectory
The directory of one columnar row group’s pages: for each page, where it starts relative to the row group, how long it is, and which part of which column’s encoding it holds.
The index points at this block, not at the pages, so a row group keeps
exactly one index entry and block_id keeps its meaning. It is written
first in the group, immediately ahead of the page holding keys and MVCC
metadata, so one coalesced read covers what every read of the group
needs before it knows anything else.
ColumnPage
One page of a columnar row group: a single part of a single column’s
encoding, for the group’s rows. Row groups are produced by the transpose
on flush and compaction for a columnar tree, and by columnar ingest;
the codec framework that fills their pages is built only with the
columnar feature, while the wire tags are reserved unconditionally.
An ordinary block in every other respect, and deliberately so: its
header, checksum, compression, encryption and ECC are the ones already
defined and tested. What it does not have is an index entry — it is
reached through Self::ColumnPageDirectory, and its identity binds
its LOGICAL position (row group ordinal, page slot) to replace the
position integrity the index supplies for blocks it names.
ColumnZones
The statistics zones of a columnar row group’s row pages for its
columns other than the key: one zone per row page and column. Written
last in the group, after its pages, so only a read that prunes on one
of those columns reads it; a full scan or a projection that does not
prune never pays for it. The key column’s zones live in the
Self::ColumnPageDirectory, which every point read reads anyway.
OwnedBlobObjects
Optional per-table list of the blob objects the table’s cell rows own, sorted by blob file and offset: what dropping the whole table releases, read without reading its data. Absent when the table owns no cell-row object.
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