pub struct CheckpointManager<F: IntegrateFloat> { /* private fields */ }Expand description
Checkpoint manager for distributed computation
Implementations§
Source§impl<F: IntegrateFloat> CheckpointManager<F>
impl<F: IntegrateFloat> CheckpointManager<F>
Sourcepub fn new(
storage_path: PathBuf,
config: CheckpointConfig,
) -> DistributedResult<Self>
pub fn new( storage_path: PathBuf, config: CheckpointConfig, ) -> DistributedResult<Self>
Create a new checkpoint manager
Sourcepub fn create_checkpoint(
&self,
job_id: JobId,
completed_chunks: Vec<ChunkResult<F>>,
in_progress_chunks: Vec<ChunkId>,
global_state: CheckpointGlobalState<F>,
) -> DistributedResult<u64>
pub fn create_checkpoint( &self, job_id: JobId, completed_chunks: Vec<ChunkResult<F>>, in_progress_chunks: Vec<ChunkId>, global_state: CheckpointGlobalState<F>, ) -> DistributedResult<u64>
Create a new checkpoint
Sourcepub fn get_latest_checkpoint(&self, job_id: JobId) -> Option<Checkpoint<F>>
pub fn get_latest_checkpoint(&self, job_id: JobId) -> Option<Checkpoint<F>>
Get the latest checkpoint for a job
Sourcepub fn get_checkpoint(
&self,
job_id: JobId,
checkpoint_id: u64,
) -> Option<Checkpoint<F>>
pub fn get_checkpoint( &self, job_id: JobId, checkpoint_id: u64, ) -> Option<Checkpoint<F>>
Get a specific checkpoint
Sourcepub fn restore(
&self,
job_id: JobId,
checkpoint_id: Option<u64>,
) -> DistributedResult<Checkpoint<F>>
pub fn restore( &self, job_id: JobId, checkpoint_id: Option<u64>, ) -> DistributedResult<Checkpoint<F>>
Restore from a checkpoint
Sourcepub fn cleanup_job(&self, job_id: JobId) -> DistributedResult<()>
pub fn cleanup_job(&self, job_id: JobId) -> DistributedResult<()>
Delete all checkpoints for a job
Sourcepub fn should_checkpoint(&self, chunks_since_last: usize) -> bool
pub fn should_checkpoint(&self, chunks_since_last: usize) -> bool
Check if checkpoint is due
Sourcepub fn get_statistics(&self) -> CheckpointStatistics
pub fn get_statistics(&self) -> CheckpointStatistics
Get checkpoint statistics
Auto Trait Implementations§
impl<F> !Freeze for CheckpointManager<F>
impl<F> RefUnwindSafe for CheckpointManager<F>
impl<F> Send for CheckpointManager<F>where
F: Send,
impl<F> Sync for CheckpointManager<F>
impl<F> Unpin for CheckpointManager<F>where
F: Unpin,
impl<F> UnsafeUnpin for CheckpointManager<F>
impl<F> UnwindSafe for CheckpointManager<F>
Blanket Implementations§
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
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