Skip to main content

SnapshotStore

Trait SnapshotStore 

Source
pub trait SnapshotStore:
    Send
    + Sync
    + 'static {
    // Required methods
    fn save<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 SnapshotKey,
        snapshot: &'life2 TaskSnapshot,
    ) -> Pin<Box<dyn Future<Output = Result<(), StreamsClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 SnapshotKey,
    ) -> Pin<Box<dyn Future<Output = Result<Option<TaskSnapshot>, StreamsClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Keeps the store snapshots a task takes at each barrier cut.

FileSnapshotStore writes them to local files on native targets. NoSnapshotStore keeps nothing, which makes the barrier an alignment and commit point with no durable state.

Required Methods§

Source

fn save<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 SnapshotKey, snapshot: &'life2 TaskSnapshot, ) -> Pin<Box<dyn Future<Output = Result<(), StreamsClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Stores one task’s snapshot under key, and replaces what was there.

§Errors

Returns StreamsClientError::Snapshot when the implementation cannot write the snapshot.

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 SnapshotKey, ) -> Pin<Box<dyn Future<Output = Result<Option<TaskSnapshot>, StreamsClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reads back the snapshot stored under key, or None when there is none.

§Errors

Returns StreamsClientError::Snapshot when the implementation cannot read the snapshot, or when the stored bytes are malformed.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§