org.apache.zookeeper.server.quorum
Class LeaderElection
java.lang.Object
org.apache.zookeeper.server.quorum.LeaderElection
- All Implemented Interfaces:
- Election
public class LeaderElection
- extends Object
- implements Election
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
epochGen
protected static Random epochGen
self
protected QuorumPeer self
LeaderElection
public LeaderElection(QuorumPeer self)
countVotes
protected LeaderElection.ElectionResult countVotes(HashMap<InetSocketAddress,Vote> votes,
HashSet<Long> heardFrom)
shutdown
public void shutdown()
- There is nothing to shutdown in this implementation of
leader election, so we simply have an empty method.
- Specified by:
shutdown
in interface Election
lookForLeader
public Vote lookForLeader()
throws InterruptedException
- Invoked in QuorumPeer to find or elect a new leader.
- Specified by:
lookForLeader
in interface Election
- Throws:
InterruptedException
Copyright © 2012 The Apache Software Foundation