pub struct FileSystemCheckpointStore { /* private fields */ }Expand description
Filesystem-backed checkpoint store.
Writes checkpoint manifests as JSON files with atomic rename semantics.
A latest.txt pointer (not a symlink) tracks the most recent checkpoint
for Windows compatibility.
Implementations§
Source§impl FileSystemCheckpointStore
impl FileSystemCheckpointStore
Sourcepub fn new(base_dir: impl Into<PathBuf>) -> Self
pub fn new(base_dir: impl Into<PathBuf>) -> Self
Creates a new filesystem checkpoint store.
The base_dir is the parent directory; checkpoints are stored under
{base_dir}/checkpoints/. The directory is created lazily on first save.
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 FileSystemCheckpointStore
impl CheckpointStore for FileSystemCheckpointStore
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 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 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 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_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 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_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 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 Freeze for FileSystemCheckpointStore
impl RefUnwindSafe for FileSystemCheckpointStore
impl Send for FileSystemCheckpointStore
impl Sync for FileSystemCheckpointStore
impl Unpin for FileSystemCheckpointStore
impl UnsafeUnpin for FileSystemCheckpointStore
impl UnwindSafe for FileSystemCheckpointStore
Blanket Implementations§
impl<T> Allocation for T
§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].