pub struct PersistenceContext<E, J, S, M>where
E: StateEngine + 'static,
J: BlockJournal + 'static,
S: Snapshotter + 'static,
M: MetadataStore + 'static,{ /* private fields */ }Expand description
Aggregates persistence-related state shared between the orchestrator and the runtime.
Implementations§
Source§impl<E, J, S, M> PersistenceContext<E, J, S, M>where
E: StateEngine + 'static,
J: BlockJournal + 'static,
S: Snapshotter + 'static,
M: MetadataStore + 'static,
impl<E, J, S, M> PersistenceContext<E, J, S, M>where
E: StateEngine + 'static,
J: BlockJournal + 'static,
S: Snapshotter + 'static,
M: MetadataStore + 'static,
pub fn new( state_engine: Arc<E>, journal: Arc<J>, snapshotter: Arc<S>, metadata: Arc<M>, update_mutex: Arc<Mutex<()>>, settings: &PersistenceSettings, ) -> StoreResult<Self>
pub fn metrics(&self) -> &StoreMetrics
pub fn pending_blocks(&self) -> &PendingBlocks
pub fn durable_block_height(&self) -> BlockId
pub fn durable_block_tracker(&self) -> Arc<AtomicU64>
pub fn applied_block_height(&self) -> BlockId
pub fn set_applied_block(&self, block_height: BlockId)
pub fn set_durable_block(&self, block_height: BlockId)
pub fn rollback_barrier(&self) -> &Arc<AtomicU64>
pub fn set_rollback_barrier(&self, block_height: BlockId)
pub fn update_key_count(&self, total_keys: usize)
pub fn is_async(&self) -> bool
pub fn enqueue(&self, task: Arc<PersistenceTask>) -> StoreResult<()>
pub fn set_metadata_sync_interval( &self, sync_every_n_blocks: usize, ) -> StoreResult<()>
pub fn cancel_after(&self, block_height: BlockId) -> Vec<Arc<PersistenceTask>>
pub fn discard_pending_metadata_after(&self, block_height: BlockId)
pub fn flush_pending_metadata_through( &self, block_height: BlockId, ) -> StoreResult<()>
pub fn flush(&self) -> StoreResult<()>
pub fn enforce_snapshot_freshness(&self) -> StoreResult<()>
pub fn shutdown(&self) -> StoreResult<()>
pub fn fatal_error(&self) -> Option<StoreError>
pub fn ensure_healthy(&self) -> StoreResult<()>
Auto Trait Implementations§
impl<E, J, S, M> Freeze for PersistenceContext<E, J, S, M>
impl<E, J, S, M> !RefUnwindSafe for PersistenceContext<E, J, S, M>
impl<E, J, S, M> Send for PersistenceContext<E, J, S, M>
impl<E, J, S, M> Sync for PersistenceContext<E, J, S, M>
impl<E, J, S, M> Unpin for PersistenceContext<E, J, S, M>
impl<E, J, S, M> !UnwindSafe for PersistenceContext<E, J, S, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more