pub trait StateStoreWriteEpochControl: StaticSendSync {
// Required methods
fn flush(&mut self) -> impl StorageFuture<'_, usize>;
fn try_flush(&mut self) -> impl StorageFuture<'_, ()>;
fn init(&mut self, opts: InitOptions) -> impl StorageFuture<'_, ()>;
fn seal_current_epoch(
&mut self,
next_epoch: u64,
opts: SealCurrentEpochOptions,
);
}
Required Methods§
fn flush(&mut self) -> impl StorageFuture<'_, usize>
fn try_flush(&mut self) -> impl StorageFuture<'_, ()>
Sourcefn init(&mut self, opts: InitOptions) -> impl StorageFuture<'_, ()>
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.
Sourcefn seal_current_epoch(&mut self, next_epoch: u64, opts: SealCurrentEpochOptions)
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.
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.