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>
impl<'a> TableProperties<'a>
Sourcepub fn orig_file_number(&self) -> u64
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.
Sourcepub fn uncompressed_data_size(&self) -> u64
pub fn uncompressed_data_size(&self) -> u64
Total uncompressed size of all data blocks. Recorded since RocksDB 10.7.
Sourcepub fn index_size(&self) -> u64
pub fn index_size(&self) -> u64
Size of the index block.
Sourcepub fn index_partitions(&self) -> u64
pub fn index_partitions(&self) -> u64
Number of index partitions, set only when the two level index search is used.
Sourcepub fn top_level_index_size(&self) -> u64
pub fn top_level_index_size(&self) -> u64
Size of the top level index, set only when the two level index search is used.
Sourcepub fn index_key_is_user_key(&self) -> bool
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.
Sourcepub fn index_value_is_delta_encoded(&self) -> bool
pub fn index_value_is_delta_encoded(&self) -> bool
Whether index values are delta encoded.
Sourcepub fn udi_is_primary_index(&self) -> bool
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.
Sourcepub fn filter_size(&self) -> u64
pub fn filter_size(&self) -> u64
Size of the filter block.
Sourcepub fn raw_key_size(&self) -> u64
pub fn raw_key_size(&self) -> u64
Total key size before compression and block encoding.
Sourcepub fn raw_value_size(&self) -> u64
pub fn raw_value_size(&self) -> u64
Total value size before compression and block encoding.
Sourcepub fn num_data_blocks(&self) -> u64
pub fn num_data_blocks(&self) -> u64
Number of data blocks in this file.
Sourcepub fn num_data_blocks_compression_rejected(&self) -> u64
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.
Sourcepub fn num_data_blocks_compression_bypassed(&self) -> u64
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.
Sourcepub fn num_uniform_blocks(&self) -> u64
pub fn num_uniform_blocks(&self) -> u64
Number of uniform blocks in this file.
Sourcepub fn num_entries(&self) -> u64
pub fn num_entries(&self) -> u64
Number of entries in this file.
Sourcepub fn num_filter_entries(&self) -> u64
pub fn num_filter_entries(&self) -> u64
Number of unique entries, keys or prefixes, added to the filter.
Sourcepub fn num_deletions(&self) -> u64
pub fn num_deletions(&self) -> u64
Number of deletions in this file.
Sourcepub fn num_merge_operands(&self) -> u64
pub fn num_merge_operands(&self) -> u64
Number of merge operands in this file.
Sourcepub fn num_range_deletions(&self) -> u64
pub fn num_range_deletions(&self) -> u64
Number of range deletions in this file.
Sourcepub fn format_version(&self) -> u64
pub fn format_version(&self) -> u64
SST format version, reserved for backward compatibility.
Sourcepub fn fixed_key_len(&self) -> u64
pub fn fixed_key_len(&self) -> u64
Byte length shared by every key, or 0 when keys are variable length.
Sourcepub fn column_family_id(&self) -> u64
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.
Sourcepub fn creation_time(&self) -> u64
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.
Sourcepub fn oldest_key_time(&self) -> u64
pub fn oldest_key_time(&self) -> u64
Timestamp of the earliest key, 0 when unknown.
Sourcepub fn newest_key_time(&self) -> u64
pub fn newest_key_time(&self) -> u64
Timestamp of the newest key, 0 when unknown.
Sourcepub fn file_creation_time(&self) -> u64
pub fn file_creation_time(&self) -> u64
Time the SST file was actually created, 0 when unknown.
Sourcepub fn slow_compression_estimated_data_size(&self) -> u64
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.
Sourcepub fn fast_compression_estimated_data_size(&self) -> u64
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.
Sourcepub fn external_sst_file_global_seqno_offset(&self) -> u64
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.
Sourcepub fn tail_start_offset(&self) -> u64
pub fn tail_start_offset(&self) -> u64
Offset where the tail of the file begins, meaning every block after the data blocks.
Sourcepub fn user_defined_timestamps_persisted(&self) -> bool
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.
Sourcepub fn key_largest_seqno(&self) -> u64
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.
Sourcepub fn key_smallest_seqno(&self) -> u64
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.
Sourcepub fn has_key_largest_seqno(&self) -> bool
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.
Sourcepub fn has_key_smallest_seqno(&self) -> bool
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.
Sourcepub fn data_block_restart_interval(&self) -> u64
pub fn data_block_restart_interval(&self) -> u64
Restart interval used for data blocks when the file was written, 0 when unknown.
Sourcepub fn index_block_restart_interval(&self) -> u64
pub fn index_block_restart_interval(&self) -> u64
Restart interval used for index blocks when the file was written, 0 when unknown.
Sourcepub fn separate_key_value_in_data_block(&self) -> bool
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.
Sourcepub fn db_id(&self) -> &'a [u8] ⓘ
pub fn db_id(&self) -> &'a [u8] ⓘ
DB identity, generated the first time the DB was created. Empty when unset.
Sourcepub fn db_session_id(&self) -> &'a [u8] ⓘ
pub fn db_session_id(&self) -> &'a [u8] ⓘ
DB session identity, regenerated every time the DB is opened. Empty when unset.
Sourcepub fn db_host_id(&self) -> &'a [u8] ⓘ
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.
Sourcepub fn column_family_name(&self) -> &'a [u8] ⓘ
pub fn column_family_name(&self) -> &'a [u8] ⓘ
Name of the column family this file belongs to. Empty when the column family is unknown.
Sourcepub fn filter_policy_name(&self) -> &'a [u8] ⓘ
pub fn filter_policy_name(&self) -> &'a [u8] ⓘ
Name of the filter policy used for this file. Empty when no filter policy was used.
Sourcepub fn comparator_name(&self) -> &'a [u8] ⓘ
pub fn comparator_name(&self) -> &'a [u8] ⓘ
Name of the comparator used for this file.
Sourcepub fn merge_operator_name(&self) -> &'a [u8] ⓘ
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.
Sourcepub fn prefix_extractor_name(&self) -> &'a [u8] ⓘ
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.
Sourcepub fn property_collectors_names(&self) -> &'a [u8] ⓘ
pub fn property_collectors_names(&self) -> &'a [u8] ⓘ
Comma separated names of the property collector factories used for this file.
Sourcepub fn compression_name(&self) -> &'a [u8] ⓘ
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>.
Sourcepub fn compression_options(&self) -> &'a [u8] ⓘ
pub fn compression_options(&self) -> &'a [u8] ⓘ
Compression options used to compress this file.
Sourcepub fn seqno_to_time_mapping(&self) -> &'a [u8] ⓘ
pub fn seqno_to_time_mapping(&self) -> &'a [u8] ⓘ
Delta encoded sequence number to time mapping.
Sourcepub fn user_collected_properties_count(&self) -> usize
pub fn user_collected_properties_count(&self) -> usize
Number of user collected properties recorded for this file.
Sourcepub fn user_collected_property_at(
&self,
pos: usize,
) -> Option<(&'a [u8], &'a [u8])>
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.
Sourcepub fn user_collected_properties(
&self,
) -> impl Iterator<Item = (&'a [u8], &'a [u8])> + '_
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.
Sourcepub fn readable_properties_count(&self) -> usize
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.
Sourcepub fn readable_property_at(&self, pos: usize) -> Option<(&'a [u8], &'a [u8])>
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.
Sourcepub fn readable_properties(
&self,
) -> impl Iterator<Item = (&'a [u8], &'a [u8])> + '_
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.