@InterfaceAudience.Private public class DeletionListener extends ZKListener
Modifier and Type | Field and Description |
---|---|
private CountDownLatch |
deletedLatch |
private Throwable |
exception |
private static org.slf4j.Logger |
LOG |
private String |
pathToWatch |
watcher
Constructor and Description |
---|
DeletionListener(ZKWatcher zkWatcher,
String pathToWatch,
CountDownLatch deletedLatch)
Create a new instance of the deletion watcher.
|
Modifier and Type | Method and Description |
---|---|
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
|
getWatcher, nodeChildrenChanged, nodeCreated
private static final org.slf4j.Logger LOG
private final String pathToWatch
private final CountDownLatch deletedLatch
public DeletionListener(ZKWatcher zkWatcher, String pathToWatch, CountDownLatch deletedLatch)
zkWatcher
- ZookeeperWatcher instancepathToWatch
- (Fully qualified) ZNode path that we are waiting to
be deleted.deletedLatch
- Count down on this latch when deletion has occurred.public boolean hasException()
public Throwable getException()
public void nodeDataChanged(String path)
ZKListener
nodeDataChanged
in class ZKListener
path
- full path of the updated nodepublic void nodeDeleted(String path)
ZKListener
nodeDeleted
in class ZKListener
path
- full path of the deleted nodeCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.