Skip to main content

KeyValueBatch

Trait KeyValueBatch 

Source
pub trait KeyValueBatch {
Show 35 methods // Required methods fn put(&mut self, key: &[u8], value: &[u8]) -> StorageBackendResult<()>; fn delete(&mut self, key: &[u8]) -> StorageBackendResult<()>; fn delete_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()>; fn commit(self: Box<Self>) -> StorageBackendResult<()>; // Provided methods fn serializable_participant(&self) -> Option<SerializableTransactionId> { ... } fn observe_serializable_write( &mut self, _predicate: SerializablePredicate<'_>, ) -> StorageBackendResult<()> { ... } fn require_unchanged(&mut self, _key: &[u8]) -> StorageBackendResult<()> { ... } fn require_observed( &mut self, _key: &[u8], _revision: &KeyValueReadRevision, ) -> StorageBackendResult<()> { ... } fn put_observed( &mut self, _key: &[u8], _value: &[u8], _revision: &KeyValueReadRevision, ) -> StorageBackendResult<()> { ... } fn put_with_retained_source( &mut self, _key: &[u8], _value: &[u8], _source: Arc<dyn KeyValueRead + Send + Sync>, ) -> StorageBackendResult<()> { ... } fn touch_marker( &mut self, _key: &[u8], _value: &[u8], ) -> StorageBackendResult<()> { ... } fn replace_diskann_origin( &mut self, _key: &[u8], _value: &[u8], ) -> StorageBackendResult<()> { ... } fn invalidate_diskann_origin( &mut self, key: &[u8], ) -> StorageBackendResult<()> { ... } fn publish_diskann_population( &mut self, _key: &[u8], _template: &[u8], _origins: DiskANNOriginReader, ) -> StorageBackendResult<()> { ... } fn retire_diskann_population( &mut self, _key: &[u8], ) -> StorageBackendResult<()> { ... } fn observe_identifier( &mut self, _namespace: &[u8], _value: u64, ) -> StorageBackendResult<()> { ... } fn inherit_identifiers( &mut self, _from: &[u8], _to: &[u8], ) -> StorageBackendResult<()> { ... } fn delete_prefix_allow_absent( &mut self, prefix: &[u8], ) -> StorageBackendResult<()> { ... } fn ivf_mutation( &mut self, _metadata: &[u8], _mutation: IVFMutation<'_>, ) -> StorageBackendResult<()> { ... } fn preview_ivf_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()> { ... } fn preview_ivf_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()> { ... } fn fence_ivf_prefix(&mut self, _prefix: &[u8]) -> StorageBackendResult<()> { ... } fn hnsw_mutation( &mut self, _metadata: &[u8], _mutation: HNSWMutation<'_>, ) -> StorageBackendResult<()> { ... } fn preview_hnsw_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()> { ... } fn preview_hnsw_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()> { ... } fn fence_hnsw_prefix(&mut self, _prefix: &[u8]) -> StorageBackendResult<()> { ... } fn replace_occurrence_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()> { ... } fn invalidate_occurrence_prefix( &mut self, prefix: &[u8], ) -> StorageBackendResult<()> { ... } fn occurrence_document( &mut self, _table: &str, _document: DocId, ) -> StorageBackendResult<()> { ... } fn reset_occurrences(&mut self, _table: &str) -> StorageBackendResult<()> { ... } fn fence_record(&mut self, _key: &[u8]) -> StorageBackendResult<()> { ... } fn replace_statistics_maintenance( &mut self, key: &[u8], value: &[u8], ) -> StorageBackendResult<()> { ... } fn graph_mutation( &mut self, _mutation: GraphMutation<'_>, ) -> StorageBackendResult<()> { ... } fn preview_graph_invalidation( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()> { ... } fn replace_graph_cache( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()> { ... }
}
Expand description

Atomic mutation buffer for a KeyValueStore.

Required Methods§

Source

fn put(&mut self, key: &[u8], value: &[u8]) -> StorageBackendResult<()>

Source

fn delete(&mut self, key: &[u8]) -> StorageBackendResult<()>

Source

fn delete_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()>

