public class QuorumVoteServerConnect extends QuorumVote<BooleanVote,Boolean>
Constructor and Description |
---|
QuorumVoteServerConnect(int size,
StorageManager storageManager)
vote the remaining nodes not including ourself., so
1 remaining nodes would be 0/2 = 0 vote needed
2 remaining nodes would be 1/2 = 0 vote needed
3 remaining nodes would be 2/2 = 1 vote needed
4 remaining nodes would be 3/2 = 2 vote needed
5 remaining nodes would be 4/2 = 3 vote needed
6 remaining nodes would be 5/2 = 3 vote needed
|
Modifier and Type | Method and Description |
---|---|
void |
allVotesCast(Topology voteTopology)
called by the
QuorumManager when all the votes have been cast and received. |
void |
await(int latchTimeout,
TimeUnit unit) |
Vote |
connected()
if we can connect to a node
|
Boolean |
getDecision()
get the decion of the vote
|
SimpleString |
getName()
the name of this quorum vote, used for identifying the correct
QuorumVoteHandler |
Vote |
notConnected()
if we cant connect to the node
|
void |
vote(BooleanVote vote)
vote the remaining nodes not including ourself., so
1 remaining nodes would be 0/2 = 0 vote needed
2 remaining nodes would be 1/2 = 0 vote needed
3 remaining nodes would be 2/2 = 1 vote needed
4 remaining nodes would be 3/2 = 2 vote needed
5 remaining nodes would be 4/2 = 3 vote needed
6 remaining nodes would be 5/2 = 3 vote needed
|
public QuorumVoteServerConnect(int size, StorageManager storageManager)
public Vote connected()
connected
in class QuorumVote<BooleanVote,Boolean>
public Vote notConnected()
notConnected
in class QuorumVote<BooleanVote,Boolean>
public void vote(BooleanVote vote)
vote
in class QuorumVote<BooleanVote,Boolean>
vote
- the vote to make.public void allVotesCast(Topology voteTopology)
QuorumVote
QuorumManager
when all the votes have been cast and received.allVotesCast
in class QuorumVote<BooleanVote,Boolean>
voteTopology
- the topology of where the votes were sent.public Boolean getDecision()
QuorumVote
getDecision
in class QuorumVote<BooleanVote,Boolean>
public SimpleString getName()
QuorumVote
QuorumVoteHandler
getName
in class QuorumVote<BooleanVote,Boolean>
public void await(int latchTimeout, TimeUnit unit) throws InterruptedException
InterruptedException
Copyright © 2016 The Apache Software Foundation. All rights reserved.