Skip to main content

CheckpointStore

Trait CheckpointStore 

Source
pub trait CheckpointStore: Send + Sync {
Show 20 methods // Required methods fn max_node_data_bytes(&self) -> u64; fn save_checkpoint<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, manifest: &'life1 CheckpointManifest, node_data: &'life2 [Bytes], ) -> Pin<Box<dyn Future<Output = Result<Bytes, CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn save_sink_artifact_intents<'life0, 'life1, 'async_trait>( &'life0 self, chunk: StateChunkId, expected_artifact_identity_sha256: &'life1 str, intents: Vec<CheckpointSinkArtifactIntent>, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn seal_aborted_manifest<'life0, 'life1, 'async_trait>( &'life0 self, chunk: StateChunkId, expected_artifact_identity_sha256: &'life1 str, sink_artifact_intent_protocol: bool, ) -> Pin<Box<dyn Future<Output = Result<CheckpointManifestAbortSeal, CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn complete_aborted_sink_cleanup<'life0, 'life1, 'async_trait>( &'life0 self, chunk: StateChunkId, expected_artifact_identity_sha256: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<CheckpointManifestAbortSeal, CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn seal_aborted_node_data<'life0, 'life1, 'async_trait>( &'life0 self, chunk: StateChunkId, expected_artifact_identity_sha256: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn load_manifest_for_participant<'life0, 'async_trait>( &'life0 self, participant_id: u64, checkpoint_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn load_manifest_verified<'life0, 'life1, 'async_trait>( &'life0 self, participant_id: u64, checkpoint_id: u64, expected_len: u64, expected_sha256: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn load_node_data_ranges<'life0, 'life1, 'async_trait>( &'life0 self, chunk: StateChunkId, expected_object_length: u64, ranges: &'life1 [ByteRange], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Bytes>>, CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_manifest<'life0, 'async_trait>( &'life0 self, chunk: StateChunkId, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn delete_node_data<'life0, 'async_trait>( &'life0 self, chunk: StateChunkId, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn key_group_count(&self) -> KeyGroupCount { ... } fn participant_id(&self) -> u64 { ... } fn load_manifest<'life0, 'async_trait>( &'life0 self, checkpoint_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn load_prepared_sink_descriptor<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, manifest: &'life1 CheckpointManifest, descriptor: &'life2 PreparedSinkDescriptor, ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn load_sink_artifact_intent<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, manifest: &'life1 CheckpointManifest, intent: &'life2 PreparedSinkArtifactIntent, ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn save_subscription_segment<'life0, 'life1, 'async_trait>( &'life0 self, _segment: &'life1 OutputSegmentRef, _payload: Bytes, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn load_subscription_segment<'life0, 'life1, 'async_trait>( &'life0 self, _segment: &'life1 OutputSegmentRef, ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn delete_subscription_segment<'life0, 'life1, 'async_trait>( &'life0 self, _object_key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn delete_subscription_orphans<'life0, 'life1, 'async_trait>( &'life0 self, _reachable: &'life1 BTreeSet<String>, _through_checkpoint_id: u64, _grace_before_ms: i64, ) -> Pin<Box<dyn Future<Output = Result<SubscriptionOrphanCleanup, CheckpointStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}
Expand description

Immutable checkpoint storage contract.

Required Methods§

Source

fn max_node_data_bytes(&self) -> u64

Maximum bytes admitted for one node data object.

Source

fn save_checkpoint<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, manifest: &'life1 CheckpointManifest, node_data: &'life2 [Bytes], ) -> Pin<Box<dyn Future<Output = Result<Bytes, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Validate and conditional-create the immutable node data object, then its manifest. Active inventory and exact Abort seals reconcile creates left ambiguous by caller cancellation.

Source

fn save_sink_artifact_intents<'life0, 'life1, 'async_trait>( &'life0 self, chunk: StateChunkId, expected_artifact_identity_sha256: &'life1 str, intents: Vec<CheckpointSinkArtifactIntent>, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persist every committable sink’s bounded cleanup intent before begin_epoch.

