Trait StateStore

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§

type Local: LocalStateStore

type ReadSnapshot: StateStoreRead + StateStoreReadVector + Clone

type VectorWriter: StateStoreWriteVector

Required Methods§

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.

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 Methods§

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§

§

impl StateStore for HummockStorage

§

type Local = LocalHummockStorage

§

type ReadSnapshot = HummockStorageReadSnapshot

§

type VectorWriter = PanicStateStore

§

impl StateStore for PanicStateStore

§

type Local = PanicStateStore

§

type ReadSnapshot = PanicStateStore

§

type VectorWriter = PanicStateStore

§

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

§

type Local = VerifyStateStore<<A as StateStore>::Local, <E as StateStore>::Local>

§

type ReadSnapshot = VerifyStateStore<<A as StateStore>::ReadSnapshot, <E as StateStore>::ReadSnapshot>

§

type VectorWriter = <A as StateStore>::VectorWriter

§

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

§

type Local = RangeKvLocalStateStore<R>

§

type ReadSnapshot = RangeKvStateStoreReadSnapshot<R>

§

type VectorWriter = RangeKvLocalStateStore<R>

§

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

§

type Local = MonitoredStateStore<<S as StateStore>::Local, TableId>

§

type ReadSnapshot = MonitoredStateStore<<S as StateStore>::ReadSnapshot, TableId>

§

type VectorWriter = MonitoredStateStore<<S as StateStore>::VectorWriter, TableId>