CheckpointStore

Trait CheckpointStore 

Source
pub trait CheckpointStore {
    // Required methods
    fn save_checkpoint(
        &self,
        run_id: &RunId,
        node_id: &NodeId,
        state: &[u8],
        metadata: Option<HashMap<String, String>>,
    ) -> Result<CheckpointMeta>;
    fn load_checkpoint(
        &self,
        run_id: &RunId,
        node_id: &NodeId,
    ) -> Result<Option<Checkpoint>>;
    fn load_checkpoint_at(
        &self,
        run_id: &RunId,
        node_id: &NodeId,
        seq: SeqNo,
    ) -> Result<Option<Checkpoint>>;
    fn list_checkpoints(&self, run_id: &RunId) -> Result<Vec<CheckpointMeta>>;
    fn list_node_checkpoints(
        &self,
        run_id: &RunId,
        node_id: &NodeId,
    ) -> Result<Vec<CheckpointMeta>>;
    fn create_run(
        &self,
        run_id: &RunId,
        workflow: &str,
        params: HashMap<String, Value>,
    ) -> Result<RunMetadata>;
    fn get_run(&self, run_id: &RunId) -> Result<Option<RunMetadata>>;
    fn update_run_status(&self, run_id: &RunId, status: RunStatus) -> Result<()>;
    fn append_event(&self, event: WorkflowEvent) -> Result<SeqNo>;
    fn get_events(
        &self,
        run_id: &RunId,
        since_seq: Option<SeqNo>,
        limit: usize,
    ) -> Result<Vec<WorkflowEvent>>;
    fn delete_run(&self, run_id: &RunId) -> Result<bool>;
}
Expand description

Trait defining the checkpoint storage interface

This is the primary API for external orchestrators to use.

Required Methods§

Source

fn save_checkpoint( &self, run_id: &RunId, node_id: &NodeId, state: &[u8], metadata: Option<HashMap<String, String>>, ) -> Result<CheckpointMeta>

Save a checkpoint for a node

Source

fn load_checkpoint( &self, run_id: &RunId, node_id: &NodeId, ) -> Result<Option<Checkpoint>>

Load the latest checkpoint for a node

Source

fn load_checkpoint_at( &self, run_id: &RunId, node_id: &NodeId, seq: SeqNo, ) -> Result<Option<Checkpoint>>

Load a specific checkpoint by sequence number

Source

fn list_checkpoints(&self, run_id: &RunId) -> Result<Vec<CheckpointMeta>>

List all checkpoints for a run

Source

fn list_node_checkpoints( &self, run_id: &RunId, node_id: &NodeId, ) -> Result<Vec<CheckpointMeta>>

List checkpoints for a specific node

Source

fn create_run( &self, run_id: &RunId, workflow: &str, params: HashMap<String, Value>, ) -> Result<RunMetadata>

Create a new run

Source

fn get_run(&self, run_id: &RunId) -> Result<Option<RunMetadata>>

Get run metadata

Source

fn update_run_status(&self, run_id: &RunId, status: RunStatus) -> Result<()>

Update run status

Source

fn append_event(&self, event: WorkflowEvent) -> Result<SeqNo>

Append an event to the run’s event log

Source

fn get_events( &self, run_id: &RunId, since_seq: Option<SeqNo>, limit: usize, ) -> Result<Vec<WorkflowEvent>>

Get events for a run (optionally since a sequence number)

Source

fn delete_run(&self, run_id: &RunId) -> Result<bool>

Delete a run and all its checkpoints/events

Implementors§