pub struct LeveledCompaction { /* private fields */ }Expand description
Leveled compaction planner + reference compaction routine.
Implementations§
Source§impl LeveledCompaction
impl LeveledCompaction
Sourcepub fn new(config: LeveledCompactionConfig) -> Result<Self>
pub fn new(config: LeveledCompactionConfig) -> Result<Self>
Create a new compaction planner.
Sourcepub fn pick_plan(&self, levels: &[Vec<SSTableMeta>]) -> Option<CompactionPlan>
pub fn pick_plan(&self, levels: &[Vec<SSTableMeta>]) -> Option<CompactionPlan>
Pick a compaction plan from per-level SSTable metadata.
The planner chooses:
- L0 → L1 when
L0.len() >= l0_compaction_trigger. - Otherwise, the first level
nwheresize(Ln) > target_file_size * multiplier^n.
Sourcepub fn compact_entries(
&self,
sources: Vec<Box<dyn Iterator<Item = SSTableEntry>>>,
output_level: usize,
) -> Result<Vec<Vec<SSTableEntry>>>
pub fn compact_entries( &self, sources: Vec<Box<dyn Iterator<Item = SSTableEntry>>>, output_level: usize, ) -> Result<Vec<Vec<SSTableEntry>>>
Compact multiple sorted entry streams and return output runs split by target_file_size.
If output_level is the last level (max_levels-1), tombstones and older versions for that
key are removed completely (spec §3.4.3).
Trait Implementations§
Source§impl Clone for LeveledCompaction
impl Clone for LeveledCompaction
Source§fn clone(&self) -> LeveledCompaction
fn clone(&self) -> LeveledCompaction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LeveledCompaction
impl RefUnwindSafe for LeveledCompaction
impl Send for LeveledCompaction
impl Sync for LeveledCompaction
impl Unpin for LeveledCompaction
impl UnsafeUnpin for LeveledCompaction
impl UnwindSafe for LeveledCompaction
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