pub struct ObjectStoreCheckpointStore { /* private fields */ }Expand description
Object-store-backed checkpoint store with hierarchical layout.
Bridges the sync CheckpointStore trait to the async [ObjectStore] API
via a dedicated single-threaded Tokio runtime. Checkpoints run infrequently
(every ~10s) and are not on the hot path.
§Object Layout (v2 — hierarchical)
{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.bin§Legacy Layout (v1 — flat, read-only)
{prefix}/checkpoints/
checkpoint_000001/
manifest.json
state.bin
latest.txt # "checkpoint_000002"Reads check v2 paths first, then fall back to v1 for backward compatibility.
Writes always use v2 layout. Manifest 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,
) -> Result<Self>
pub fn new( store: Arc<dyn ObjectStore>, prefix: String, max_retained: usize, ) -> Result<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.
§Errors
Returns std::io::Error if the internal Tokio runtime cannot be created.
Trait Implementations§
Source§impl CheckpointStore for ObjectStoreCheckpointStore
impl CheckpointStore for ObjectStoreCheckpointStore
Source§fn save(
&self,
manifest: &CheckpointManifest,
) -> Result<(), CheckpointStoreError>
fn save( &self, manifest: &CheckpointManifest, ) -> Result<(), CheckpointStoreError>
Persists a checkpoint manifest atomically. Read more
Source§fn update_manifest(
&self,
manifest: &CheckpointManifest,
) -> Result<(), CheckpointStoreError>
fn update_manifest( &self, manifest: &CheckpointManifest, ) -> Result<(), CheckpointStoreError>
Overwrites an existing checkpoint manifest. Read more
Source§fn load_latest(
&self,
) -> Result<Option<CheckpointManifest>, CheckpointStoreError>
fn load_latest( &self, ) -> Result<Option<CheckpointManifest>, CheckpointStoreError>
Loads the most recent checkpoint manifest. Read more
Source§fn load_by_id(
&self,
id: u64,
) -> Result<Option<CheckpointManifest>, CheckpointStoreError>
fn load_by_id( &self, id: u64, ) -> Result<Option<CheckpointManifest>, CheckpointStoreError>
Loads a specific checkpoint manifest by ID. Read more
Source§fn list_ids(&self) -> Result<Vec<u64>, CheckpointStoreError>
fn list_ids(&self) -> Result<Vec<u64>, CheckpointStoreError>
Lists all checkpoint IDs without loading manifests. Read more
Source§fn list(&self) -> Result<Vec<(u64, u64)>, CheckpointStoreError>
fn list(&self) -> Result<Vec<(u64, u64)>, CheckpointStoreError>
Lists all available checkpoints as
(checkpoint_id, epoch) pairs. Read moreSource§fn prune(&self, keep_count: usize) -> Result<usize, CheckpointStoreError>
fn prune(&self, keep_count: usize) -> Result<usize, CheckpointStoreError>
Prunes old checkpoints, keeping at most
keep_count recent ones. Read moreSource§fn save_state_data(
&self,
id: u64,
data: &[u8],
) -> Result<(), CheckpointStoreError>
fn save_state_data( &self, id: u64, data: &[u8], ) -> Result<(), CheckpointStoreError>
Writes large operator state data to a sidecar file for a given checkpoint. Read more
Source§fn load_state_data(
&self,
id: u64,
) -> Result<Option<Vec<u8>>, CheckpointStoreError>
fn load_state_data( &self, id: u64, ) -> Result<Option<Vec<u8>>, CheckpointStoreError>
Loads large operator state data from a sidecar file. Read more
Source§fn cleanup_orphans(&self) -> Result<usize, CheckpointStoreError>
fn cleanup_orphans(&self) -> Result<usize, CheckpointStoreError>
Delete orphaned state files that have no matching manifest. Read more
Source§fn validate_checkpoint(
&self,
id: u64,
) -> Result<ValidationResult, CheckpointStoreError>
fn validate_checkpoint( &self, id: u64, ) -> Result<ValidationResult, CheckpointStoreError>
Validate a specific checkpoint’s integrity. Read more
Source§fn recover_latest_validated(
&self,
) -> Result<RecoveryReport, CheckpointStoreError>
fn recover_latest_validated( &self, ) -> Result<RecoveryReport, CheckpointStoreError>
Walk backward from latest to find the first valid checkpoint. Read more
Source§fn save_with_state(
&self,
manifest: &CheckpointManifest,
state_data: Option<&[u8]>,
) -> Result<(), CheckpointStoreError>
fn save_with_state( &self, manifest: &CheckpointManifest, state_data: Option<&[u8]>, ) -> Result<(), CheckpointStoreError>
Atomically saves a checkpoint manifest with optional sidecar state data. Read more
Auto Trait Implementations§
impl !Freeze for ObjectStoreCheckpointStore
impl !RefUnwindSafe for ObjectStoreCheckpointStore
impl Send for ObjectStoreCheckpointStore
impl Sync for ObjectStoreCheckpointStore
impl Unpin for ObjectStoreCheckpointStore
impl UnsafeUnpin for ObjectStoreCheckpointStore
impl !UnwindSafe 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> 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.