pub struct CompactionManager { /* private fields */ }Expand description
Compaction manager for a stripe
Implementations§
Source§impl CompactionManager
impl CompactionManager
Sourcepub fn needs_compaction(&self, sst_count: usize) -> bool
pub fn needs_compaction(&self, sst_count: usize) -> bool
Check if compaction is needed for this stripe
Sourcepub fn compact(
&self,
ssts: &[SstReader],
next_sst_id: u64,
) -> Result<(SstReader, Vec<PathBuf>)>
pub fn compact( &self, ssts: &[SstReader], next_sst_id: u64, ) -> Result<(SstReader, Vec<PathBuf>)>
Compact multiple SST files into a single new SST
Algorithm:
- Read all records from all input SSTs
- Merge by key, keeping only the latest version (highest SeqNo)
- Filter out tombstones (deleted records)
- Write merged records to new SST
- Return new SST reader and paths of old SSTs to delete
Auto Trait Implementations§
impl Freeze for CompactionManager
impl RefUnwindSafe for CompactionManager
impl Send for CompactionManager
impl Sync for CompactionManager
impl Unpin for CompactionManager
impl UnwindSafe for CompactionManager
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