Class DeletionListener
java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKListener
org.apache.hadoop.hbase.zookeeper.DeletionListener
A ZooKeeper watcher meant to detect deletions of ZNodes.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final CountDownLatch
private Throwable
private static final org.slf4j.Logger
private final String
Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZKListener
watcher
-
Constructor Summary
ConstructorDescriptionDeletionListener
(ZKWatcher zkWatcher, String pathToWatch, CountDownLatch deletedLatch) Create a new instance of the deletion watcher. -
Method Summary
Modifier and TypeMethodDescriptionGet the last exception which has occurred when re-setting the watch.boolean
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 deletedMethods inherited from class org.apache.hadoop.hbase.zookeeper.ZKListener
getWatcher, nodeChildrenChanged, nodeCreated
-
Field Details
-
LOG
-
pathToWatch
-
deletedLatch
-
exception
-
-
Constructor Details
-
DeletionListener
Create a new instance of the deletion watcher.- Parameters:
zkWatcher
- ZookeeperWatcher instancepathToWatch
- (Fully qualified) ZNode path that we are waiting to be deleted.deletedLatch
- Count down on this latch when deletion has occurred.
-
-
Method Details
-
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
Description copied from class:ZKListener
Called when an existing node has changed data.- Overrides:
nodeDataChanged
in classZKListener
- Parameters:
path
- full path of the updated node
-
nodeDeleted
Description copied from class:ZKListener
Called when a node has been deleted- Overrides:
nodeDeleted
in classZKListener
- Parameters:
path
- full path of the deleted node
-