risingwave_storage::store

Trait LocalStateStore

source
pub trait LocalStateStore: StaticSendSync {
    type FlushedSnapshotReader: StateStoreRead;
    type Iter<'a>: StateStoreIter + 'a;
    type RevIter<'a>: StateStoreIter + 'a;

Show 14 methods // Required methods fn get( &self, key: TableKey<Bytes>, read_options: ReadOptions, ) -> impl StorageFuture<'_, Option<Bytes>>; 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 flush(&mut self) -> impl StorageFuture<'_, usize>; fn try_flush(&mut self) -> impl StorageFuture<'_, ()>; fn epoch(&self) -> u64; fn is_dirty(&self) -> bool; fn init(&mut self, opts: InitOptions) -> impl StorageFuture<'_, ()>; fn seal_current_epoch( &mut self, next_epoch: u64, opts: SealCurrentEpochOptions, ); fn update_vnode_bitmap(&mut self, vnodes: Arc<Bitmap>) -> 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§

Required Methods§

source

fn get( &self, key: TableKey<Bytes>, read_options: ReadOptions, ) -> impl StorageFuture<'_, Option<Bytes>>

Point gets a value from the state store. The result is based on the latest written snapshot.

source

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.

source

fn rev_iter( &self, key_range: TableKeyRange, read_options: ReadOptions, ) -> impl StorageFuture<'_, Self::RevIter<'_>>

source

fn new_flushed_snapshot_reader(&self) -> Self::FlushedSnapshotReader

source

fn get_table_watermark(&self, vnode: VirtualNode) -> Option<Bytes>

Get last persisted watermark for a given vnode.

source

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.

source

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.

source

fn flush(&mut self) -> impl StorageFuture<'_, usize>

source

fn try_flush(&mut self) -> impl StorageFuture<'_, ()>

source

fn epoch(&self) -> u64

source

fn is_dirty(&self) -> bool

source

fn init(&mut self, opts: InitOptions) -> impl StorageFuture<'_, ()>

Initializes the state store with given epoch pair. Typically we will use epoch.curr as the initialized epoch, Since state table will begin as empty. In some cases like replicated state table, state table may not be empty initially, as such we need to wait for epoch.prev checkpoint to complete, hence this interface is made async.

source

fn seal_current_epoch(&mut self, next_epoch: u64, opts: SealCurrentEpochOptions)

Updates the monotonically increasing write epoch to new_epoch. All writes after this function is called will be tagged with new_epoch. In other words, the previous write epoch is sealed.

source

fn update_vnode_bitmap(&mut self, vnodes: Arc<Bitmap>) -> Arc<Bitmap>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl LocalStateStore for LocalHummockStorage

source§

impl LocalStateStore for PanicStateStore

source§

impl LocalStateStore for StateStorePointer<Box<dyn DynLocalStateStore>>

source§

type FlushedSnapshotReader = StateStorePointer<Arc<dyn DynStateStoreRead>>

source§

type Iter<'a> = Box<dyn DynStateStoreIter<(FullKey<Bytes>, Bytes)> + 'a>

source§

type RevIter<'a> = Box<dyn DynStateStoreIter<(FullKey<Bytes>, Bytes)> + 'a>

source§

impl<A: LocalStateStore, E: LocalStateStore> LocalStateStore for VerifyStateStore<A, E>

source§

impl<R: RangeKv> LocalStateStore for RangeKvLocalStateStore<R>

source§

impl<S: LocalStateStore> LocalStateStore for MonitoredStateStore<S>