|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.zookeeper.server.quorum.FastLeaderElection
public class FastLeaderElection
Implementation of leader election using TCP. It uses an object of the class QuorumCnxManager to manage connections. Otherwise, the algorithm is push-based as with the other UDP implementations. There are a few parameters that can be tuned to change its behavior. First, finalizeWait determines the amount of time to wait until deciding upon a leader. This is part of the leader election algorithm.
| Nested Class Summary | |
|---|---|
static class |
FastLeaderElection.Notification
Notifications are messages that let other peers know that a given peer has changed its vote, either because it has joined leader election or because it learned of another peer with higher zxid or same zxid and higher server id |
static class |
FastLeaderElection.ToSend
Messages that a peer wants to send to other peers. |
| Constructor Summary | |
|---|---|
FastLeaderElection(QuorumPeer self,
QuorumCnxManager manager)
Constructor of FastLeaderElection. |
|
| Method Summary | |
|---|---|
QuorumCnxManager |
getCnxManager()
|
long |
getLogicalClock()
Returns the current vlue of the logical clock counter |
Vote |
lookForLeader()
Starts a new round of leader election. |
void |
shutdown()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FastLeaderElection(QuorumPeer self,
QuorumCnxManager manager)
self - QuorumPeer that created this objectmanager - Connection manager| Method Detail |
|---|
public long getLogicalClock()
public QuorumCnxManager getCnxManager()
public void shutdown()
shutdown in interface Election
public Vote lookForLeader()
throws InterruptedException
lookForLeader in interface ElectionInterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||