org.apache.hadoop.hbase.client
Class HConnectionManager

java.lang.Object
  extended by org.apache.hadoop.hbase.client.HConnectionManager
Direct Known Subclasses:
ServerConnectionManager

public class HConnectionManager
extends Object

A non-instantiable class that manages connections to multiple tables in multiple HBase instances. Used by HTable and HBaseAdmin


Nested Class Summary
static class HConnectionManager.ClientZKWatcher
          This class is responsible to handle connection and reconnection to a zookeeper quorum.
 
Constructor Summary
protected HConnectionManager()
           
 
Method Summary
static void deleteAllConnections(boolean stopProxy)
          Delete information for all connections.
static void deleteConnectionInfo(org.apache.hadoop.conf.Configuration conf, boolean stopProxy)
          Delete connection information for the instance specified by configuration
static HConnectionManager.ClientZKWatcher getClientZooKeeperWatcher(org.apache.hadoop.conf.Configuration conf)
          Get a watcher of a zookeeper connection for a given quorum address.
static HConnection getConnection(org.apache.hadoop.conf.Configuration conf)
          Get the connection object for the instance specified by the configuration If no current connection exists, create a new connection for that instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HConnectionManager

protected HConnectionManager()
Method Detail

getConnection

public static HConnection getConnection(org.apache.hadoop.conf.Configuration conf)
Get the connection object for the instance specified by the configuration If no current connection exists, create a new connection for that instance

Parameters:
conf - configuration
Returns:
HConnection object for the instance specified by the configuration

deleteConnectionInfo

public static void deleteConnectionInfo(org.apache.hadoop.conf.Configuration conf,
                                        boolean stopProxy)
Delete connection information for the instance specified by configuration

Parameters:
conf - configuration
stopProxy - stop the proxy as well

deleteAllConnections

public static void deleteAllConnections(boolean stopProxy)
Delete information for all connections.

Parameters:
stopProxy - stop the proxy as well

getClientZooKeeperWatcher

public static HConnectionManager.ClientZKWatcher getClientZooKeeperWatcher(org.apache.hadoop.conf.Configuration conf)
                                                                    throws IOException
Get a watcher of a zookeeper connection for a given quorum address. If the connection isn't established, a new one is created. This acts like a multiton.

Parameters:
conf - configuration
Returns:
ZKW watcher
Throws:
IOException - if a remote or network exception occurs


Copyright © 2010 Apache Software Foundation. All Rights Reserved.