private boolean termPredicate(HashMap<Long, Vote> votes, Vote vote) { //
SyncedLearnerTracker voteSet = new SyncedLearnerTracker();
voteSet.addQuorumVerifier(self.getQuorumVerifier());//
if (self.getLastSeenQuorumVerifier() != null
&& self.getLastSeenQuorumVerifier().getVersion() > self //LastSeenQuorumVerifierversionversion(member)
.getQuorumVerifier().getVersion()) {
voteSet.addQuorumVerifier(self.getLastSeenQuorumVerifier());//LastSeenQuorumVerifier
}
/*
* First make the views consistent. Sometimes peers will have different
* zxids for a server depending on timing.
*/
for (Map.Entry<Long, Vote> entry : votes.entrySet()) {//
if (vote.equals(entry.getValue())) {//voter
voteSet.addAck(entry.getKey());
}
}
return voteSet.hasAllQuorums();//
}
Why does zk need two voting devices to determine the end of the vote?
//last committed quorum verifier
public QuorumVerifier quorumVerifier;
//last proposed quorum verifier ()
public QuorumVerifier lastSeenQuorumVerifier = null; //