pub struct SnapshotPinRegistry { /* private fields */ }Expand description
Registry of filesystem snapshot paths that must be excluded from GC.
When the HNSW index or the knowledge-base is flushed to disk the resulting
file path should be registered here so the OrphanGarbageCollector (and
any future full GC pass) can honour the exclusion without needing to
understand the internal format of those files.
The registry holds std::path::PathBufs rather than CIDs because
snapshot files are not (yet) tracked as content-addressed blocks in the
primary block store.
Implementations§
Source§impl SnapshotPinRegistry
impl SnapshotPinRegistry
Sourcepub fn pin_snapshot(&mut self, path: PathBuf)
pub fn pin_snapshot(&mut self, path: PathBuf)
Mark path as pinned so it is not eligible for GC removal.
Sourcepub fn unpin_snapshot(&mut self, path: &Path)
pub fn unpin_snapshot(&mut self, path: &Path)
Remove path from the pin registry, making it eligible for GC.
No-ops silently if path is not currently pinned.
Sourcepub fn is_pinned(&self, path: &Path) -> bool
pub fn is_pinned(&self, path: &Path) -> bool
Return true if path is currently registered as pinned.
Sourcepub fn pinned_count(&self) -> usize
pub fn pinned_count(&self) -> usize
Number of paths currently pinned in this registry.
Sourcepub fn pinned_paths(&self) -> impl Iterator<Item = &PathBuf>
pub fn pinned_paths(&self) -> impl Iterator<Item = &PathBuf>
Iterate over all pinned paths in arbitrary order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SnapshotPinRegistry
impl RefUnwindSafe for SnapshotPinRegistry
impl Send for SnapshotPinRegistry
impl Sync for SnapshotPinRegistry
impl Unpin for SnapshotPinRegistry
impl UnsafeUnpin for SnapshotPinRegistry
impl UnwindSafe for SnapshotPinRegistry
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
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 more