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)
           
 void nodeDeleted(String path)
           
 
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)
Overrides:
nodeDataChanged in class ZooKeeperListener

nodeDeleted

public void nodeDeleted(String path)
Overrides:
nodeDeleted in class ZooKeeperListener


Copyright © 2007-2015 The Apache Software Foundation. All Rights Reserved.