pub struct CompactionFile {
pub id: u64,
pub level: u32,
pub size: u64,
pub smallest_key: Vec<u8>,
pub largest_key: Vec<u8>,
pub num_entries: u64,
pub num_deletions: u64,
pub num_old_versions: u64,
pub oldest_timestamp: Timestamp,
pub newest_timestamp: Timestamp,
pub created_at: Instant,
}Expand description
File metadata for compaction decisions
Fields§
§id: u64File ID
level: u32Level (0 = memtable flush, 1+ = compacted levels)
size: u64File size in bytes
smallest_key: Vec<u8>Smallest key
largest_key: Vec<u8>Largest key
num_entries: u64Number of entries
num_deletions: u64Number of deletions (tombstones)
num_old_versions: u64Number of old versions (non-latest)
oldest_timestamp: TimestampOldest entry timestamp
newest_timestamp: TimestampNewest entry timestamp
created_at: InstantCreation time
Implementations§
Source§impl CompactionFile
impl CompactionFile
Sourcepub fn tombstone_density(&self) -> f64
pub fn tombstone_density(&self) -> f64
Calculate tombstone density
Sourcepub fn version_density(&self) -> f64
pub fn version_density(&self) -> f64
Calculate version density (ratio of old versions)
Sourcepub fn garbage_ratio(&self) -> f64
pub fn garbage_ratio(&self) -> f64
Calculate garbage ratio (tombstones + old versions)
Trait Implementations§
Source§impl Clone for CompactionFile
impl Clone for CompactionFile
Source§fn clone(&self) -> CompactionFile
fn clone(&self) -> CompactionFile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompactionFile
impl RefUnwindSafe for CompactionFile
impl Send for CompactionFile
impl Sync for CompactionFile
impl Unpin for CompactionFile
impl UnsafeUnpin for CompactionFile
impl UnwindSafe for CompactionFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more