Skip to main content

AsyncIndexedMap

Struct AsyncIndexedMap 

Source
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>

Source

pub fn id(&self) -> &[u8]

Application identifier for this indexed collection.

Source

pub fn registry(&self) -> &SecondaryIndexRegistry

Runtime extractor registry used to interpret persisted descriptors.

Source

pub fn source(&self) -> AsyncIndexedSourceView<'_, 'a, S>

Open an async view over the canonical source tree.

Source

pub async fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>

Read one source value from the current canonical snapshot.

Source

pub async fn health(&self) -> Result<IndexedMapHealth, Error>

Inspect the current canonical source/index closure.

Source

pub fn metrics(&self) -> IndexedMapMetricsSnapshot

Snapshot coordinator work counters.

Source

pub async fn ensure_index( &self, name: impl AsRef<[u8]>, ) -> Result<IndexBuildResult, Error>

Ensure one registered index exists for the current source snapshot.

Source

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.

Source

pub async fn apply( &self, mutations: Vec<Mutation>, ) -> Result<IndexedVersion, Error>

Atomically apply source mutations and all active secondary-index deltas.

Source

pub async fn apply_with_budget( &self, mutations: Vec<Mutation>, budget: &MutationBudget, ) -> Result<IndexedVersion, Error>

Apply source mutations under an explicit finite budget.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn prepare_remove_snapshot_ids( &self, remove: &BTreeSet<IndexedSnapshotId>, ) -> Result<AsyncPreparedIndexedUpdate, Error>

Prepare removal of exact indexed snapshot identities.

Source

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.

Source

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).

Source

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.

Source

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.

Source

pub async fn delete( &self, key: impl Into<Vec<u8>>, ) -> Result<IndexedVersion, Error>

Delete one source value and update every active index atomically.

Source

pub async fn edit( &self, edit: impl FnOnce(&mut IndexedMapEditor), ) -> Result<IndexedVersion, Error>

Collect and atomically apply several source edits.

Source

pub async fn verify_index( &self, name: impl AsRef<[u8]>, source_version: &MapVersionId, ) -> Result<IndexVerification, Error>

Verify one retained index against a canonical rebuild.

Source

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.

Source

pub async fn verify_all( &self, source_version: &MapVersionId, ) -> Result<Vec<IndexVerification>, Error>

Verify every index selected by one retained source version.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn deactivate_index( &self, name: impl AsRef<[u8]>, ) -> Result<IndexedVersion, Error>

Deactivate one index without changing the source snapshot.

Source

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

pub async fn release_snapshot_pin( &self, pin_id: impl AsRef<[u8]>, ) -> Result<(), Error>

Release one durable async retention pin.

Source

pub async fn keep_last( &self, count: usize, ) -> Result<IndexedRetentionResult, Error>

Retain the newest snapshots plus every durably pinned snapshot.

Source§

impl<'a, S> AsyncIndexedMap<'a, S>

Source

pub async fn snapshot(&self) -> Result<AsyncIndexedSnapshot<'a, S>, Error>

Pin the current canonical collection state and every tree it names.

Source

pub async fn snapshot_at( &self, source_version: &MapVersionId, ) -> Result<AsyncIndexedSnapshot<'a, S>, Error>

Reopen the retained snapshot containing source_version.

Source

pub async fn snapshot_by_id( &self, id: &IndexedSnapshotId, ) -> Result<AsyncIndexedSnapshot<'a, S>, Error>

Reopen one exact retained content-addressed snapshot.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.