pub struct BackgroundWorker { /* private fields */ }Expand description
Background worker for running compaction tasks
Implementations§
Source§impl BackgroundWorker
impl BackgroundWorker
Sourcepub fn new(config: CompactionConfig, stats: CompactionStatsAtomic) -> Self
pub fn new(config: CompactionConfig, stats: CompactionStatsAtomic) -> Self
Create a new background worker
Sourcepub fn start(&mut self)
pub fn start(&mut self)
Start the background worker thread
The worker will periodically check the work queue and process compaction requests.
Sourcepub fn queue_compaction(&self, stripe_id: usize)
pub fn queue_compaction(&self, stripe_id: usize)
Queue a compaction request for a stripe
Sourcepub fn queue_size(&self) -> usize
pub fn queue_size(&self) -> usize
Get the current work queue size
Sourcepub fn shutdown(&mut self)
pub fn shutdown(&mut self)
Initiate graceful shutdown
Signals the worker thread to stop and waits for it to finish.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the worker is running
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BackgroundWorker
impl !RefUnwindSafe for BackgroundWorker
impl Send for BackgroundWorker
impl Sync for BackgroundWorker
impl Unpin for BackgroundWorker
impl !UnwindSafe for BackgroundWorker
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