pub struct PrimaryReplicatorProxy { /* private fields */ }
Implementations§
Source§impl PrimaryReplicatorProxy
impl PrimaryReplicatorProxy
pub fn new(com_impl: IFabricPrimaryReplicator) -> PrimaryReplicatorProxy
Trait Implementations§
Source§impl PrimaryReplicator for PrimaryReplicatorProxy
impl PrimaryReplicator for PrimaryReplicatorProxy
async fn on_data_loss(&self, cancellation_token: BoxedCancelToken) -> Result<u8>
Source§fn update_catch_up_replica_set_configuration(
&self,
currentconfiguration: &ReplicaSetConfig,
previousconfiguration: &ReplicaSetConfig,
) -> Result<()>
fn update_catch_up_replica_set_configuration( &self, currentconfiguration: &ReplicaSetConfig, previousconfiguration: &ReplicaSetConfig, ) -> Result<()>
Informs the replicator there there is a current configuration and a previous configuration.
Called on primary to inform the set of active secondary replicas that may
begin to catchup. Idle secondary replicas are not included here. Read more
Source§async fn wait_for_catch_up_quorum(
&self,
catchupmode: ReplicaSetQuorumMode,
cancellation_token: BoxedCancelToken,
) -> Result<()>
async fn wait_for_catch_up_quorum( &self, catchupmode: ReplicaSetQuorumMode, cancellation_token: BoxedCancelToken, ) -> Result<()>
Called on primary to wait for replicas to catch up, before
accepting writes. Read more
Source§fn update_current_replica_set_configuration(
&self,
currentconfiguration: &ReplicaSetConfig,
) -> Result<()>
fn update_current_replica_set_configuration( &self, currentconfiguration: &ReplicaSetConfig, ) -> Result<()>
Informs the replicator about the current replica set configuration, and there
is no longer a previous configuration.
Remarks:
Replicas here are not marked as must_catchup.
Source§async fn build_replica(
&self,
replica: &ReplicaInformation,
cancellation_token: BoxedCancelToken,
) -> Result<()>
async fn build_replica( &self, replica: &ReplicaInformation, cancellation_token: BoxedCancelToken, ) -> Result<()>
Transferring state up to the current quorum LSN to a new or existing replica
that is outside the current configuration. (not included in update_catch_up_replica_set_configuration) Read more
Source§fn remove_replica(&self, replicaid: i64) -> Result<()>
fn remove_replica(&self, replicaid: i64) -> Result<()>
Notifies primary that an idle replica built by build_replica() api call
has gone down and replicator should not send more operations to that replica
and should release all resources.
Remarks:
Removing replicas already in the partition, update_catch_up_replica_set_configuration
is called instead with ReplicaSetConfig not containng the to be removed replica.
SF does not call remove_replica on the replica where build_replica is still running.
Source§impl Replicator for PrimaryReplicatorProxy
impl Replicator for PrimaryReplicatorProxy
Source§async fn open(&self, cancellation_token: BoxedCancelToken) -> Result<WString>
async fn open(&self, cancellation_token: BoxedCancelToken) -> Result<WString>
Opens replicator, and returns the replicator address that is visible to primary
in ReplicaInformation.
Remarks:
Replicator does not have an assigned role yet and should setup listening endpoint.
async fn close(&self, cancellation_token: BoxedCancelToken) -> Result<()>
Source§async fn change_role(
&self,
epoch: &Epoch,
role: &ReplicaRole,
cancellation_token: BoxedCancelToken,
) -> Result<()>
async fn change_role( &self, epoch: &Epoch, role: &ReplicaRole, cancellation_token: BoxedCancelToken, ) -> Result<()>
Change the replicator role. Read more
Source§async fn update_epoch(
&self,
epoch: &Epoch,
cancellation_token: BoxedCancelToken,
) -> Result<()>
async fn update_epoch( &self, epoch: &Epoch, cancellation_token: BoxedCancelToken, ) -> 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. Read more
Source§fn get_current_progress(&self) -> Result<i64>
fn get_current_progress(&self) -> Result<i64>
Get the current LSN, end of log, called on secondaries.
SF uses this to do primary selection. It is also passed to update_catch_up_replica_set_configuration()
on primary. Primary uses this for catchup.
Source§fn get_catch_up_capability(&self) -> Result<i64>
fn get_catch_up_capability(&self) -> Result<i64>
Get the first LSN, beginning of log.
Remarks:
SF uses this to determine if other replicas can catch up from this replica.
Other replica’s end of log must be higher than this replica’s beginning of log
in order for the other replica to catchup, otherwise SF needs to drop the other
replica (if the current replica is chosen to be primary).
fn abort(&self)
Auto Trait Implementations§
impl Freeze for PrimaryReplicatorProxy
impl RefUnwindSafe for PrimaryReplicatorProxy
impl Send for PrimaryReplicatorProxy
impl Sync for PrimaryReplicatorProxy
impl Unpin for PrimaryReplicatorProxy
impl UnwindSafe for PrimaryReplicatorProxy
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<TraitVariantBlanketType> LocalPrimaryReplicator for TraitVariantBlanketTypewhere
TraitVariantBlanketType: PrimaryReplicator,
impl<TraitVariantBlanketType> LocalPrimaryReplicator for TraitVariantBlanketTypewhere
TraitVariantBlanketType: PrimaryReplicator,
async fn on_data_loss( &self, cancellation_token: Box<dyn CancelToken>, ) -> Result<u8, Error>
Source§fn update_catch_up_replica_set_configuration(
&self,
currentconfiguration: &ReplicaSetConfig,
previousconfiguration: &ReplicaSetConfig,
) -> Result<(), Error>
fn update_catch_up_replica_set_configuration( &self, currentconfiguration: &ReplicaSetConfig, previousconfiguration: &ReplicaSetConfig, ) -> Result<(), Error>
Informs the replicator there there is a current configuration and a previous configuration.
Called on primary to inform the set of active secondary replicas that may
begin to catchup. Idle secondary replicas are not included here. Read more
Source§fn update_current_replica_set_configuration(
&self,
currentconfiguration: &ReplicaSetConfig,
) -> Result<(), Error>
fn update_current_replica_set_configuration( &self, currentconfiguration: &ReplicaSetConfig, ) -> Result<(), Error>
Informs the replicator about the current replica set configuration, and there
is no longer a previous configuration.
Remarks:
Replicas here are not marked as must_catchup.
Source§async fn wait_for_catch_up_quorum(
&self,
catchupmode: ReplicaSetQuorumMode,
cancellation_token: Box<dyn CancelToken>,
) -> Result<(), Error>
async fn wait_for_catch_up_quorum( &self, catchupmode: ReplicaSetQuorumMode, cancellation_token: Box<dyn CancelToken>, ) -> Result<(), Error>
Called on primary to wait for replicas to catch up, before
accepting writes. Read more
Source§async fn build_replica(
&self,
replica: &ReplicaInformation,
cancellation_token: Box<dyn CancelToken>,
) -> Result<(), Error>
async fn build_replica( &self, replica: &ReplicaInformation, cancellation_token: Box<dyn CancelToken>, ) -> Result<(), Error>
Transferring state up to the current quorum LSN to a new or existing replica
that is outside the current configuration. (not included in update_catch_up_replica_set_configuration) Read more
Source§fn remove_replica(&self, replicaid: i64) -> Result<(), Error>
fn remove_replica(&self, replicaid: i64) -> Result<(), Error>
Notifies primary that an idle replica built by build_replica() api call
has gone down and replicator should not send more operations to that replica
and should release all resources.
Remarks:
Removing replicas already in the partition, update_catch_up_replica_set_configuration
is called instead with ReplicaSetConfig not containng the to be removed replica.
SF does not call remove_replica on the replica where build_replica is still running.
Source§impl<TraitVariantBlanketType> LocalReplicator for TraitVariantBlanketTypewhere
TraitVariantBlanketType: Replicator,
impl<TraitVariantBlanketType> LocalReplicator for TraitVariantBlanketTypewhere
TraitVariantBlanketType: Replicator,
Source§async fn open(
&self,
cancellation_token: Box<dyn CancelToken>,
) -> Result<WString, Error>
async fn open( &self, cancellation_token: Box<dyn CancelToken>, ) -> Result<WString, Error>
Opens replicator, and returns the replicator address that is visible to primary
in ReplicaInformation.
Remarks:
Replicator does not have an assigned role yet and should setup listening endpoint.
async fn close( &self, cancellation_token: Box<dyn CancelToken>, ) -> Result<(), Error>
Source§async fn change_role(
&self,
epoch: &Epoch,
role: &ReplicaRole,
cancellation_token: Box<dyn CancelToken>,
) -> Result<(), Error>
async fn change_role( &self, epoch: &Epoch, role: &ReplicaRole, cancellation_token: Box<dyn CancelToken>, ) -> Result<(), Error>
Change the replicator role. Read more
Source§async fn update_epoch(
&self,
epoch: &Epoch,
cancellation_token: Box<dyn CancelToken>,
) -> Result<(), Error>
async fn update_epoch( &self, epoch: &Epoch, cancellation_token: Box<dyn CancelToken>, ) -> Result<(), Error>
(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. Read more
Source§fn get_current_progress(&self) -> Result<i64, Error>
fn get_current_progress(&self) -> Result<i64, Error>
Get the current LSN, end of log, called on secondaries.
SF uses this to do primary selection. It is also passed to update_catch_up_replica_set_configuration()
on primary. Primary uses this for catchup.
Source§fn get_catch_up_capability(&self) -> Result<i64, Error>
fn get_catch_up_capability(&self) -> Result<i64, Error>
Get the first LSN, beginning of log.
Remarks:
SF uses this to determine if other replicas can catch up from this replica.
Other replica’s end of log must be higher than this replica’s beginning of log
in order for the other replica to catchup, otherwise SF needs to drop the other
replica (if the current replica is chosen to be primary).