public class DesignatedPrimaryProvider extends Object implements ArbiterProvider
The user is responsible for ensuring that only one node at any time is annointed as the designated primary. There is some sanity checking that designated primary is only set by one node by master/replica syncups. The parameter is mutable.
| Modifier and Type | Method and Description |
|---|---|
boolean |
activationPossible()
Return true if this node is in a 2-node group and is configured as the
Designated Primary, and is therefore capable of entering active
arbitration.
|
boolean |
attemptActivation()
Try to activate this node as a Primary, if it has been configured as
such and if the group size is two.
|
void |
endArbitration()
No cleannup is needed when exiting designated primary arbitration.
|
int |
getAckCount(Durability.ReplicaAckPolicy ackPolicy)
Always returns 0, no replica acks are needed when acting under
designated primary arbitration.
|
int |
getElectionQuorumSize(QuorumPolicy quorumPolicy)
When operating under designated primary arbitration, the election quorum
is 1 for a group with electable group size of 2,
|
boolean |
shouldEndArbitration(ReplicationMutableConfig newConfig)
Return true if this node is no longer configured as the designated
primary under the new configuration.
|
public boolean attemptActivation()
attemptActivation in interface ArbiterProviderpublic boolean activationPossible()
activationPossible in interface ArbiterProviderpublic void endArbitration()
endArbitration in interface ArbiterProviderpublic int getElectionQuorumSize(QuorumPolicy quorumPolicy)
getElectionQuorumSize in interface ArbiterProviderpublic int getAckCount(Durability.ReplicaAckPolicy ackPolicy)
getAckCount in interface ArbiterProviderpublic boolean shouldEndArbitration(ReplicationMutableConfig newConfig)
shouldEndArbitration in interface ArbiterProviderCopyright © 2024. All rights reserved.