pub struct CompactionState {
pub files_by_level: Vec<Vec<CompactionFile>>,
pub size_by_level: Vec<u64>,
pub current_time: Timestamp,
pub oldest_snapshot: Timestamp,
}Expand description
State of the LSM tree for compaction decisions
Fields§
§files_by_level: Vec<Vec<CompactionFile>>Files by level
size_by_level: Vec<u64>Total size by level
current_time: TimestampCurrent timestamp for age calculations
oldest_snapshot: TimestampOldest readable snapshot
Implementations§
Source§impl CompactionState
impl CompactionState
Sourcepub fn l0_file_count(&self) -> usize
pub fn l0_file_count(&self) -> usize
Get total number of L0 files
Sourcepub fn level_count(&self) -> usize
pub fn level_count(&self) -> usize
Get level count
Sourcepub fn find_overlapping(
&self,
level: usize,
smallest: &[u8],
largest: &[u8],
) -> Vec<&CompactionFile>
pub fn find_overlapping( &self, level: usize, smallest: &[u8], largest: &[u8], ) -> Vec<&CompactionFile>
Find overlapping files in a level
Trait Implementations§
Source§impl Debug for CompactionState
impl Debug for CompactionState
Source§impl Default for CompactionState
impl Default for CompactionState
Source§fn default() -> CompactionState
fn default() -> CompactionState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CompactionState
impl RefUnwindSafe for CompactionState
impl Send for CompactionState
impl Sync for CompactionState
impl Unpin for CompactionState
impl UnsafeUnpin for CompactionState
impl UnwindSafe for CompactionState
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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