Class LeaderElection

  • All Implemented Interfaces:
    Election

    @Deprecated
    public class LeaderElection
    extends java.lang.Object
    implements Election
    Deprecated.
    This class has been deprecated as of release 3.4.0.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.util.Random epochGen
      Deprecated.
       
      protected QuorumPeer self
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected LeaderElection.ElectionResult countVotes​(java.util.HashMap<java.net.InetSocketAddress,​Vote> votes, java.util.HashSet<java.lang.Long> heardFrom)
      Deprecated.
       
      Vote lookForLeader()
      Deprecated.
      Invoked in QuorumPeer to find or elect a new leader.
      void shutdown()
      Deprecated.
      There is nothing to shutdown in this implementation of leader election, so we simply have an empty method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • epochGen

        protected static final java.util.Random epochGen
        Deprecated.
    • Constructor Detail

      • LeaderElection

        public LeaderElection​(QuorumPeer self)
        Deprecated.
    • Method Detail

      • countVotes

        protected LeaderElection.ElectionResult countVotes​(java.util.HashMap<java.net.InetSocketAddress,​Vote> votes,
                                                           java.util.HashSet<java.lang.Long> heardFrom)
        Deprecated.
      • shutdown

        public void shutdown()
        Deprecated.
        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 java.lang.InterruptedException
        Deprecated.
        Invoked in QuorumPeer to find or elect a new leader.
        Specified by:
        lookForLeader in interface Election
        Throws:
        java.lang.InterruptedException