@InterfaceAudience.Private public abstract class ZKListener extends Object
ZKWatcher
for a process will execute the appropriate
methods of implementations of this class. In order to receive events from
the watcher, every listener must register itself via ZKWatcher.registerListener(org.apache.hadoop.hbase.zookeeper.ZKListener)
.
Subclasses need only override those methods in which they are interested.
Note that the watcher will be blocked when invoking methods in listeners so
they must not be long-running.Constructor and Description |
---|
ZKListener(ZKWatcher watcher)
Construct a ZooKeeper event listener.
|
Modifier and Type | Method and Description |
---|---|
ZKWatcher |
getWatcher() |
void |
nodeChildrenChanged(String path)
Called when an existing node has a child node added or removed.
|
void |
nodeCreated(String path)
Called when a new node has been created.
|
void |
nodeDataChanged(String path)
Called when an existing node has changed data.
|
void |
nodeDeleted(String path)
Called when a node has been deleted
|
public ZKListener(ZKWatcher watcher)
public void nodeCreated(String path)
path
- full path of the new nodepublic void nodeDeleted(String path)
path
- full path of the deleted nodepublic void nodeDataChanged(String path)
path
- full path of the updated nodepublic void nodeChildrenChanged(String path)
path
- full path of the node whose children have changedpublic ZKWatcher getWatcher()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.