org.apache.hadoop.hbase.client
Class HConnectionManager.ClientZKWatcher

java.lang.Object
  extended by 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 Class Summary
 
Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher
org.apache.zookeeper.Watcher.Event
 
Constructor Summary
HConnectionManager.ClientZKWatcher(HBaseConfiguration conf)
          Takes a configuration to pass it to ZKW but won't instanciate it
 
Method Summary
 ZooKeeperWrapper getZooKeeperWrapper()
          Get this watcher's ZKW, instanciate 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
 

Constructor Detail

HConnectionManager.ClientZKWatcher

public HConnectionManager.ClientZKWatcher(HBaseConfiguration conf)
Takes a configuration to pass it to ZKW but won't instanciate it

Parameters:
conf -
Throws:
IOException
Method Detail

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, instanciate it if necessary.

Returns:
ZKW
Throws:
IOException


Copyright © 2009 The Apache Software Foundation