pub struct ObjectStoreCheckpointStore { /* private fields */ }Expand description
Object-store-backed checkpoint store.
Drives any object_store::ObjectStore backend (S3, GCS, Azure,
local FS) directly over .await; no dedicated runtime. The app
runtime’s HTTP connection pool is reused.
§Object Layout
{prefix}/
manifests/
manifest-000001.json # Checkpoint manifest (JSON)
manifest-000002.json
latest.json # {"checkpoint_id": 2}
checkpoints/
state-000001.bin # Optional sidecar state
state-000002.binManifest creation, finalization, and recovery-pointer publication are all
conditional writes. The only mutable manifest transition is the exact
Prepared to Finalized phase change.
Implementations§
Source§impl ObjectStoreCheckpointStore
impl ObjectStoreCheckpointStore
Sourcepub fn new(store: Arc<dyn ObjectStore>, prefix: String) -> Self
pub fn new(store: Arc<dyn ObjectStore>, prefix: String) -> Self
Create a new object-store-backed checkpoint store.
prefix is prepended to all object paths (e.g., "nodes/abc123/").
It should end with / or be empty.
Embedded and single-node stores default to one key group. Cluster hosts
must chain Self::with_key_group_count with their durable topology.
Sourcepub fn with_key_group_count(self, key_group_count: KeyGroupCount) -> Self
pub fn with_key_group_count(self, key_group_count: KeyGroupCount) -> Self
Override the stable key-group count used during manifest validation.
Sourcepub fn with_participant_id(self, participant_id: u64) -> Self
pub fn with_participant_id(self, participant_id: u64) -> Self
Bind this store to one runtime participant.
Sourcepub fn with_max_state_data_bytes(
self,
max_state_data_bytes: u64,
) -> Result<Self, CheckpointStoreError>
pub fn with_max_state_data_bytes( self, max_state_data_bytes: u64, ) -> Result<Self, CheckpointStoreError>
Override the aggregate raw logical-state and physical-sidecar bytes admitted per checkpoint.
§Errors
Returns CheckpointStoreError::Invalid when the limit cannot safely
bound an in-memory restore allocation and its one-byte overflow probe.
Trait Implementations§
Source§impl CheckpointStore for ObjectStoreCheckpointStore
impl CheckpointStore for ObjectStoreCheckpointStore
Source§fn max_state_data_bytes(&self) -> u64
fn max_state_data_bytes(&self) -> u64
Source§fn key_group_count(&self) -> KeyGroupCount
fn key_group_count(&self) -> KeyGroupCount
Source§fn participant_id(&self) -> u64
fn participant_id(&self) -> u64
Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
manifest: &'life1 CheckpointManifest,
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
manifest: &'life1 CheckpointManifest,
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn finalize<'life0, 'async_trait>(
&'life0 self,
checkpoint_id: u64,
) -> Pin<Box<dyn Future<Output = Result<CheckpointManifest, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn finalize<'life0, 'async_trait>(
&'life0 self,
checkpoint_id: u64,
) -> Pin<Box<dyn Future<Output = Result<CheckpointManifest, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn load_latest<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_latest<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Ok(None) when the
recovery pointer does not exist in a fresh store. Read moreSource§fn load_by_id<'life0, 'async_trait>(
&'life0 self,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_by_id<'life0, 'async_trait>(
&'life0 self,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Ok(None) if absent. Read moreSource§fn load_manifest_for_participant<'life0, 'async_trait>(
&'life0 self,
participant_id: u64,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_manifest_for_participant<'life0, 'async_trait>(
&'life0 self,
participant_id: u64,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointManifest>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn list_ids<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_ids<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Self::list this enumerates corrupt manifests too (used by
crash recovery). Callers rely on the ascending invariant. Read moreSource§fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, u64)>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, u64)>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
(id, epoch) pairs, sorted
ascending by ID. May read every manifest; callers that only
need IDs should use Self::list_ids. Read moreSource§fn prune_before<'life0, 'async_trait>(
&'life0 self,
before_epoch: u64,
) -> Pin<Box<dyn Future<Output = Result<usize, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prune_before<'life0, 'async_trait>(
&'life0 self,
before_epoch: u64,
) -> Pin<Box<dyn Future<Output = Result<usize, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
before_epoch. Read moreSource§fn save_state_data<'life0, 'life1, 'async_trait>(
&'life0 self,
id: u64,
chunks: &'life1 [Bytes],
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_state_data<'life0, 'life1, 'async_trait>(
&'life0 self,
id: u64,
chunks: &'life1 [Bytes],
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn load_state_data<'life0, 'async_trait>(
&'life0 self,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_state_data<'life0, 'async_trait>(
&'life0 self,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Ok(None)
if no sidecar was written. Read moreSource§fn load_state_data_for_participant<'life0, 'async_trait>(
&'life0 self,
participant_id: u64,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_state_data_for_participant<'life0, 'async_trait>(
&'life0 self,
participant_id: u64,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn state_data_len_for_participant<'life0, 'async_trait>(
&'life0 self,
participant_id: u64,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn state_data_len_for_participant<'life0, 'async_trait>(
&'life0 self,
participant_id: u64,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn ensure_manifest_participant(
&self,
manifest: &CheckpointManifest,
) -> Result<(), CheckpointStoreError>
fn ensure_manifest_participant( &self, manifest: &CheckpointManifest, ) -> Result<(), CheckpointStoreError>
Source§fn ensure_manifest_valid(
&self,
manifest: &CheckpointManifest,
) -> Result<(), CheckpointStoreError>
fn ensure_manifest_valid( &self, manifest: &CheckpointManifest, ) -> Result<(), CheckpointStoreError>
Source§fn load_checkpoint_artifacts<'life0, 'async_trait>(
&'life0 self,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointArtifacts>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_checkpoint_artifacts<'life0, 'async_trait>(
&'life0 self,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointArtifacts>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn load_checkpoint_artifacts_for_participant<'life0, 'async_trait>(
&'life0 self,
participant_id: u64,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointArtifacts>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_checkpoint_artifacts_for_participant<'life0, 'async_trait>(
&'life0 self,
participant_id: u64,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointArtifacts>, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn validate_checkpoint<'life0, 'async_trait>(
&'life0 self,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<ValidationResult, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn validate_checkpoint<'life0, 'async_trait>(
&'life0 self,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<ValidationResult, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn recover_latest_validated<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RecoveryReport, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recover_latest_validated<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RecoveryReport, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn save_with_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
manifest: &'life1 CheckpointManifest,
state_data: Option<&'life2 [Bytes]>,
) -> Pin<Box<dyn Future<Output = Result<CheckpointManifest, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_with_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
manifest: &'life1 CheckpointManifest,
state_data: Option<&'life2 [Bytes]>,
) -> Pin<Box<dyn Future<Output = Result<CheckpointManifest, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for ObjectStoreCheckpointStore
impl !UnwindSafe for ObjectStoreCheckpointStore
impl Freeze for ObjectStoreCheckpointStore
impl Send for ObjectStoreCheckpointStore
impl Sync for ObjectStoreCheckpointStore
impl Unpin for ObjectStoreCheckpointStore
impl UnsafeUnpin for ObjectStoreCheckpointStore
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].