pub struct IndexedMap<'a, S>{ /* private fields */ }Expand description
Strict coordinator for one source map and its active secondary indexes.
Implementations§
Source§impl<S> IndexedMap<'_, S>
impl<S> IndexedMap<'_, S>
Sourcepub fn export_current(&self) -> Result<IndexedSnapshotBundle, Error>
pub fn export_current(&self) -> Result<IndexedSnapshotBundle, Error>
Export the exact catalog-selected current source and all active index trees.
Sourcepub fn import_current(
&self,
bundle: &IndexedSnapshotBundle,
expected_source: Option<&MapVersionId>,
) -> Result<IndexedVersion, Error>
pub fn import_current( &self, bundle: &IndexedSnapshotBundle, expected_source: Option<&MapVersionId>, ) -> Result<IndexedVersion, Error>
Verify and atomically install a current indexed snapshot for this exact source ID.
expected_source == None means the destination source must be absent.
Source§impl<'a, S> IndexedMap<'a, S>
impl<'a, S> IndexedMap<'a, S>
Sourcepub fn registry(&self) -> &SecondaryIndexRegistry
pub fn registry(&self) -> &SecondaryIndexRegistry
Borrow runtime definitions supplied when this handle was opened.
Sourcepub fn source(&self) -> VersionedMap<'_, S>
pub fn source(&self) -> VersionedMap<'_, S>
Open the underlying source as a read-only raw map handle.
Sourcepub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>
pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>
Read one source key from the current durable head.
Sourcepub fn health(&self) -> Result<IndexedMapHealth, Error>
pub fn health(&self) -> Result<IndexedMapHealth, Error>
Re-run bounded structural startup validation and return exact health state.
Sourcepub fn metrics(&self) -> IndexedMapMetricsSnapshot
pub fn metrics(&self) -> IndexedMapMetricsSnapshot
Snapshot cumulative logical work counters for this handle.
Source§impl<S> IndexedMap<'_, S>
impl<S> IndexedMap<'_, S>
Sourcepub fn ensure_index(
&self,
name: impl AsRef<[u8]>,
) -> Result<IndexBuildResult, Error>
pub fn ensure_index( &self, name: impl AsRef<[u8]>, ) -> Result<IndexBuildResult, Error>
Build a runtime definition against a pinned source snapshot and atomically activate it.
Sourcepub fn verify_index(
&self,
name: impl AsRef<[u8]>,
source_version: &MapVersionId,
) -> Result<IndexVerification, Error>
pub fn verify_index( &self, name: impl AsRef<[u8]>, source_version: &MapVersionId, ) -> Result<IndexVerification, Error>
Rebuild and compare one exact retained source/index checkpoint without publishing roots.
Sourcepub fn verify_all(
&self,
source_version: &MapVersionId,
) -> Result<Vec<IndexVerification>, Error>
pub fn verify_all( &self, source_version: &MapVersionId, ) -> Result<Vec<IndexVerification>, Error>
Verify every generation currently selected by the catalog at one source version.
Sourcepub fn repair_index(
&self,
name: impl AsRef<[u8]>,
source_version: &MapVersionId,
) -> Result<IndexVerification, Error>
pub fn repair_index( &self, name: impl AsRef<[u8]>, source_version: &MapVersionId, ) -> Result<IndexVerification, Error>
Rebuild and atomically correct one selected checkpoint when semantic drift exists.
Sourcepub fn replace_index(
&self,
name: impl AsRef<[u8]>,
new_definition: SecondaryIndex,
) -> Result<IndexBuildResult, Error>
pub fn replace_index( &self, name: impl AsRef<[u8]>, new_definition: SecondaryIndex, ) -> Result<IndexBuildResult, Error>
Shadow-build and atomically replace one active definition generation.
Sourcepub fn deactivate_index(
&self,
name: impl AsRef<[u8]>,
) -> Result<IndexedVersion, Error>
pub fn deactivate_index( &self, name: impl AsRef<[u8]>, ) -> Result<IndexedVersion, Error>
Remove one active selection while retaining its descriptors, checkpoints, and roots.
Sourcepub fn apply(&self, mutations: Vec<Mutation>) -> Result<IndexedVersion, Error>
pub fn apply(&self, mutations: Vec<Mutation>) -> Result<IndexedVersion, Error>
Apply source mutations while maintaining every active index atomically.
Sourcepub fn apply_if(
&self,
expected: Option<&MapVersionId>,
mutations: Vec<Mutation>,
) -> Result<IndexedMapUpdate, Error>
pub fn apply_if( &self, expected: Option<&MapVersionId>, mutations: Vec<Mutation>, ) -> Result<IndexedMapUpdate, Error>
Conditionally apply source mutations when the expected source version is current.
Sourcepub fn put(
&self,
key: impl Into<Vec<u8>>,
value: impl Into<Vec<u8>>,
) -> Result<IndexedVersion, Error>
pub fn put( &self, key: impl Into<Vec<u8>>, value: impl Into<Vec<u8>>, ) -> Result<IndexedVersion, Error>
Insert or replace one source record and maintain all active indexes.
Sourcepub fn delete(&self, key: impl Into<Vec<u8>>) -> Result<IndexedVersion, Error>
pub fn delete(&self, key: impl Into<Vec<u8>>) -> Result<IndexedVersion, Error>
Delete one source record and maintain all active indexes.
Sourcepub fn edit(
&self,
edit: impl FnOnce(&mut IndexedMapEditor),
) -> Result<IndexedVersion, Error>
pub fn edit( &self, edit: impl FnOnce(&mut IndexedMapEditor), ) -> Result<IndexedVersion, Error>
Collect several source edits and publish one coordinated version.
Source§impl<S> IndexedMap<'_, S>
impl<S> IndexedMap<'_, S>
Sourcepub fn keep_last(&self, count: usize) -> Result<IndexedRetentionResult, Error>
pub fn keep_last(&self, count: usize) -> Result<IndexedRetentionResult, Error>
Retain the newest source versions and their complete transitive index closure.
count == 0 still retains the current source. This removes named roots
and catalog checkpoint records only; content-addressed nodes require a
separate store-global GC plan/sweep.
Source§impl<S> IndexedMap<'_, S>
impl<S> IndexedMap<'_, S>
Sourcepub fn plan_indexed_gc(&self) -> Result<GcPlan, Error>
pub fn plan_indexed_gc(&self) -> Result<GcPlan, Error>
Plan node GC from every remaining named root in the shared store.
Source§impl<'a, S> IndexedMap<'a, S>
impl<'a, S> IndexedMap<'a, S>
Sourcepub fn snapshot(&self) -> Result<IndexedSnapshot<'a, S>, Error>
pub fn snapshot(&self) -> Result<IndexedSnapshot<'a, S>, Error>
Pin the current catalog first, then reopen every selected immutable root.
Sourcepub fn snapshot_at(
&self,
source_version: &MapVersionId,
) -> Result<IndexedSnapshot<'a, S>, Error>
pub fn snapshot_at( &self, source_version: &MapVersionId, ) -> Result<IndexedSnapshot<'a, S>, Error>
Reopen exact checkpoints for a retained source using current generations.
Sourcepub fn snapshot_by_id(
&self,
id: &IndexedSnapshotId,
) -> Result<IndexedSnapshot<'a, S>, Error>
pub fn snapshot_by_id( &self, id: &IndexedSnapshotId, ) -> Result<IndexedSnapshot<'a, S>, Error>
Reopen the exact retained catalog/source pair represented by id.
Auto Trait Implementations§
impl<'a, S> !Freeze for IndexedMap<'a, S>
impl<'a, S> !RefUnwindSafe for IndexedMap<'a, S>
impl<'a, S> !UnwindSafe for IndexedMap<'a, S>
impl<'a, S> Send for IndexedMap<'a, S>
impl<'a, S> Sync for IndexedMap<'a, S>
impl<'a, S> Unpin for IndexedMap<'a, S>
impl<'a, S> UnsafeUnpin for IndexedMap<'a, S>
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
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