pub struct IncrementalTracker { /* private fields */ }Expand description
Tracks which HNSW entries have been modified since the last full snapshot
The caller is responsible for calling mark_dirty whenever a vector is
inserted, updated, or logically removed from the index. After writing a
full or incremental snapshot the caller should call mark_clean so the
dirty set is cleared and the version counter is advanced.
Implementations§
Source§impl IncrementalTracker
impl IncrementalTracker
Sourcepub fn mark_dirty(&mut self, id: u32)
pub fn mark_dirty(&mut self, id: u32)
Record that entry id has been inserted or modified
Sourcepub fn mark_clean(&mut self)
pub fn mark_clean(&mut self)
Clear the dirty set and advance the version counter
Should be called immediately after a snapshot (full or incremental) has been successfully written to stable storage.
Sourcepub fn record_full_snapshot(&mut self, time: SystemTime)
pub fn record_full_snapshot(&mut self, time: SystemTime)
Record that a full snapshot was taken at time
Sourcepub fn dirty_ids(&self) -> &HashSet<u32>
pub fn dirty_ids(&self) -> &HashSet<u32>
Return a reference to the current set of dirty entry IDs
Sourcepub fn is_dirty(&self) -> bool
pub fn is_dirty(&self) -> bool
Return true if any entries have been modified since the last snapshot
Sourcepub fn dirty_count(&self) -> usize
pub fn dirty_count(&self) -> usize
Number of entries that are currently dirty
Sourcepub fn last_full_snapshot(&self) -> Option<SystemTime>
pub fn last_full_snapshot(&self) -> Option<SystemTime>
Timestamp of the last full snapshot, if any
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IncrementalTracker
impl RefUnwindSafe for IncrementalTracker
impl Send for IncrementalTracker
impl Sync for IncrementalTracker
impl Unpin for IncrementalTracker
impl UnsafeUnpin for IncrementalTracker
impl UnwindSafe for IncrementalTracker
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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>
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>
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
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.