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 writes use [PutMode::Create] for split-brain prevention
(conditional PUT).
Implementations§
Source§impl ObjectStoreCheckpointStore
impl ObjectStoreCheckpointStore
Sourcepub fn new(
store: Arc<dyn ObjectStore>,
prefix: String,
max_retained: usize,
) -> Self
pub fn new( store: Arc<dyn ObjectStore>, prefix: String, max_retained: usize, ) -> 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.
The store’s vnode_count defaults to
crate::checkpoint::checkpoint_manifest::DEFAULT_VNODE_COUNT. Hosts that run
with a non-default value should chain Self::with_vnode_count.
Sourcepub fn with_vnode_count(self, vnode_count: u16) -> Self
pub fn with_vnode_count(self, vnode_count: u16) -> Self
Override the vnode_count used during manifest validation.
Trait Implementations§
Source§impl CheckpointStore for ObjectStoreCheckpointStore
impl CheckpointStore for ObjectStoreCheckpointStore
Source§fn vnode_count(&self) -> u16
fn vnode_count(&self) -> u16
Runtime vnode count that manifests written by this store are
expected to use. Consulted when validating loaded manifests —
a mismatch is reported as a manifest warning. Defaults to
crate::checkpoint::checkpoint_manifest::DEFAULT_VNODE_COUNT when the
implementation has no configured value.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,
Atomically persists a checkpoint manifest. Implementations must
guarantee readers never observe a partial manifest. Read more
Source§fn update_manifest<'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 update_manifest<'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,
Overwrites an existing manifest, bypassing the conditional-PUT
fence used by
Self::save. Used after a successful sink
commit to record per-sink status transitions. Read moreSource§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,
Loads the most recent checkpoint manifest, or
Ok(None) on 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,
Loads a specific manifest, or
Ok(None) if absent. Read moreSource§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,
Lists all checkpoint IDs, sorted ascending. Unlike
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,
Lists all available checkpoints as
(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<'life0, 'async_trait>(
&'life0 self,
keep_count: usize,
) -> Pin<Box<dyn Future<Output = Result<usize, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prune<'life0, 'async_trait>(
&'life0 self,
keep_count: usize,
) -> Pin<Box<dyn Future<Output = Result<usize, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prunes old checkpoints, keeping at most
keep_count recent
ones. Returns the number of checkpoints removed. 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,
Writes operator state sidecar bytes for a checkpoint. Read more
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,
Loads operator state sidecar bytes for a checkpoint, or
Ok(None)
if no sidecar was written. Read moreSource§fn cleanup_orphans<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cleanup_orphans<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete orphaned state files that have no matching manifest. Read more
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,
Validate a specific checkpoint’s integrity. Read more
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,
Walk backward from latest to find the first valid checkpoint. Read more
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<(), 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<(), CheckpointStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Atomically saves a checkpoint manifest with optional sidecar state data. Read more
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 = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
§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>
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 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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
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>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.