pub struct AsyncIndexedMap<'a, S: AsyncIndexedStore> { /* private fields */ }Expand description
Native asynchronous coordinator for one canonical source map and its indexes.
The coordinator uses AsyncStore for all node I/O and
AsyncTransactionalStore for the sole visibility transition. It never
routes remote work through the synchronous IndexedMap facade.
Implementations§
Source§impl<'a, S> AsyncIndexedMap<'a, S>where
S: AsyncIndexedStore + Clone,
<S as AsyncStore>::Error: Send + Sync,
<S as AsyncManifestStore>::Error: Send + Sync,
impl<'a, S> AsyncIndexedMap<'a, S>where
S: AsyncIndexedStore + Clone,
<S as AsyncStore>::Error: Send + Sync,
<S as AsyncManifestStore>::Error: Send + Sync,
Sourcepub fn registry(&self) -> &SecondaryIndexRegistry
pub fn registry(&self) -> &SecondaryIndexRegistry
Runtime extractor registry used to interpret persisted descriptors.
Sourcepub fn source(&self) -> AsyncIndexedSourceView<'_, 'a, S>
pub fn source(&self) -> AsyncIndexedSourceView<'_, 'a, S>
Open an async view over the canonical source tree.
Sourcepub async fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>
pub async fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>
Read one source value from the current canonical snapshot.
Sourcepub async fn health(&self) -> Result<IndexedMapHealth, Error>
pub async fn health(&self) -> Result<IndexedMapHealth, Error>
Inspect the current canonical source/index closure.
Sourcepub fn metrics(&self) -> IndexedMapMetricsSnapshot
pub fn metrics(&self) -> IndexedMapMetricsSnapshot
Snapshot coordinator work counters.
Sourcepub async fn ensure_index(
&self,
name: impl AsRef<[u8]>,
) -> Result<IndexBuildResult, Error>
pub async fn ensure_index( &self, name: impl AsRef<[u8]>, ) -> Result<IndexBuildResult, Error>
Ensure one registered index exists for the current source snapshot.
Sourcepub async fn ensure_index_with_budget(
&self,
name: impl AsRef<[u8]>,
budget: &MaintenanceBudget,
) -> Result<IndexBuildResult, Error>
pub async fn ensure_index_with_budget( &self, name: impl AsRef<[u8]>, budget: &MaintenanceBudget, ) -> Result<IndexBuildResult, Error>
Ensure one registered index under an explicit maintenance budget.
Sourcepub async fn apply(
&self,
mutations: Vec<Mutation>,
) -> Result<IndexedVersion, Error>
pub async fn apply( &self, mutations: Vec<Mutation>, ) -> Result<IndexedVersion, Error>
Atomically apply source mutations and all active secondary-index deltas.
Sourcepub async fn apply_with_budget(
&self,
mutations: Vec<Mutation>,
budget: &MutationBudget,
) -> Result<IndexedVersion, Error>
pub async fn apply_with_budget( &self, mutations: Vec<Mutation>, budget: &MutationBudget, ) -> Result<IndexedVersion, Error>
Apply source mutations under an explicit finite budget.
Sourcepub async fn prepare_apply_with_budget(
&self,
expected: Option<&MapVersionId>,
mutations: Vec<Mutation>,
budget: &MutationBudget,
) -> Result<AsyncPreparedIndexedUpdate, Error>
pub async fn prepare_apply_with_budget( &self, expected: Option<&MapVersionId>, mutations: Vec<Mutation>, budget: &MutationBudget, ) -> Result<AsyncPreparedIndexedUpdate, Error>
Prepare source and synchronous-index changes for composition into a caller-owned strict root transaction. This method never changes a named root and performs only bounded, verified immutable publication.
Sourcepub async fn prepare_apply_at_snapshot_with_budget(
&self,
expected: &IndexedSnapshotId,
mutations: Vec<Mutation>,
budget: &MutationBudget,
) -> Result<AsyncPreparedIndexedUpdate, Error>
pub async fn prepare_apply_at_snapshot_with_budget( &self, expected: &IndexedSnapshotId, mutations: Vec<Mutation>, budget: &MutationBudget, ) -> Result<AsyncPreparedIndexedUpdate, Error>
Prepare an indexed mutation only when the exact coordinator snapshot is still current. This distinguishes ABA states that share source content but activate different index generations.
Sourcepub async fn prepare_restore(
&self,
expected: &MapVersionId,
target: &MapVersionId,
) -> Result<AsyncPreparedIndexedUpdate, Error>
pub async fn prepare_restore( &self, expected: &MapVersionId, target: &MapVersionId, ) -> Result<AsyncPreparedIndexedUpdate, Error>
Prepare an exact retained-snapshot restore for composition into a caller-owned strict root transaction. The indexed collection remains invisible at the candidate head until the caller commits the returned conditional root replacement.
Sourcepub async fn prepare_restore_snapshot(
&self,
expected: &IndexedSnapshotId,
target: &IndexedSnapshotId,
) -> Result<AsyncPreparedIndexedUpdate, Error>
pub async fn prepare_restore_snapshot( &self, expected: &IndexedSnapshotId, target: &IndexedSnapshotId, ) -> Result<AsyncPreparedIndexedUpdate, Error>
Prepare a restore by exact indexed snapshot identity. This is the safe form when multiple index generations intentionally bind identical source content.
Sourcepub async fn prepare_restore_manifest(
&self,
expected: &IndexedSnapshotId,
manifest: &IndexedSnapshotManifest,
) -> Result<AsyncPreparedIndexedUpdate, Error>
pub async fn prepare_restore_manifest( &self, expected: &IndexedSnapshotId, manifest: &IndexedSnapshotManifest, ) -> Result<AsyncPreparedIndexedUpdate, Error>
Prepare activation of a self-contained historical manifest when the mutable coordinator deliberately retains only its active snapshot.
Sourcepub async fn prepare_remove_snapshots(
&self,
remove: &BTreeSet<MapVersionId>,
) -> Result<AsyncPreparedIndexedUpdate, Error>
pub async fn prepare_remove_snapshots( &self, remove: &BTreeSet<MapVersionId>, ) -> Result<AsyncPreparedIndexedUpdate, Error>
Prepare removal of an exact set of retained source snapshots for composition with an external audited retention transaction.
Sourcepub async fn prepare_remove_snapshot_ids(
&self,
remove: &BTreeSet<IndexedSnapshotId>,
) -> Result<AsyncPreparedIndexedUpdate, Error>
pub async fn prepare_remove_snapshot_ids( &self, remove: &BTreeSet<IndexedSnapshotId>, ) -> Result<AsyncPreparedIndexedUpdate, Error>
Prepare removal of exact indexed snapshot identities.
Sourcepub async fn prepare_rebuild_from_source(
&self,
expected: &MapVersionId,
source: Tree,
registry: SecondaryIndexRegistry,
budget: &MaintenanceBudget,
) -> Result<AsyncPreparedIndexedUpdate, Error>
pub async fn prepare_rebuild_from_source( &self, expected: &MapVersionId, source: Tree, registry: SecondaryIndexRegistry, budget: &MaintenanceBudget, ) -> Result<AsyncPreparedIndexedUpdate, Error>
Build a complete replacement source/index closure without changing visibility. Existing snapshots and descriptors remain retained for historical reads; the returned candidate activates the supplied registry only if the caller commits its state-root CAS.
Sourcepub async fn prepare_rebuild_from_source_at(
&self,
expected: &IndexedSnapshotId,
source: Tree,
registry: SecondaryIndexRegistry,
budget: &MaintenanceBudget,
) -> Result<AsyncPreparedIndexedUpdate, Error>
pub async fn prepare_rebuild_from_source_at( &self, expected: &IndexedSnapshotId, source: Tree, registry: SecondaryIndexRegistry, budget: &MaintenanceBudget, ) -> Result<AsyncPreparedIndexedUpdate, Error>
Build a replacement closure against one exact indexed head. Exact identity avoids ABA when index generations change over identical source content (including an empty table).
Sourcepub async fn apply_if(
&self,
expected: Option<&MapVersionId>,
mutations: Vec<Mutation>,
) -> Result<IndexedMapUpdate, Error>
pub async fn apply_if( &self, expected: Option<&MapVersionId>, mutations: Vec<Mutation>, ) -> Result<IndexedMapUpdate, Error>
Apply a batch only if expected is still the canonical source version.
Sourcepub async fn put(
&self,
key: impl Into<Vec<u8>>,
value: impl Into<Vec<u8>>,
) -> Result<IndexedVersion, Error>
pub async fn put( &self, key: impl Into<Vec<u8>>, value: impl Into<Vec<u8>>, ) -> Result<IndexedVersion, Error>
Put one source value and update every active index atomically.
Sourcepub async fn delete(
&self,
key: impl Into<Vec<u8>>,
) -> Result<IndexedVersion, Error>
pub async fn delete( &self, key: impl Into<Vec<u8>>, ) -> Result<IndexedVersion, Error>
Delete one source value and update every active index atomically.
Sourcepub async fn edit(
&self,
edit: impl FnOnce(&mut IndexedMapEditor),
) -> Result<IndexedVersion, Error>
pub async fn edit( &self, edit: impl FnOnce(&mut IndexedMapEditor), ) -> Result<IndexedVersion, Error>
Collect and atomically apply several source edits.
Sourcepub async fn verify_index(
&self,
name: impl AsRef<[u8]>,
source_version: &MapVersionId,
) -> Result<IndexVerification, Error>
pub async fn verify_index( &self, name: impl AsRef<[u8]>, source_version: &MapVersionId, ) -> Result<IndexVerification, Error>
Verify one retained index against a canonical rebuild.
Sourcepub async fn verify_index_with_budget(
&self,
name: impl AsRef<[u8]>,
source_version: &MapVersionId,
budget: &MaintenanceBudget,
) -> Result<IndexVerification, Error>
pub async fn verify_index_with_budget( &self, name: impl AsRef<[u8]>, source_version: &MapVersionId, budget: &MaintenanceBudget, ) -> Result<IndexVerification, Error>
Verify one retained index under an explicit maintenance budget.
Sourcepub async fn verify_all(
&self,
source_version: &MapVersionId,
) -> Result<Vec<IndexVerification>, Error>
pub async fn verify_all( &self, source_version: &MapVersionId, ) -> Result<Vec<IndexVerification>, Error>
Verify every index selected by one retained source version.
Sourcepub async fn verify_all_with_budget(
&self,
source_version: &MapVersionId,
budget: &MaintenanceBudget,
) -> Result<Vec<IndexVerification>, Error>
pub async fn verify_all_with_budget( &self, source_version: &MapVersionId, budget: &MaintenanceBudget, ) -> Result<Vec<IndexVerification>, Error>
Verify every selected index under a partitioned maintenance budget.
Sourcepub async fn repair_index(
&self,
name: impl AsRef<[u8]>,
source_version: &MapVersionId,
) -> Result<IndexVerification, Error>
pub async fn repair_index( &self, name: impl AsRef<[u8]>, source_version: &MapVersionId, ) -> Result<IndexVerification, Error>
Rebuild and atomically repair one index at the current head.
Sourcepub async fn repair_index_with_budget(
&self,
name: impl AsRef<[u8]>,
source_version: &MapVersionId,
budget: &MaintenanceBudget,
) -> Result<IndexVerification, Error>
pub async fn repair_index_with_budget( &self, name: impl AsRef<[u8]>, source_version: &MapVersionId, budget: &MaintenanceBudget, ) -> Result<IndexVerification, Error>
Rebuild and repair one index under an explicit maintenance budget.
Sourcepub async fn replace_index(
&self,
name: impl AsRef<[u8]>,
new_definition: SecondaryIndex,
) -> Result<IndexBuildResult, Error>
pub async fn replace_index( &self, name: impl AsRef<[u8]>, new_definition: SecondaryIndex, ) -> Result<IndexBuildResult, Error>
Atomically replace an active index with a higher-generation definition.
Sourcepub async fn deactivate_index(
&self,
name: impl AsRef<[u8]>,
) -> Result<IndexedVersion, Error>
pub async fn deactivate_index( &self, name: impl AsRef<[u8]>, ) -> Result<IndexedVersion, Error>
Deactivate one index without changing the source snapshot.
Sourcepub async fn retain_snapshot_pin(
&self,
pin_id: impl AsRef<[u8]>,
source_version: &MapVersionId,
) -> Result<(), Error>
pub async fn retain_snapshot_pin( &self, pin_id: impl AsRef<[u8]>, source_version: &MapVersionId, ) -> Result<(), Error>
Persist a durable retention pin for one retained source version.
Source§impl<'a, S> AsyncIndexedMap<'a, S>where
S: AsyncIndexedStore + Clone,
<S as AsyncStore>::Error: Send + Sync,
<S as AsyncManifestStore>::Error: Send + Sync,
impl<'a, S> AsyncIndexedMap<'a, S>where
S: AsyncIndexedStore + Clone,
<S as AsyncStore>::Error: Send + Sync,
<S as AsyncManifestStore>::Error: Send + Sync,
Sourcepub async fn snapshot(&self) -> Result<AsyncIndexedSnapshot<'a, S>, Error>
pub async fn snapshot(&self) -> Result<AsyncIndexedSnapshot<'a, S>, Error>
Pin the current canonical collection state and every tree it names.
Sourcepub async fn snapshot_at(
&self,
source_version: &MapVersionId,
) -> Result<AsyncIndexedSnapshot<'a, S>, Error>
pub async fn snapshot_at( &self, source_version: &MapVersionId, ) -> Result<AsyncIndexedSnapshot<'a, S>, Error>
Reopen the retained snapshot containing source_version.
Sourcepub async fn snapshot_by_id(
&self,
id: &IndexedSnapshotId,
) -> Result<AsyncIndexedSnapshot<'a, S>, Error>
pub async fn snapshot_by_id( &self, id: &IndexedSnapshotId, ) -> Result<AsyncIndexedSnapshot<'a, S>, Error>
Reopen one exact retained content-addressed snapshot.
Sourcepub fn snapshot_from_manifest(
&self,
manifest_tree: Tree,
manifest: IndexedSnapshotManifest,
) -> Result<AsyncIndexedSnapshot<'a, S>, Error>
pub fn snapshot_from_manifest( &self, manifest_tree: Tree, manifest: IndexedSnapshotManifest, ) -> Result<AsyncIndexedSnapshot<'a, S>, Error>
Resolve an immutable snapshot from a self-contained historical manifest.
manifest_tree is the immutable tree that durably carried the manifest;
its content identity is bound into secondary-index cursor context. The
method performs no mutable-state lookup and rejects a manifest owned by
another indexed map.
Auto Trait Implementations§
impl<'a, S> !Freeze for AsyncIndexedMap<'a, S>
impl<'a, S> !RefUnwindSafe for AsyncIndexedMap<'a, S>
impl<'a, S> !UnwindSafe for AsyncIndexedMap<'a, S>
impl<'a, S> Send for AsyncIndexedMap<'a, S>where
&'a ProllyEngine<S>: Send,
impl<'a, S> Sync for AsyncIndexedMap<'a, S>where
&'a ProllyEngine<S>: Sync,
impl<'a, S> Unpin for AsyncIndexedMap<'a, S>where
&'a ProllyEngine<S>: Unpin,
impl<'a, S> UnsafeUnpin for AsyncIndexedMap<'a, S>where
&'a ProllyEngine<S>: UnsafeUnpin,
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