org.apache.hadoop.hbase.zookeeper
Class ZooKeeperListener

java.lang.Object
  extended by org.apache.hadoop.hbase.zookeeper.ZooKeeperListener
Direct Known Subclasses:
AssignmentManager, RegionServerTracker, ReplicationSourceManager.OtherRegionServerWatcher, ReplicationSourceManager.PeersWatcher, ZooKeeperNodeTracker

public class ZooKeeperListener
extends Object

Base class for internal listeners of ZooKeeper events. The ZooKeeperWatcher 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 ZooKeeperWatcher.registerListener(org.apache.hadoop.hbase.zookeeper.ZooKeeperListener). 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
protected  ZooKeeperWatcher watcher
           
 
Constructor Summary
ZooKeeperListener(ZooKeeperWatcher watcher)
          Construct a ZooKeeper event listener.
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

watcher

protected ZooKeeperWatcher watcher
Constructor Detail

ZooKeeperListener

public ZooKeeperListener(ZooKeeperWatcher watcher)
Construct a ZooKeeper event listener.

Method Detail

nodeCreated

public void nodeCreated(String path)
Called when a new node has been created.

Parameters:
path - full path of the new node

nodeDeleted

public void nodeDeleted(String path)
Called when a node has been deleted

Parameters:
path - full path of the deleted node

nodeDataChanged

public void nodeDataChanged(String path)
Called when an existing node has changed data.

Parameters:
path - full path of the updated node

nodeChildrenChanged

public void nodeChildrenChanged(String path)
Called when an existing node has a child node added or removed.

Parameters:
path - full path of the node whose children have changed


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.