pub struct StatisticsReader { /* private fields */ }Expand description
High-level Statistics.db file reader
Implementations§
Source§impl StatisticsReader
impl StatisticsReader
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 Statistics.db file
Sourcepub fn statistics(&self) -> &SSTableStatistics
pub fn statistics(&self) -> &SSTableStatistics
Get the raw statistics data
Sourcepub fn analyze(&self) -> StatisticsSummary
pub fn analyze(&self) -> StatisticsSummary
Get a human-readable summary analysis
Sourcepub async fn validate_checksum(&self) -> Result<bool>
pub async fn validate_checksum(&self) -> Result<bool>
Validate checksum for parsed statistics
Sourcepub fn matches_table(&self, table_id: &[u8; 16]) -> bool
pub fn matches_table(&self, table_id: &[u8; 16]) -> bool
Check if the Statistics.db corresponds to a specific table
Sourcepub fn live_row_count(&self) -> u64
pub fn live_row_count(&self) -> u64
Get live row count (excluding tombstones)
Sourcepub fn timestamp_range(&self) -> (i64, i64)
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.
Sourcepub fn max_timestamp(&self) -> Option<i64>
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.
Sourcepub fn compression_info(&self) -> Option<(&str, f64)>
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)).
Sourcepub fn partition_info(&self) -> Option<(u64, f64, u64)>
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).
Sourcepub fn column_stats(&self, column_name: &str) -> Option<&ColumnStatistics>
pub fn column_stats(&self, column_name: &str) -> Option<&ColumnStatistics>
Get column statistics by name
Sourcepub fn column_names(&self) -> Vec<&str>
pub fn column_names(&self) -> Vec<&str>
Get all column names with statistics
Sourcepub fn has_ttl_data(&self) -> bool
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.
Sourcepub fn disk_usage(&self) -> Option<(u64, u64, f64)>
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).
Sourcepub fn generate_report(&self, include_column_details: bool) -> String
pub fn generate_report(&self, include_column_details: bool) -> String
Generate a detailed report
Sourcepub fn compact_summary(&self) -> String
pub fn compact_summary(&self) -> String
Get a compact summary for CLI display