mssf_core::runtime::stateful

Trait LocalReplicator

source
pub trait LocalReplicator:
    Send
    + Sync
    + 'static {
    // Required methods
    async fn open(
        &self,
        cancellation_token: CancellationToken,
    ) -> Result<HSTRING>;
    async fn close(&self, cancellation_token: CancellationToken) -> Result<()>;
    async fn change_role(
        &self,
        epoch: &Epoch,
        role: &ReplicaRole,
        cancellation_token: CancellationToken,
    ) -> Result<()>;
    async fn update_epoch(
        &self,
        epoch: &Epoch,
        cancellation_token: CancellationToken,
    ) -> Result<()>;
    fn get_current_progress(&self) -> Result<i64>;
    fn get_catch_up_capability(&self) -> Result<i64>;
    fn abort(&self);
}
Expand description

TODO: replicator has no public documentation

Required Methods§

source

async fn open(&self, cancellation_token: CancellationToken) -> Result<HSTRING>

source

async fn close(&self, cancellation_token: CancellationToken) -> Result<()>

source

async fn change_role( &self, epoch: &Epoch, role: &ReplicaRole, cancellation_token: CancellationToken, ) -> Result<()>

source

async fn update_epoch( &self, epoch: &Epoch, cancellation_token: CancellationToken, ) -> Result<()>

(TODO: This doc is from IStateProvider but not Replicator.) Indicates to a replica that the configuration of a replica set has changed due to a change or attempted change to the primary replica. The change occurs due to failure or load balancing of the previous primary replica. Epoch changes act as a barrier by segmenting operations into the exact configuration periods in which they were sent by a specific primary replica.

Called only on active secondary replicas. Primary replica gets new epoch via change_role call.

source

fn get_current_progress(&self) -> Result<i64>

source

fn get_catch_up_capability(&self) -> Result<i64>

source

fn abort(&self)

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<TraitVariantBlanketType: Replicator> LocalReplicator for TraitVariantBlanketType