Source

fn seal_aborted_manifest<'life0, 'life1, 'async_trait>( &'life0 self, chunk: StateChunkId, expected_artifact_identity_sha256: &'life1 str, sink_artifact_intent_protocol: bool, ) -> Pin<Box<dyn Future<Output = Result<CheckpointManifestAbortSeal, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Replace this exact aborted manifest path with a monotone seal. The protocol flag must come from the exact active artifact inventory. If a valid manifest was already durable, preserve it inside the seal and return it with its canonical bytes.

Source

fn complete_aborted_sink_cleanup<'life0, 'life1, 'async_trait>( &'life0 self, chunk: StateChunkId, expected_artifact_identity_sha256: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<CheckpointManifestAbortSeal, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mark exact prepared-sink cleanup complete on an already sealed manifest.

Source

fn seal_aborted_node_data<'life0, 'life1, 'async_trait>( &'life0 self, chunk: StateChunkId, expected_artifact_identity_sha256: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Replace this exact aborted node-data path with a monotone seal after sink cleanup is durable.

Source

fn load_manifest_for_participant<'life0, 'async_trait>( &'life0 self, participant_id: u64, checkpoint_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load an exact manifest from a known participant namespace.

Source

fn load_manifest_verified<'life0, 'life1, 'async_trait>( &'life0 self, participant_id: u64, checkpoint_id: u64, expected_len: u64, expected_sha256: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load a manifest only when its exact persisted length and digest match a committed index.

Source

fn load_node_data_ranges<'life0, 'life1, 'async_trait>( &'life0 self, chunk: StateChunkId, expected_object_length: u64, ranges: &'life1 [ByteRange], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Bytes>>, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read exact ranges after verifying the immutable object’s declared length.

Source

fn delete_manifest<'life0, 'async_trait>( &'life0 self, chunk: StateChunkId, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete an explicitly identified manifest. GC must supply the identity from durable checkpoint metadata, never from object listing.

Source

fn delete_node_data<'life0, 'async_trait>( &'life0 self, chunk: StateChunkId, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete an explicitly identified node object after its durable reference count reaches zero.

Provided Methods§

Source

fn key_group_count(&self) -> KeyGroupCount

Stable vnode count expected in manifests.

Source

fn participant_id(&self) -> u64

Node whose manifests this store writes.

Source

fn load_manifest<'life0, 'async_trait>( &'life0 self, checkpoint_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load this node’s exact manifest.

Source

fn load_prepared_sink_descriptor<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, manifest: &'life1 CheckpointManifest, descriptor: &'life2 PreparedSinkDescriptor, ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Read and verify one prepared sink descriptor.

Source

fn load_sink_artifact_intent<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, manifest: &'life1 CheckpointManifest, intent: &'life2 PreparedSinkArtifactIntent, ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Read and verify one begin-time sink artifact intent.

Source

fn save_subscription_segment<'life0, 'life1, 'async_trait>( &'life0 self, _segment: &'life1 OutputSegmentRef, _payload: Bytes, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create an immutable subscription segment, accepting an identical retry only.

Source

fn load_subscription_segment<'life0, 'life1, 'async_trait>( &'life0 self, _segment: &'life1 OutputSegmentRef, ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load and verify an exact subscription segment without consulting object listing.

Source

fn delete_subscription_segment<'life0, 'life1, 'async_trait>( &'life0 self, _object_key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete an explicitly unreachable subscription segment.

Source

fn delete_subscription_orphans<'life0, 'life1, 'async_trait>( &'life0 self, _reachable: &'life1 BTreeSet<String>, _through_checkpoint_id: u64, _grace_before_ms: i64, ) -> Pin<Box<dyn Future<Output = Result<SubscriptionOrphanCleanup, CheckpointStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete grace-expired segment objects not present in an authoritative reachable set. Object listing supplies candidates only; reachable and through_checkpoint_id are the caller’s committed-state authority.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§