public class MaprDBConnection extends Object implements org.cloudgraph.core.Connection
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 |
|---|
MaprDBConnection(org.apache.hadoop.hbase.client.Connection conection,
org.apache.commons.pool2.ObjectPool<org.cloudgraph.core.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.cloudgraph.core.client.Admin |
getAdmin() |
org.apache.hadoop.hbase.client.BufferedMutator |
getBufferedMutator(org.apache.hadoop.hbase.client.BufferedMutatorParams params) |
org.cloudgraph.core.client.BufferedMutator |
getBufferedMutator(org.cloudgraph.core.client.TableName tableName) |
org.apache.hadoop.conf.Configuration |
getConfiguration() |
org.cloudgraph.core.client.RegionLocator |
getRegionLocator(org.cloudgraph.core.client.TableName tableName) |
org.cloudgraph.core.client.Table |
getTable(org.cloudgraph.core.client.TableName tableName) |
org.cloudgraph.core.client.Table |
getTable(org.cloudgraph.core.client.TableName tableName,
ExecutorService pool) |
boolean |
isAborted() |
boolean |
isClosed() |
boolean |
tableExists(org.cloudgraph.core.client.TableName tableName) |
public MaprDBConnection(org.apache.hadoop.hbase.client.Connection conection,
org.apache.commons.pool2.ObjectPool<org.cloudgraph.core.Connection> pool,
org.apache.hadoop.conf.Configuration config)
public void close()
throws IOException
close in interface org.cloudgraph.core.ConnectionIOExceptionpublic void destroy()
throws IOException
destroy in interface org.cloudgraph.core.ConnectionIOExceptionpublic boolean isClosed()
isClosed in interface org.cloudgraph.core.Connectionpublic void abort(String why, Throwable e)
abort in interface org.cloudgraph.core.Connectionpublic boolean isAborted()
isAborted in interface org.cloudgraph.core.Connectionpublic org.apache.hadoop.conf.Configuration getConfiguration()
public boolean tableExists(org.cloudgraph.core.client.TableName tableName)
throws IOException
tableExists in interface org.cloudgraph.core.ConnectionIOExceptionpublic org.cloudgraph.core.client.Table getTable(org.cloudgraph.core.client.TableName tableName)
throws IOException
getTable in interface org.cloudgraph.core.ConnectionIOExceptionpublic org.cloudgraph.core.client.Table getTable(org.cloudgraph.core.client.TableName tableName,
ExecutorService pool)
throws IOException
getTable in interface org.cloudgraph.core.ConnectionIOExceptionpublic org.cloudgraph.core.client.BufferedMutator getBufferedMutator(org.cloudgraph.core.client.TableName tableName)
throws IOException
getBufferedMutator in interface org.cloudgraph.core.ConnectionIOExceptionpublic org.apache.hadoop.hbase.client.BufferedMutator getBufferedMutator(org.apache.hadoop.hbase.client.BufferedMutatorParams params)
throws IOException
IOExceptionpublic org.cloudgraph.core.client.RegionLocator getRegionLocator(org.cloudgraph.core.client.TableName tableName)
throws IOException
getRegionLocator in interface org.cloudgraph.core.ConnectionIOExceptionpublic org.cloudgraph.core.client.Admin getAdmin()
throws IOException
getAdmin in interface org.cloudgraph.core.ConnectionIOExceptionCopyright © 2023. All Rights Reserved.