Skip to main content

TableProperties

Struct TableProperties 

Source
pub struct TableProperties<'a> { /* private fields */ }
Expand description

Properties of one SST file, borrowed from the event that produced it.

Implementations§

Source§

impl<'a> TableProperties<'a>

Source

pub fn orig_file_number(&self) -> u64

File number at creation time, or 0 when unknown. When known it identifies the SST file uniquely in combination with Self::db_session_id.

Source

pub fn data_size(&self) -> u64

Total size of all data blocks.

Source

pub fn uncompressed_data_size(&self) -> u64

Total uncompressed size of all data blocks. Recorded since RocksDB 10.7.

Source

pub fn index_size(&self) -> u64

Size of the index block.

Source

pub fn index_partitions(&self) -> u64

Number of index partitions, set only when the two level index search is used.

Source

pub fn top_level_index_size(&self) -> u64

Size of the top level index, set only when the two level index search is used.

Source

pub fn index_key_is_user_key(&self) -> bool

Whether index keys are plain user keys. When false they also carry the 8 byte sequence number of the internal key format.

Source

pub fn index_value_is_delta_encoded(&self) -> bool

Whether index values are delta encoded.

Source

pub fn udi_is_primary_index(&self) -> bool

Whether the UDI is the primary index for reads. The standard index is still fully populated alongside it.

Source

pub fn filter_size(&self) -> u64

Size of the filter block.

Source

pub fn raw_key_size(&self) -> u64

Total key size before compression and block encoding.

Source

pub fn raw_value_size(&self) -> u64

Total value size before compression and block encoding.

Source

pub fn num_data_blocks(&self) -> u64

Number of data blocks in this file.

Source

pub fn num_data_blocks_compression_rejected(&self) -> u64

Data blocks stored uncompressed because the compressed output blew past the ratio limit in CompressionOptions::max_compressed_bytes_per_kb.

Source

pub fn num_data_blocks_compression_bypassed(&self) -> u64

Data blocks stored uncompressed because compression was never attempted, for example with kNoCompression or with no compressor available.

Source

pub fn num_uniform_blocks(&self) -> u64

Number of uniform blocks in this file.

Source

pub fn num_entries(&self) -> u64

Number of entries in this file.

Source

pub fn num_filter_entries(&self) -> u64

Number of unique entries, keys or prefixes, added to the filter.

Source

pub fn num_deletions(&self) -> u64

Number of deletions in this file.

Source

pub fn num_merge_operands(&self) -> u64

Number of merge operands in this file.

Source

pub fn num_range_deletions(&self) -> u64

Number of range deletions in this file.

Source

pub fn format_version(&self) -> u64

SST format version, reserved for backward compatibility.

Source

pub fn fixed_key_len(&self) -> u64

Byte length shared by every key, or 0 when keys are variable length.

Source

pub fn column_family_id(&self) -> u64

Id of the column family this file belongs to, matching Self::column_family_name. An unknown column family reads back as i32::MAX.

Source

pub fn creation_time(&self) -> u64

Oldest ancestor time, 0 when unknown. For a flush this is the oldest key time in the file, falling back to the flush time. For a compaction it is the oldest such time across all input files, falling back to when this output file was created.

Source

pub fn oldest_key_time(&self) -> u64

Timestamp of the earliest key, 0 when unknown.

Source

pub fn newest_key_time(&self) -> u64

Timestamp of the newest key, 0 when unknown.

Source

pub fn file_creation_time(&self) -> u64

Time the SST file was actually created, 0 when unknown.

Source

pub fn slow_compression_estimated_data_size(&self) -> u64

Estimated size of the data blocks under a relatively slower compression algorithm, 0 when unknown. Comes from ColumnFamilyOptions::sample_for_compression.

Source

pub fn fast_compression_estimated_data_size(&self) -> u64

Estimated size of the data blocks under a relatively faster compression algorithm, 0 when unknown. Comes from ColumnFamilyOptions::sample_for_compression.

Source

pub fn external_sst_file_global_seqno_offset(&self) -> u64

Offset within the file of the external SST file global seqno value, 0 when the file has no such property.

Source

pub fn tail_start_offset(&self) -> u64

Offset where the tail of the file begins, meaning every block after the data blocks.

Source

pub fn user_defined_timestamps_persisted(&self) -> bool

Value of AdvancedColumnFamilyOptions::persist_user_defined_timestamps when the file was written. Defaults to true and is only recorded in the file when false.

Source

pub fn key_largest_seqno(&self) -> u64

Largest sequence number among the keys in this file. Only meaningful when Self::has_key_largest_seqno is true, otherwise it reads back as u64::MAX.

Source

