pub trait LocalStateStore:
StateStoreGet
+ StateStoreWriteEpochControl
+ StaticSendSync {
type FlushedSnapshotReader: StateStoreRead;
type Iter<'a>: StateStoreIter + 'a;
type RevIter<'a>: StateStoreIter + 'a;
// Required methods
fn iter(
&self,
key_range: TableKeyRange,
read_options: ReadOptions,
) -> impl StorageFuture<'_, Self::Iter<'_>>;
fn rev_iter(
&self,
key_range: TableKeyRange,
read_options: ReadOptions,
) -> impl StorageFuture<'_, Self::RevIter<'_>>;
fn new_flushed_snapshot_reader(&self) -> Self::FlushedSnapshotReader;
fn get_table_watermark(&self, vnode: VirtualNode) -> Option<Bytes>;
fn insert(
&mut self,
key: TableKey<Bytes>,
new_val: Bytes,
old_val: Option<Bytes>,
) -> StorageResult<()>;
fn delete(
&mut self,
key: TableKey<Bytes>,
old_val: Bytes,
) -> StorageResult<()>;
fn update_vnode_bitmap(
&mut self,
vnodes: Arc<Bitmap>,
) -> impl StorageFuture<'_, Arc<Bitmap>>;
}
Expand description
A state store that is dedicated for streaming operator, which only reads the uncommitted data
written by itself. Each local state store is not Clone
, and is owned by a streaming state
table.
Required Associated Types§
type FlushedSnapshotReader: StateStoreRead
type Iter<'a>: StateStoreIter + 'a
type RevIter<'a>: StateStoreIter + 'a
Required Methods§
Sourcefn iter(
&self,
key_range: TableKeyRange,
read_options: ReadOptions,
) -> impl StorageFuture<'_, Self::Iter<'_>>
fn iter( &self, key_range: TableKeyRange, read_options: ReadOptions, ) -> impl StorageFuture<'_, Self::Iter<'_>>
Opens and returns an iterator for given prefix_hint
and full_key_range
Internally, prefix_hint
will be used to for checking bloom_filter
and
full_key_range
used for iter. (if the prefix_hint
not None, it should be be included
in key_range
) The returned iterator will iterate data based on the latest written
snapshot.
fn rev_iter( &self, key_range: TableKeyRange, read_options: ReadOptions, ) -> impl StorageFuture<'_, Self::RevIter<'_>>
fn new_flushed_snapshot_reader(&self) -> Self::FlushedSnapshotReader
Sourcefn get_table_watermark(&self, vnode: VirtualNode) -> Option<Bytes>
fn get_table_watermark(&self, vnode: VirtualNode) -> Option<Bytes>
Get last persisted watermark for a given vnode.
Sourcefn insert(
&mut self,
key: TableKey<Bytes>,
new_val: Bytes,
old_val: Option<Bytes>,
) -> StorageResult<()>
fn insert( &mut self, key: TableKey<Bytes>, new_val: Bytes, old_val: Option<Bytes>, ) -> StorageResult<()>
Inserts a key-value entry associated with a given epoch
into the state store.
Sourcefn delete(&mut self, key: TableKey<Bytes>, old_val: Bytes) -> StorageResult<()>
fn delete(&mut self, key: TableKey<Bytes>, old_val: Bytes) -> StorageResult<()>
Deletes a key-value entry from the state store. Only the key-value entry with epoch smaller
than the given epoch
will be deleted.
fn update_vnode_bitmap( &mut self, vnodes: Arc<Bitmap>, ) -> impl StorageFuture<'_, Arc<Bitmap>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.