pub struct SummaryReader { /* private fields */ }Expand description
High-level Summary.db file reader
Implementations§
Source§impl SummaryReader
impl SummaryReader
Sourcepub async fn open(path: &Path, platform: Arc<Platform>) -> Result<Self>
pub async fn open(path: &Path, platform: Arc<Platform>) -> Result<Self>
Open and parse a Summary.db file
Sourcepub fn get_entries(&self) -> &[SummaryEntry]
pub fn get_entries(&self) -> &[SummaryEntry]
Get all summary entries
Sourcepub fn get_header(&self) -> &SummaryHeader
pub fn get_header(&self) -> &SummaryHeader
Get the header
Sourcepub fn get_first_key(&self) -> &[u8] ⓘ
pub fn get_first_key(&self) -> &[u8] ⓘ
Get the first partition key
Sourcepub fn get_last_key(&self) -> &[u8] ⓘ
pub fn get_last_key(&self) -> &[u8] ⓘ
Get the last partition key
Sourcepub fn find_entry_for_position(
&self,
target_position: u64,
) -> Option<&SummaryEntry>
pub fn find_entry_for_position( &self, target_position: u64, ) -> Option<&SummaryEntry>
Find the best summary entry for a given index position
Returns the entry with the largest position <= target position. This is useful for finding which summary entry covers a given position in the Index.db file.
Sourcepub fn get_entry_at(&self, index: usize) -> Option<&SummaryEntry>
pub fn get_entry_at(&self, index: usize) -> Option<&SummaryEntry>
Find the entry at a specific index
Sourcepub fn find_by_key(&self, key: &[u8]) -> Option<SummaryInterval>
pub fn find_by_key(&self, key: &[u8]) -> Option<SummaryInterval>
Binary-search the token-ordered sampled keys for the Index.db interval that
must contain key’s partition entry (issue #2412, design §A/§B — the core new
primitive that makes BIG open Cassandra-lazy).
The Summary.db samples are in Cassandra token order (murmur3 of the raw
partition key, ties broken by raw bytes), NOT lexicographic byte order, so the
search compares with [cmp_partition_keys_by_token] — comparing raw bytes would
be wrong for any non-degenerate ring. Returns the half-open byte range
[start, end) into Index.db: start is the position of the greatest sample
whose key is <= key (Cassandra’s getPosition floor); end is the next
sample’s position, or None (scan to EOF) when the floor is the last sample.
When key sorts below the first sample the floor clamps to sample 0 (Cassandra
begins its walk at the start of the index): the returned first interval is then
searched and yields an authoritative absence — the out-of-[first_key,last_key]
case is already answered upstream by the C5 range short-circuit with zero probe
work. Returns None only for an empty summary (no samples to bound a walk).
The interval boundary is STRUCTURAL — two adjacent authoritative summary sample positions — never a guessed offset (no-heuristics, issue #28).
Sourcepub fn scan_start_position_for_token(&self, start_excl: i64) -> u64
pub fn scan_start_position_for_token(&self, start_excl: i64) -> u64
The authoritative Index.db byte offset from which a token-range scan whose
exclusive lower bound is start_excl should begin its forward walk (issue
#2412 §C / #2413 Option A). Returns the position of the greatest sample whose
murmur3 token is <= start_excl — the floor sample — so the forward walk
covers every in-range partition (token > start_excl) while skipping the
wholly-below-range prefix. Clamps to sample 0’s position (the index start)
when every sample sorts above start_excl, and returns 0 for an empty
summary (scan from the beginning). The samples are token-ordered on disk, so
a token binary search is exact — no key is needed and nothing is guessed
(no-heuristics, issue #28).
Sourcepub fn get_statistics(&self) -> SummaryStatistics
pub fn get_statistics(&self) -> SummaryStatistics
Get summary statistics
Sourcepub async fn validate_integrity(&self) -> Result<Vec<String>>
pub async fn validate_integrity(&self) -> Result<Vec<String>>
Validate summary integrity