pub struct CompactionWorker { /* private fields */ }Expand description
Compaction worker
Implementations§
Source§impl CompactionWorker
impl CompactionWorker
Sourcepub fn new(dir: impl AsRef<Path>, config: CompactionConfig) -> Self
pub fn new(dir: impl AsRef<Path>, config: CompactionConfig) -> Self
Create a new compaction worker
Sourcepub fn stop_flag(&self) -> Arc<AtomicBool>
pub fn stop_flag(&self) -> Arc<AtomicBool>
Get the stop flag for external control
Sourcepub fn needs_compaction(&self, manifest: &Manifest) -> bool
pub fn needs_compaction(&self, manifest: &Manifest) -> bool
Check if compaction is needed for level 0
Sourcepub fn pick_compaction_level(&self, manifest: &Manifest) -> Option<u32>
pub fn pick_compaction_level(&self, manifest: &Manifest) -> Option<u32>
Check which level needs compaction
Sourcepub fn compact_level0(&mut self, manifest: &mut Manifest) -> Result<()>
pub fn compact_level0(&mut self, manifest: &mut Manifest) -> Result<()>
Compact level 0 to level 1
Sourcepub fn stats(&self) -> &CompactionStats
pub fn stats(&self) -> &CompactionStats
Get compaction statistics
Auto Trait Implementations§
impl !Freeze for CompactionWorker
impl RefUnwindSafe for CompactionWorker
impl Send for CompactionWorker
impl Sync for CompactionWorker
impl Unpin for CompactionWorker
impl UnwindSafe for CompactionWorker
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