Skip to main content

StatisticsReader

Struct StatisticsReader 

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

High-level Statistics.db file reader

Implementations§

Source§

impl StatisticsReader

Source

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

Open and parse a Statistics.db file

Source

pub fn statistics(&self) -> &SSTableStatistics

Get the raw statistics data

Source

pub fn analyze(&self) -> StatisticsSummary

Get a human-readable summary analysis

Source

pub fn file_path(&self) -> &Path

Get the file path

Source

pub async fn validate_checksum(&self) -> Result<bool>

Validate checksum for parsed statistics

Source

pub fn matches_table(&self, table_id: &[u8; 16]) -> bool

Check if the Statistics.db corresponds to a specific table

Source

pub fn row_count(&self) -> u64

Get row count information

Source

pub fn live_row_count(&self) -> u64

Get live row count (excluding tombstones)

Source

pub fn timestamp_range(&self) -> (i64, i64)

Get timestamp range in microseconds as (min, max).

Note (#1729/#1653): the returned max is the i64::MIN “unavailable” sentinel when the enhanced (nb) parser could not authoritatively decode maxTimestamp from STATS (max_timestamp == None). This legacy tuple accessor preserves that documented sentinel contract; callers that need a guaranteed-real maximum should use Self::max_timestamp, which returns None for that case.

Source

pub fn max_timestamp(&self) -> Option<i64>

Get the authoritative SSTable maxTimestamp (microseconds), or None when it is not available (issue #1653 — max_timestamp == None).

Consumers that must not proceed without a real maximum (e.g. a compaction drop/GC gate, #1388) should gate on this returning Some.

Source

pub fn compression_info(&self) -> Option<(&str, f64)>

Get compression information as (algorithm, ratio), or None when compression statistics were not authoritatively parsed from Statistics.db (issue #1653 — the enhanced nb parser does not decode them; the value is not fabricated as ("unknown", 1.0)).

Source

pub fn partition_info(&self) -> Option<(u64, f64, u64)>

Get partition statistics as (min_size, avg_size, max_size), or None when partition statistics were not authoritatively parsed from Statistics.db (issue #1653 — not fabricated as all-zero).

Source

pub fn column_stats(&self, column_name: &str) -> Option<&ColumnStatistics>

Get column statistics by name

Source

pub fn column_names(&self) -> Vec<&str>

Get all column names with statistics

Source

pub fn has_ttl_data(&self) -> bool

Check if data has TTL information.

Returns false when the rows-with-TTL count is not authoritatively available (issue #1653 — rows_with_ttl == None, the enhanced nb parser case): “unknown” is reported as “no known TTL data” rather than fabricating a positive count.

Source

pub fn disk_usage(&self) -> Option<(u64, u64, f64)>

Get disk space usage as (compressed, uncompressed, ratio), or None when table statistics were not authoritatively parsed from Statistics.db (issue #1653 — not fabricated as all-zero).

Source

pub fn generate_report(&self, include_column_details: bool) -> String

Generate a detailed report

Source

pub fn compact_summary(&self) -> String

Get a compact summary for CLI display

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