public class Connection extends Object
The new HBase 1.x Client API changes removed the existing connection pool implementation and placed the responsibility of managing the lifecycle of connections on the caller. A pool is necessary as creating connections to the cluster via. zookeeper is fairly expensive.
For some HBase implementations, e.g. MAPR, the management of connections and table handles is super critical, as the API is extremely performance and resource costly at scale.
| Constructor and Description |
|---|
Connection(org.apache.hadoop.hbase.client.Connection conection,
org.apache.commons.pool2.ObjectPool<Connection> pool,
org.apache.hadoop.conf.Configuration config) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(String why,
Throwable e) |
void |
close() |
void |
destroy() |
org.apache.hadoop.hbase.client.Admin |
getAdmin() |
org.apache.hadoop.hbase.client.BufferedMutator |
getBufferedMutator(org.apache.hadoop.hbase.client.BufferedMutatorParams params) |
org.apache.hadoop.hbase.client.BufferedMutator |
getBufferedMutator(org.apache.hadoop.hbase.TableName tableName) |
org.apache.hadoop.conf.Configuration |
getConfiguration() |
org.apache.hadoop.hbase.client.RegionLocator |
getRegionLocator(org.apache.hadoop.hbase.TableName tableName) |
org.apache.hadoop.hbase.client.Table |
getTable(org.apache.hadoop.hbase.TableName tableName) |
org.apache.hadoop.hbase.client.Table |
getTable(org.apache.hadoop.hbase.TableName tableName,
ExecutorService pool) |
boolean |
isAborted() |
boolean |
isClosed() |
boolean |
tableExists(org.apache.hadoop.hbase.TableName tableName) |
public Connection(org.apache.hadoop.hbase.client.Connection conection,
org.apache.commons.pool2.ObjectPool<Connection> pool,
org.apache.hadoop.conf.Configuration config)
public void close()
throws IOException
IOExceptionpublic void destroy()
throws IOException
IOExceptionpublic boolean isClosed()
public boolean isAborted()
public org.apache.hadoop.conf.Configuration getConfiguration()
public boolean tableExists(org.apache.hadoop.hbase.TableName tableName)
throws IOException
IOExceptionpublic org.apache.hadoop.hbase.client.Table getTable(org.apache.hadoop.hbase.TableName tableName)
throws IOException
IOExceptionpublic org.apache.hadoop.hbase.client.Table getTable(org.apache.hadoop.hbase.TableName tableName,
ExecutorService pool)
throws IOException
IOExceptionpublic org.apache.hadoop.hbase.client.BufferedMutator getBufferedMutator(org.apache.hadoop.hbase.TableName tableName)
throws IOException
IOExceptionpublic org.apache.hadoop.hbase.client.BufferedMutator getBufferedMutator(org.apache.hadoop.hbase.client.BufferedMutatorParams params)
throws IOException
IOExceptionpublic org.apache.hadoop.hbase.client.RegionLocator getRegionLocator(org.apache.hadoop.hbase.TableName tableName)
throws IOException
IOExceptionpublic org.apache.hadoop.hbase.client.Admin getAdmin()
throws IOException
IOExceptionCopyright © 2021. All Rights Reserved.