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
FieldsModifier and TypeFieldDescriptionprivate final CountDownLatchprivate Throwableprivate static final org.slf4j.Loggerprivate final StringFields inherited from class org.apache.hadoop.hbase.zookeeper.ZKListener
watcher -
Constructor Summary
ConstructorsConstructorDescriptionDeletionListener(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.booleanCheck if an exception has occurred when re-setting the watch.voidnodeDataChanged(String path) Called when an existing node has changed data.voidnodeDeleted(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:ZKListenerCalled when an existing node has changed data.- Overrides:
nodeDataChangedin classZKListener- Parameters:
path- full path of the updated node
-
nodeDeleted
Description copied from class:ZKListenerCalled when a node has been deleted- Overrides:
nodeDeletedin classZKListener- Parameters:
path- full path of the deleted node
-