Skip to main content

BaseCheckpointSaver

Trait BaseCheckpointSaver 

Source
pub trait BaseCheckpointSaver: Send + Sync {
    // Required methods
    fn get_tuple<'a>(
        &'a self,
        config: &'a CheckpointConfig,
    ) -> BoxFuture<'a, Result<Option<CheckpointTuple>, CheckpointError>>;
    fn list<'a>(
        &'a self,
        config: &'a CheckpointConfig,
        limit: Option<usize>,
    ) -> BoxFuture<'a, Result<Vec<CheckpointTuple>, CheckpointError>>;
    fn put<'a>(
        &'a self,
        config: &'a CheckpointConfig,
        checkpoint: Checkpoint,
        metadata: CheckpointMetadata,
    ) -> BoxFuture<'a, Result<CheckpointConfig, CheckpointError>>;
}
Expand description

Trait for persisting and retrieving graph checkpoints.

Implementations must be thread-safe (Send + Sync) and return boxed futures for async compatibility without the async-trait macro.

Required Methods§

Source

fn get_tuple<'a>( &'a self, config: &'a CheckpointConfig, ) -> BoxFuture<'a, Result<Option<CheckpointTuple>, CheckpointError>>

Retrieve a single checkpoint tuple matching the given configuration.

If config.checkpoint_id is None, returns the latest checkpoint for the given thread. Returns Ok(None) if no matching checkpoint exists.

Source

fn list<'a>( &'a self, config: &'a CheckpointConfig, limit: Option<usize>, ) -> BoxFuture<'a, Result<Vec<CheckpointTuple>, CheckpointError>>

List checkpoint tuples for the given configuration.

Returns checkpoints in reverse chronological order (newest first). If limit is Some(n), returns at most n results.

Source

fn put<'a>( &'a self, config: &'a CheckpointConfig, checkpoint: Checkpoint, metadata: CheckpointMetadata, ) -> BoxFuture<'a, Result<CheckpointConfig, CheckpointError>>

Persist a checkpoint with its metadata.

Returns the updated CheckpointConfig with the assigned checkpoint ID.

Implementors§