Class ZKLeaderManager

java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKListener
org.apache.hadoop.hbase.zookeeper.ZKLeaderManager

@Deprecated @Private public class ZKLeaderManager extends ZKListener
Deprecated.
Not used
Handles coordination of a single "leader" instance among many possible candidates. The first ZKLeaderManager to successfully create the given znode becomes the leader, allowing the instance to continue with whatever processing must be protected. Other ZKLeaderManager instances will wait to be notified of changes to the leader znode. If the current master instance fails, the ephemeral leader znode will be removed, and all waiting instances will be notified, with the race to claim the leader znode beginning all over again.
  • Field Details

  • Constructor Details

  • Method Details

    • start

      public void start()
      Deprecated.
    • nodeCreated

      public void nodeCreated(String path)
      Deprecated.
      Description copied from class: ZKListener
      Called when a new node has been created.
      Overrides:
      nodeCreated in class ZKListener
      Parameters:
      path - full path of the new node
    • nodeDeleted

      public void nodeDeleted(String path)
      Deprecated.
      Description copied from class: ZKListener
      Called when a node has been deleted
      Overrides:
      nodeDeleted in class ZKListener
      Parameters:
      path - full path of the deleted node
    • handleLeaderChange

      private void handleLeaderChange()
      Deprecated.
    • waitToBecomeLeader

      public void waitToBecomeLeader()
      Deprecated.
      Blocks until this instance has claimed the leader ZNode in ZooKeeper
    • stepDownAsLeader

      public void stepDownAsLeader()
      Deprecated.
      Removes the leader znode, if it is currently claimed by this instance.
    • hasLeader

      public boolean hasLeader()
      Deprecated.