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§
Sourcefn get_all_offsets(
&self,
) -> Result<HashMap<String, HashMap<i32, i64>>, SnapshotError>
fn get_all_offsets( &self, ) -> Result<HashMap<String, HashMap<i32, i64>>, SnapshotError>
Get all offsets: stream -> partition -> next_offset_to_apply
Sourcefn set_offsets(
&self,
offsets: HashMap<String, HashMap<i32, i64>>,
) -> Result<(), SnapshotError>
fn set_offsets( &self, offsets: HashMap<String, HashMap<i32, i64>>, ) -> Result<(), SnapshotError>
Set offsets atomically.