public class FastLeaderElection extends java.lang.Object implements Election
Modifier and Type | Class and Description |
---|---|
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 and Description |
---|
FastLeaderElection(QuorumPeer self,
QuorumCnxManager manager)
Constructor of FastLeaderElection.
|
Modifier and Type | Method and Description |
---|---|
QuorumCnxManager |
getCnxManager() |
long |
getLogicalClock()
Returns the current vlue of the logical clock counter
|
Vote |
lookForLeader()
Starts a new round of leader election.
|
void |
shutdown() |
public FastLeaderElection(QuorumPeer self, QuorumCnxManager manager)
self
- QuorumPeer that created this objectmanager
- Connection managerpublic long getLogicalClock()
public QuorumCnxManager getCnxManager()
public Vote lookForLeader() throws java.lang.InterruptedException
lookForLeader
in interface Election
java.lang.InterruptedException
Copyright © 2016 The Apache Software Foundation