Skip to main content

OffsetStore

Trait OffsetStore 

Source
pub trait OffsetStore: Send + Sync {
    // Required methods
    fn get_all_offsets(
        &self,
    ) -> Result<HashMap<String, HashMap<i32, i64>>, SnapshotError>;
    fn set_offsets(
        &self,
        offsets: HashMap<String, HashMap<i32, i64>>,
    ) -> Result<(), SnapshotError>;
}
Expand description

Trait for offset storage.

Offsets use next_offset_to_apply semantics:

  • All messages with offset < stored value have been applied
  • On restore, consumers start from stored offset

Required Methods§

Source

fn get_all_offsets( &self, ) -> Result<HashMap<String, HashMap<i32, i64>>, SnapshotError>

Get all offsets: stream -> partition -> next_offset_to_apply

Source

fn set_offsets( &self, offsets: HashMap<String, HashMap<i32, i64>>, ) -> Result<(), SnapshotError>

Set offsets atomically.

Implementors§