Trait StateStore

Source
pub trait StateStore:
    StateStoreReadLog
    + StaticSendSync
    + Clone {
    type Local: LocalStateStore;
    type ReadSnapshot: StateStoreRead + StateStoreReadVector + Clone;
    type VectorWriter: StateStoreWriteVector;

    // Required methods
    fn try_wait_epoch(
        &self,
        epoch: HummockReadEpoch,
        options: TryWaitEpochOptions,
    ) -> impl StorageFuture<'_, ()>;
    fn new_local(
        &self,
        option: NewLocalOptions,
    ) -> impl Future<Output = Self::Local> + Send + '_;
    fn new_read_snapshot(
        &self,
        epoch: HummockReadEpoch,
        options: NewReadSnapshotOptions,
    ) -> impl StorageFuture<'_, Self::ReadSnapshot>;
    fn new_vector_writer(
        &self,
        options: NewVectorWriterOptions,
    ) -> impl Future<Output = Self::VectorWriter> + Send + '_;

    // Provided method
    fn monitored(
        self,
        storage_metrics: Arc<MonitoredStorageMetrics>,
    ) -> MonitoredStateStore<Self> { ... }
}

Required Associated Types§

Required Methods§

Source

fn try_wait_epoch( &self, epoch: HummockReadEpoch, options: TryWaitEpochOptions, ) -> impl StorageFuture<'_, ()>

If epoch is Committed, we will wait until the epoch is committed and its data is ready to read. If epoch is Current, we will only check if the data can be read with this epoch.

Source

fn new_local( &self, option: NewLocalOptions, ) -> impl Future<Output = Self::Local> + Send + '_

Source

fn new_read_snapshot( &self, epoch: HummockReadEpoch, options: NewReadSnapshotOptions, ) -> impl StorageFuture<'_, Self::ReadSnapshot>

Source

fn new_vector_writer( &self, options: NewVectorWriterOptions, ) -> impl Future<Output = Self::VectorWriter> + Send + '_

Provided Methods§

Source

fn monitored( self, storage_metrics: Arc<MonitoredStorageMetrics>, ) -> MonitoredStateStore<Self>

Creates a MonitoredStateStore from this state store, with given stats.

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.

Implementors§

Source§

impl StateStore for HummockStorage

Source§

impl StateStore for PanicStateStore

Source§

impl StateStore for StateStorePointer<Arc<dyn DynStateStore>>

Source§

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

Source§

impl<R: RangeKv> StateStore for RangeKvStateStore<R>

Source§

impl<S: StateStore> StateStore for MonitoredStateStore<S>