Source

fn commit(self: Box<Self>) -> StorageBackendResult<()>

Provided Methods§

Source

fn serializable_participant(&self) -> Option<SerializableTransactionId>

Original SSI participant captured with this evaluated mutation. Wrappers must forward this capability; a batch cannot move to another participant before publication.

Source

fn observe_serializable_write( &mut self, _predicate: SerializablePredicate<'_>, ) -> StorageBackendResult<()>

Stage a logical write with the evaluated records. Failed application discards its new intents and records together while retaining already established dependencies. Providers without this capability reject the request.

Source

fn require_unchanged(&mut self, _key: &[u8]) -> StorageBackendResult<()>

Require this record’s original committed revision at publication without replacing it. This permits independent data writers to share a definition. Stores without commit-time read validation reject this operation; capable wrappers must forward it.

Source

fn require_observed( &mut self, _key: &[u8], _revision: &KeyValueReadRevision, ) -> StorageBackendResult<()>

Require an actual committed record observed through an independently retained metadata view, without advancing the transaction’s data snapshot. The revision must identify this same key in this database; private and unversioned provenance is rejected. Reserved for storage-owned independently staged resources, not SQL row writes.

Source

fn put_observed( &mut self, _key: &[u8], _value: &[u8], _revision: &KeyValueReadRevision, ) -> StorageBackendResult<()>

Replace an independently staged metadata record using its observed committed precondition. Existing private changes to the key are rejected. Commit conflict, savepoint and receipt semantics are the same as other evaluated writes; this does not refresh the caller’s snapshot.

Source

fn put_with_retained_source( &mut self, _key: &[u8], _value: &[u8], _source: Arc<dyn KeyValueRead + Send + Sync>, ) -> StorageBackendResult<()>

Replace metadata and retain its independently staged read source in the same evaluated private write. The source follows savepoint undo, retained views and original receipt resolution; replacing or deleting the key releases it from the new view. Only the bytes are persisted. Capable wrappers must forward the source unchanged.

Source

fn touch_marker( &mut self, _key: &[u8], _value: &[u8], ) -> StorageBackendResult<()>

Publish a new revision of an immutable marker, merging concurrent touches of the same value. Structural changes fence the marker and replace their definition; data changes require the definition and touch the marker. The payload must contain only immutable owner/format data. Capable wrappers must forward this operation.

Source

fn replace_diskann_origin( &mut self, _key: &[u8], _value: &[u8], ) -> StorageBackendResult<()>

Stage an actual canonical origin with its evaluated complete tensor. Its original write precondition remains strict; common MVCC maintains all selected-generation populations without replaying the mutation. Capable wrappers must forward this operation.

Source

fn invalidate_diskann_origin(&mut self, key: &[u8]) -> StorageBackendResult<()>

Remove the canonical origin invalidated by a raw writer. Concurrent stores reject an existing population unless their complete publication census validates the final canonical view. Validation follows private application, command refresh and final publication, including an originally absent origin. Capable wrappers must forward this operation.

Source

fn publish_diskann_population( &mut self, _key: &[u8], _template: &[u8], _origins: DiskANNOriginReader, ) -> StorageBackendResult<()>

Retain already verified complete build origins for one authorized generation publication. The template supplies physical row encoding, not trusted counts; common MVCC computes the private and committed census on their actual canonical views. The catalog/head owner must authorize and guard this publication in the same batch.

Source

fn retire_diskann_population(&mut self, _key: &[u8]) -> StorageBackendResult<()>

Retire a generation’s population header and witnesses, including witnesses added by intervening disjoint writers. The generation/head owner must retain its original publication guards. This operation follows private undo and original receipt resolution.

Source

fn observe_identifier( &mut self, _namespace: &[u8], _value: u64, ) -> StorageBackendResult<()>

Stage a durable identifier observation before publishing this batch’s records. Successful observations survive later transaction/savepoint rollback. Dropping an unevaluated batch consumes nothing. Stores without autonomous allocation reject this operation; capable wrappers must forward it.

Source

fn inherit_identifiers( &mut self, _from: &[u8], _to: &[u8], ) -> StorageBackendResult<()>

Carry the source’s durable identifier watermark into the target before this batch publishes its records. Successful watermark updates survive undo, just like observations. Owning lifecycle code must coordinate the accompanying definition change with data writers. Capable wrappers must forward this namespace operation.

Source

fn delete_prefix_allow_absent( &mut self, prefix: &[u8], ) -> StorageBackendResult<()>

Delete only the keys selected by this evaluated prefix, accepting concurrent deletion of those keys. A concurrent live replacement still conflicts, and explicit read requirements remain strict. Reserved for obsolete internal records; callers must separately fence structural changes and new insertions. Concurrent wrappers must forward this operation.

Source

fn ivf_mutation( &mut self, _metadata: &[u8], _mutation: IVFMutation<'_>, ) -> StorageBackendResult<()>

Retain already evaluated document input in the same atomic batch as its canonical values and IVF preview. Concurrent wrappers must forward this call.

Source

fn preview_ivf_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()>

The immutable preview serves private reads; concurrent commit preparation may replace it with an internally recalculated generation.

Source

fn preview_ivf_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()>

Source

fn fence_ivf_prefix(&mut self, _prefix: &[u8]) -> StorageBackendResult<()>

Fence each existing IVF definition under this metadata prefix, including definitions with no vectors. Serialized stores already exclude competing writers.

Source

fn hnsw_mutation( &mut self, _metadata: &[u8], _mutation: HNSWMutation<'_>, ) -> StorageBackendResult<()>

Retain already evaluated document input in the same atomic batch as its canonical values and HNSW preview. Concurrent wrappers must forward this call.

Source

fn preview_hnsw_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()>

The immutable preview serves private reads; concurrent commit preparation may replace it with an internally recalculated generation.

Source

fn preview_hnsw_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()>

Source

fn fence_hnsw_prefix(&mut self, _prefix: &[u8]) -> StorageBackendResult<()>

Fence each existing HNSW definition under this metadata prefix, including definitions with no vectors. Serialized stores already exclude competing writers.

Source

fn replace_occurrence_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()>

Stage an evaluated occurrence cluster, field total or source marker using the persistence’s declared record layout. Source mutations must include their format marker and document guards. Concurrent stores merge only these explicitly typed replacements; ordinary byte writes remain conditional replacements.

Source

fn invalidate_occurrence_prefix( &mut self, prefix: &[u8], ) -> StorageBackendResult<()>

Stage source-owned occurrence-cache invalidation. The source marker in the same batch also drives discovery of caches published after the retained source view.

Source

fn occurrence_document( &mut self, _table: &str, _document: DocId, ) -> StorageBackendResult<()>

Protect whole-document replacement even when two writers select different fields of an originally absent document.

Source

fn reset_occurrences(&mut self, _table: &str) -> StorageBackendResult<()>

Fence a structural occurrence change, including an empty rebuild, drop, purge or rename. Serialized projections already retain their native mutation boundary.

Source

fn fence_record(&mut self, _key: &[u8]) -> StorageBackendResult<()>

Retain the original precondition and current value of a record, including an absent tombstone, before later replacements. Concurrent wrappers must forward this call; serialized stores already exclude intervening writers.

Source

fn replace_statistics_maintenance( &mut self, key: &[u8], value: &[u8], ) -> StorageBackendResult<()>

Stage an evaluated statistics-maintenance replacement using the provider’s declared layout. Keep ordinary metadata writes canonical.

Source

fn graph_mutation( &mut self, _mutation: GraphMutation<'_>, ) -> StorageBackendResult<()>

Record graph-cache dependencies in the same atomic batch. Concurrent MVCC stores must resolve these logical effects before admitting a commit; serialized legacy stores use the ordinary preview writes already included by the catalog.

Source

fn preview_graph_invalidation( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()>

Maintain read-your-writes for a graph invalidation. MVCC replaces this preview with effects selected from current graph ownership at commit.

Source

fn replace_graph_cache( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()>

Replace or clear derived graph cache state. Publishing a completed build must also record GraphMutation::PublishPath so its source dependencies are validated.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§