pub struct ShardCompactionState { /* private fields */ }Expand description
Per-shard compaction state.
Implementations§
Source§impl ShardCompactionState
impl ShardCompactionState
Sourcepub fn current_version(&self) -> Version
pub fn current_version(&self) -> Version
Get current version.
Sourcepub fn is_compacting(&self) -> bool
pub fn is_compacting(&self) -> bool
Check if compaction is in progress.
Sourcepub fn try_start_compaction(&self) -> bool
pub fn try_start_compaction(&self) -> bool
Try to start compaction (returns false if already compacting).
Sourcepub fn finish_compaction(&self, bytes_reclaimed: u64, duration: Duration)
pub fn finish_compaction(&self, bytes_reclaimed: u64, duration: Duration)
Finish compaction and bump version.
Sourcepub fn queue_task(&self, task: CompactionTask)
pub fn queue_task(&self, task: CompactionTask)
Queue a compaction task.
Sourcepub fn pop_task(&self) -> Option<CompactionTask>
pub fn pop_task(&self) -> Option<CompactionTask>
Pop highest priority task.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get pending task count.
Sourcepub fn register_reader(&self) -> ReaderGuard
pub fn register_reader(&self) -> ReaderGuard
Register a reader on current version.
Sourcepub fn has_old_readers(&self) -> bool
pub fn has_old_readers(&self) -> bool
Check if any readers on old versions.
Sourcepub fn time_since_compaction(&self) -> Option<Duration>
pub fn time_since_compaction(&self) -> Option<Duration>
Get time since last compaction.
Sourcepub fn stats(&self) -> &CompactionStats
pub fn stats(&self) -> &CompactionStats
Get statistics.
Auto Trait Implementations§
impl !Freeze for ShardCompactionState
impl RefUnwindSafe for ShardCompactionState
impl Send for ShardCompactionState
impl Sync for ShardCompactionState
impl Unpin for ShardCompactionState
impl UnsafeUnpin for ShardCompactionState
impl UnwindSafe for ShardCompactionState
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