Class AuditorElector

  • @StatsDoc(name="auditor",
              help="Auditor related stats")
    public class AuditorElector
    extends java.lang.Object
    Performing auditor election using Apache ZooKeeper. Using ZooKeeper as a coordination service, when a bookie bids for auditor, it creates an ephemeral sequential file (znode) on ZooKeeper and considered as their vote. Vote format is 'V_sequencenumber'. Election will be done by comparing the ephemeral sequential numbers and the bookie which has created the least znode will be elected as Auditor. All the other bookies will be watching on their predecessor znode according to the ephemeral sequence numbers.
    • Field Detail

      • shutdownTask

        java.lang.Runnable shutdownTask
    • Method Detail

      • start

        public java.util.concurrent.Future<?> start()
      • submitElectionTask

        java.util.concurrent.Future<?> submitElectionTask()
        Performing the auditor election using the ZooKeeper ephemeral sequential znode. The bookie which has created the least sequential will be elect as Auditor.
      • getCurrentAuditor

        public BookieId getCurrentAuditor()
      • shutdown

        public void shutdown()
                      throws java.lang.InterruptedException
        Shutting down AuditorElector.
      • isRunning

        public boolean isRunning()
        If current bookie is running as auditor, return the status of the auditor. Otherwise return the status of elector.
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object