org.apache.hadoop.hbase.client
Class HConnectionManager.ClientZKWatcher
java.lang.Object
org.apache.hadoop.hbase.client.HConnectionManager.ClientZKWatcher
- All Implemented Interfaces:
- org.apache.zookeeper.Watcher
- Enclosing class:
- HConnectionManager
public static class HConnectionManager.ClientZKWatcher
- extends Object
- implements org.apache.zookeeper.Watcher
This class is responsible to handle connection and reconnection
to a zookeeper quorum.
Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher |
org.apache.zookeeper.Watcher.Event |
Method Summary |
ZooKeeperWrapper |
getZooKeeperWrapper()
Get this watcher's ZKW, instantiate it if necessary. |
void |
process(org.apache.zookeeper.WatchedEvent event)
Called by ZooKeeper when an event occurs on our connection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HConnectionManager.ClientZKWatcher
public HConnectionManager.ClientZKWatcher(org.apache.hadoop.conf.Configuration conf)
- Takes a configuration to pass it to ZKW but won't instanciate it
- Parameters:
conf
- configuration
process
public void process(org.apache.zookeeper.WatchedEvent event)
- Called by ZooKeeper when an event occurs on our connection. We use this to
detect our session expiring. When our session expires, we have lost our
connection to ZooKeeper. Our handle is dead, and we need to recreate it.
See http://hadoop.apache.org/zookeeper/docs/current/zookeeperProgrammers.html#ch_zkSessions
for more information.
- Specified by:
process
in interface org.apache.zookeeper.Watcher
- Parameters:
event
- WatchedEvent witnessed by ZooKeeper.
getZooKeeperWrapper
public ZooKeeperWrapper getZooKeeperWrapper()
throws IOException
- Get this watcher's ZKW, instantiate it if necessary.
- Returns:
- ZKW
- Throws:
IOException
- if a remote or network exception occurs
Copyright © 2010 Apache Software Foundation. All Rights Reserved.