Class DeletionListener

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

@Private public class DeletionListener extends ZKListener
A ZooKeeper watcher meant to detect deletions of ZNodes.
  • Field Details

  • Constructor Details

    • DeletionListener

      public DeletionListener(ZKWatcher zkWatcher, String pathToWatch, CountDownLatch deletedLatch)
      Create a new instance of the deletion watcher.
      Parameters:
      zkWatcher - ZookeeperWatcher instance
      pathToWatch - (Fully qualified) ZNode path that we are waiting to be deleted.
      deletedLatch - Count down on this latch when deletion has occurred.
  • Method Details

    • hasException

      public boolean hasException()
      Check if an exception has occurred when re-setting the watch.
      Returns:
      True if we were unable to re-set a watch on a ZNode due to an exception.
    • getException

      Get the last exception which has occurred when re-setting the watch. Use hasException() to check whether or not an exception has occurred.
      Returns:
      The last exception observed when re-setting the watch.
    • nodeDataChanged

      public void nodeDataChanged(String path)
      Description copied from class: ZKListener
      Called when an existing node has changed data.
      Overrides:
      nodeDataChanged in class ZKListener
      Parameters:
      path - full path of the updated node
    • nodeDeleted

      public void nodeDeleted(String path)
      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