Class ZKListener
java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKListener
- Direct Known Subclasses:
ActiveMasterManager
,ClientZKSyncer
,DeletionListener
,DrainingServerTracker
,MasterMaintenanceModeTracker
,MetaRegionLocationCache
,RegionServerTracker
,TableHFileArchiveTracker
,ZKLeaderManager
,ZKNodeTracker
,ZKPermissionWatcher
,ZKProcedureUtil
,ZKSecretWatcher
,ZKSplitLogManagerCoordination
,ZkSplitLogWorkerCoordination
,ZKVisibilityLabelWatcher
Base class for internal listeners of ZooKeeper events. The
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.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns The watcher associated with this listenervoid
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
-
Field Details
-
watcher
-
-
Constructor Details
-
ZKListener
Construct a ZooKeeper event listener.
-
-
Method Details
-
nodeCreated
Called when a new node has been created.- Parameters:
path
- full path of the new node
-
nodeDeleted
Called when a node has been deleted- Parameters:
path
- full path of the deleted node
-
nodeDataChanged
Called when an existing node has changed data.- Parameters:
path
- full path of the updated node
-
nodeChildrenChanged
Called when an existing node has a child node added or removed.- Parameters:
path
- full path of the node whose children have changed
-
getWatcher
Returns The watcher associated with this listener
-