Class QuorumVoteServerConnect
- java.lang.Object
-
- org.apache.activemq.artemis.core.server.cluster.qourum.QuorumVote<ServerConnectVote,Boolean>
-
- org.apache.activemq.artemis.core.server.cluster.qourum.QuorumVoteServerConnect
-
public class QuorumVoteServerConnect extends QuorumVote<ServerConnectVote,Boolean>
A Quorum Vote for deciding if a replicated backup should become live.
-
-
Field Summary
Fields Modifier and Type Field Description static SimpleStringLIVE_FAILOVER_VOTE
-
Constructor Summary
Constructors Constructor Description QuorumVoteServerConnect(int size, String targetNodeId)QuorumVoteServerConnect(int size, String targetNodeId, boolean requestToStayLive, String liveConnector)live nodes | remaining nodes | majority | votes needed 1 | 0 | 0 | 0 2 | 1 | 1 | 1 n | r = n-1 | n/2 + 1 | n/2 + 1 rounded 3 | 2 | 2.5 | 2 4 | 3 | 3 | 3 5 | 4 | 3.5 | 3 6 | 5 | 4 | 4
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidallVotesCast(Topology voteTopology)called by theQuorumManagerwhen all the votes have been cast and received.voidawait(int latchTimeout, TimeUnit unit)Voteconnected()if we can connect to a nodeBooleangetDecision()get the decion of the votebooleanisRequestToStayLive()VotenotConnected()if we cant connect to the nodevoidvote(ServerConnectVote vote)live nodes | remaining nodes | majority | votes needed 1 | 0 | 0 | 0 2 | 1 | 1 | 1 n | r = n-1 | n/2 + 1 | n/2 + 1 rounded 3 | 2 | 2.5 | 2 4 | 3 | 3 | 3 5 | 4 | 3.5 | 3 6 | 5 | 4 | 4-
Methods inherited from class org.apache.activemq.artemis.core.server.cluster.qourum.QuorumVote
getName
-
-
-
-
Field Detail
-
LIVE_FAILOVER_VOTE
public static final SimpleString LIVE_FAILOVER_VOTE
-
-
Constructor Detail
-
QuorumVoteServerConnect
public QuorumVoteServerConnect(int size, String targetNodeId, boolean requestToStayLive, String liveConnector)live nodes | remaining nodes | majority | votes needed 1 | 0 | 0 | 0 2 | 1 | 1 | 1 n | r = n-1 | n/2 + 1 | n/2 + 1 rounded 3 | 2 | 2.5 | 2 4 | 3 | 3 | 3 5 | 4 | 3.5 | 3 6 | 5 | 4 | 4
-
QuorumVoteServerConnect
public QuorumVoteServerConnect(int size, String targetNodeId)
-
-
Method Detail
-
connected
public Vote connected()
if we can connect to a node- Specified by:
connectedin classQuorumVote<ServerConnectVote,Boolean>- Returns:
-
notConnected
public Vote notConnected()
if we cant connect to the node- Specified by:
notConnectedin classQuorumVote<ServerConnectVote,Boolean>- Returns:
-
vote
public void vote(ServerConnectVote vote)
live nodes | remaining nodes | majority | votes needed 1 | 0 | 0 | 0 2 | 1 | 1 | 1 n | r = n-1 | n/2 + 1 | n/2 + 1 rounded 3 | 2 | 2.5 | 2 4 | 3 | 3 | 3 5 | 4 | 3.5 | 3 6 | 5 | 4 | 4- Specified by:
votein classQuorumVote<ServerConnectVote,Boolean>- Parameters:
vote- the vote to make.
-
allVotesCast
public void allVotesCast(Topology voteTopology)
Description copied from class:QuorumVotecalled by theQuorumManagerwhen all the votes have been cast and received.- Specified by:
allVotesCastin classQuorumVote<ServerConnectVote,Boolean>- Parameters:
voteTopology- the topology of where the votes were sent.
-
getDecision
public Boolean getDecision()
Description copied from class:QuorumVoteget the decion of the vote- Specified by:
getDecisionin classQuorumVote<ServerConnectVote,Boolean>- Returns:
- the voting decision
-
await
public void await(int latchTimeout, TimeUnit unit) throws InterruptedException- Throws:
InterruptedException
-
isRequestToStayLive
public boolean isRequestToStayLive()
-
-