pub fn key_smallest_seqno(&self) -> u64

Smallest sequence number among the keys in this file. Only meaningful when Self::has_key_smallest_seqno is true, otherwise it reads back as u64::MAX.

Source

pub fn has_key_largest_seqno(&self) -> bool

Whether Self::key_largest_seqno holds a real sequence number. It should be true unless the file is empty.

Source

pub fn has_key_smallest_seqno(&self) -> bool

Whether Self::key_smallest_seqno holds a real sequence number. It should be true unless the file is empty.

Source

pub fn data_block_restart_interval(&self) -> u64

Restart interval used for data blocks when the file was written, 0 when unknown.

Source

pub fn index_block_restart_interval(&self) -> u64

Restart interval used for index blocks when the file was written, 0 when unknown.

Source

pub fn separate_key_value_in_data_block(&self) -> bool

Whether data blocks store keys and values separately. The block footer is the real source of truth, this property exists for debugging and validation.

Source

pub fn db_id(&self) -> &'a [u8]

DB identity, generated the first time the DB was created. Empty when unset.

Source

pub fn db_session_id(&self) -> &'a [u8]

DB session identity, regenerated every time the DB is opened. Empty when unset.

Source

pub fn db_host_id(&self) -> &'a [u8]

Location of the machine hosting the DB, the hostname by default. It can change whenever the DB is reopened.

Source

pub fn column_family_name(&self) -> &'a [u8]

Name of the column family this file belongs to. Empty when the column family is unknown.

Source

pub fn filter_policy_name(&self) -> &'a [u8]

Name of the filter policy used for this file. Empty when no filter policy was used.

Source

pub fn comparator_name(&self) -> &'a [u8]

Name of the comparator used for this file.

Source

pub fn merge_operator_name(&self) -> &'a [u8]

Name of the merge operator used for this file. Reads back as nullptr when no merge operator was used.

Source

pub fn prefix_extractor_name(&self) -> &'a [u8]

Name of the prefix extractor used for this file. Reads back as nullptr when no prefix extractor was used.

Source

pub fn property_collectors_names(&self) -> &'a [u8]

Comma separated names of the property collector factories used for this file.

Source

pub fn compression_name(&self) -> &'a [u8]

Identifies the compression algorithm or schema used for this file. Below format version 7 it is a built in compression type name, from version 7 on it is <compatibility_name>;<hex coded compression types>;<future use>.

Source

pub fn compression_options(&self) -> &'a [u8]

Compression options used to compress this file.

Source

pub fn seqno_to_time_mapping(&self) -> &'a [u8]

Delta encoded sequence number to time mapping.

Source

pub fn user_collected_properties_count(&self) -> usize

Number of user collected properties recorded for this file.

Source

pub fn user_collected_property_at( &self, pos: usize, ) -> Option<(&'a [u8], &'a [u8])>

The user collected property at pos in key order, or None once pos runs past the end.

Costs O(pos): the C API walks the underlying std::map from the beginning on every call, so random access here is not cheap.

Source

pub fn user_collected_properties( &self, ) -> impl Iterator<Item = (&'a [u8], &'a [u8])> + '_

Walks the user collected properties in key order, borrowing every key and value.

Lazy and allocation free, but each step costs O(pos) because the C API walks the map from the beginning for every lookup. A full pass over n properties is therefore O(n^2), which is fine for the handful of entries most collectors emit and slow if you have thousands.

Source

pub fn readable_properties_count(&self) -> usize

Number of human readable properties recorded for this file. These are what collectors return from GetReadableProperties and exist for logging.

Source

pub fn readable_property_at(&self, pos: usize) -> Option<(&'a [u8], &'a [u8])>

The readable property at pos in key order, or None once pos runs past the end.

Costs O(pos): the C API walks the underlying std::map from the beginning on every call, so random access here is not cheap.

Source

pub fn readable_properties( &self, ) -> impl Iterator<Item = (&'a [u8], &'a [u8])> + '_

Walks the human readable properties in key order, borrowing every key and value.

Lazy and allocation free, but each step costs O(pos) because the C API walks the map from the beginning for every lookup. A full pass over n properties is therefore O(n^2), which is fine for the handful of entries most collectors emit and slow if you have thousands.

Auto Trait Implementations§

§

impl<'a> !Send for TableProperties<'a>

§

impl<'a> !Sync for TableProperties<'a>

§

impl<'a> Freeze for TableProperties<'a>

§

impl<'a> RefUnwindSafe for TableProperties<'a>

§

impl<'a> Unpin for TableProperties<'a>

§

impl<'a> UnsafeUnpin for TableProperties<'a>

§

impl<'a> UnwindSafe for TableProperties<'a>

Blanket Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.