pub struct SegmentTracker { /* private fields */ }Expand description
Tracks segment references and pending deletions
Implementations§
Source§impl SegmentTracker
impl SegmentTracker
Sourcepub fn register(&self, segment_id: &str)
pub fn register(&self, segment_id: &str)
Register a new segment (called when segment is committed)
Sourcepub fn acquire(&self, segment_ids: &[String]) -> Vec<String>
pub fn acquire(&self, segment_ids: &[String]) -> Vec<String>
Acquire references to a set of segments (called when taking a snapshot) Returns the segment IDs that were successfully acquired
Sourcepub fn release(&self, segment_ids: &[String]) -> Vec<SegmentId>
pub fn release(&self, segment_ids: &[String]) -> Vec<SegmentId>
Release references to a set of segments (called when snapshot is dropped) Returns segment IDs that are now ready for deletion (ref count hit 0 and marked for deletion)
Sourcepub fn mark_for_deletion(&self, segment_ids: &[String]) -> Vec<SegmentId>
pub fn mark_for_deletion(&self, segment_ids: &[String]) -> Vec<SegmentId>
Mark segments for deletion (called after merge completes) Segments with ref count 0 are returned immediately for deletion Segments with refs > 0 are queued for deletion when refs are released
Sourcepub fn get_active_segments(&self) -> Vec<String>
pub fn get_active_segments(&self) -> Vec<String>
Get current segment IDs (excluding those pending deletion)
Sourcepub fn ref_count(&self, segment_id: &str) -> usize
pub fn ref_count(&self, segment_id: &str) -> usize
Get the number of active references for a segment
Sourcepub fn is_pending_deletion(&self, segment_id: &str) -> bool
pub fn is_pending_deletion(&self, segment_id: &str) -> bool
Check if a segment is pending deletion
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SegmentTracker
impl !RefUnwindSafe for SegmentTracker
impl Send for SegmentTracker
impl Sync for SegmentTracker
impl Unpin for SegmentTracker
impl UnwindSafe for SegmentTracker
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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.