com.google.cloud.bigtable.hbase2_x
Class BigtableConnection
- java.lang.Object
-
- org.apache.hadoop.hbase.client.AbstractBigtableConnection
-
- com.google.cloud.bigtable.hbase2_x.BigtableConnection
-
- All Implemented Interfaces:
- Closeable, AutoCloseable, Abortable, CommonConnection, Connection
public class BigtableConnection extends AbstractBigtableConnection
HBase 2.x specific implementation ofAbstractBigtableConnection
.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Field Summary
-
Fields inherited from class org.apache.hadoop.hbase.client.AbstractBigtableConnection
locatorCache
-
-
Constructor Summary
Constructors Constructor and Description BigtableConnection(org.apache.hadoop.conf.Configuration conf)
Constructor for BigtableConnection.BigtableConnection(org.apache.hadoop.conf.Configuration conf, ExecutorService pool, User user)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected SampledRowKeysAdapter
createSampledRowKeysAdapter(TableName tableName, ServerName serverName)
Due to hbase 1.x to 2.x binary incompatibilities.Admin
getAdmin()
List<HRegionInfo>
getAllRegionInfos(TableName tableName)
Retrieve a region information on a table.Table
getTable(TableName tableName, ExecutorService ignored)
TableBuilder
getTableBuilder(TableName tableName, ExecutorService pool)
-
Methods inherited from class org.apache.hadoop.hbase.client.AbstractBigtableConnection
abort, close, createAdapter, getBufferedMutator, getBufferedMutator, getConfiguration, getDisabledTables, getOptions, getRegionLocator, getSession, getTable, getTable, isAborted, isClosed, toString
-
-
-
-
Constructor Detail
-
BigtableConnection
public BigtableConnection(org.apache.hadoop.conf.Configuration conf) throws IOException
Constructor for BigtableConnection.- Parameters:
conf
- aConfiguration
object.- Throws:
IOException
- if any.
-
BigtableConnection
public BigtableConnection(org.apache.hadoop.conf.Configuration conf, ExecutorService pool, User user) throws IOException
- Throws:
IOException
-
-
Method Detail
-
createSampledRowKeysAdapter
protected SampledRowKeysAdapter createSampledRowKeysAdapter(TableName tableName, ServerName serverName)
Due to hbase 1.x to 2.x binary incompatibilities.HRegionLocation.HRegionLocation(org.apache.hadoop.hbase.client.RegionInfo, ServerName)
will fail with NoSuchMethodException if not recompiled with hbase 2.0 dependencies. Hence the override. SeeSampledRowKeysAdapter
for more details.- Specified by:
createSampledRowKeysAdapter
in classAbstractBigtableConnection
- Parameters:
tableName
- aTableName
object.serverName
- aServerName
object.- Returns:
- a
SampledRowKeysAdapter
object.
-
getAdmin
public Admin getAdmin() throws IOException
- Specified by:
getAdmin
in interfaceConnection
- Specified by:
getAdmin
in classAbstractBigtableConnection
- Throws:
IOException
-
getTableBuilder
public TableBuilder getTableBuilder(TableName tableName, ExecutorService pool)
-
getTable
public Table getTable(TableName tableName, ExecutorService ignored) throws IOException
- Throws:
IOException
-
getAllRegionInfos
public List<HRegionInfo> getAllRegionInfos(TableName tableName) throws IOException
Description copied from interface:CommonConnection
Retrieve a region information on a table.- Parameters:
tableName
- Name of the table for which to return region info.- Returns:
- A
List
HRegionInfo object - Throws:
IOException
- if any.
-
-