org.apache.hadoop.hbase.zookeeper
Class DeletionListener

java.lang.Object
  extended by org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
      extended by org.apache.hadoop.hbase.zookeeper.DeletionListener

@InterfaceAudience.Private
public class DeletionListener
extends ZooKeeperListener

A ZooKeeper watcher meant to detect deletions of ZNodes.


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
watcher
 
Constructor Summary
DeletionListener(ZooKeeperWatcher zkWatcher, String pathToWatch, CountDownLatch deletedLatch)
          Create a new instance of the deletion watcher.
 
Method Summary
 Throwable getException()
          Get the last exception which has occurred when re-setting the watch.
 boolean hasException()
          Check if an exception has occurred when re-setting the watch.
 void nodeDataChanged(String path)
          Called when an existing node has changed data.
 void nodeDeleted(String path)
          Called when a node has been deleted
 
Methods inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
getWatcher, nodeChildrenChanged, nodeCreated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeletionListener

public DeletionListener(ZooKeeperWatcher 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 occured.
Method Detail

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

public Throwable 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: ZooKeeperListener
Called when an existing node has changed data.

Overrides:
nodeDataChanged in class ZooKeeperListener
Parameters:
path - full path of the updated node

nodeDeleted

public void nodeDeleted(String path)
Description copied from class: ZooKeeperListener
Called when a node has been deleted

Overrides:
nodeDeleted in class ZooKeeperListener
Parameters:
path - full path of the deleted node


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.