Skip to main content

SummaryReader

Struct SummaryReader 

Source
pub struct SummaryReader { /* private fields */ }
Expand description

High-level Summary.db file reader

Implementations§

Source§

impl SummaryReader

Source

pub async fn open(path: &Path, platform: Arc<Platform>) -> Result<Self>

Open and parse a Summary.db file

Source

pub fn get_entries(&self) -> &[SummaryEntry]

Get all summary entries

Source

pub fn get_header(&self) -> &SummaryHeader

Get the header

Source

pub fn get_first_key(&self) -> &[u8]

Get the first partition key

Source

pub fn get_last_key(&self) -> &[u8]

Get the last partition key

Source

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.

Source

pub fn get_entry_at(&self, index: usize) -> Option<&SummaryEntry>

Find the entry at a specific index

Source

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).

Source

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).

Source

pub fn get_statistics(&self) -> SummaryStatistics

Get summary statistics

Source

pub async fn validate_integrity(&self) -> Result<Vec<String>>

Validate summary integrity

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more