org.apache.hadoop.hbase.client
Class AbstractBigtableConnection
- java.lang.Object
-
- org.apache.hadoop.hbase.client.AbstractBigtableConnection
-
- All Implemented Interfaces:
- Closeable, AutoCloseable, Abortable, CommonConnection, Connection
- Direct Known Subclasses:
- BigtableConnection, BigtableConnection
public abstract class AbstractBigtableConnection extends Object implements Connection, CommonConnection, Closeable
Abstract AbstractBigtableConnection class.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Field Summary
Fields Modifier and Type Field and Description protected Set<RegionLocator>
locatorCache
-
Constructor Summary
Constructors Modifier Constructor and Description AbstractBigtableConnection(org.apache.hadoop.conf.Configuration conf)
Constructor for AbstractBigtableConnection.protected
AbstractBigtableConnection(org.apache.hadoop.conf.Configuration conf, boolean managed, ExecutorService pool, User user)
The constructor called fromConnectionFactory.createConnection(Configuration)
and in its many forms via reflection with this specific signature.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description void
abort(String msg, Throwable t)
void
close()
HBaseRequestAdapter
createAdapter(TableName tableName)
protected abstract SampledRowKeysAdapter
createSampledRowKeysAdapter(TableName tableName, ServerName serverName)
There are some hbase 1.x and 2.x incompatibilities which require this abstract method.abstract Admin
getAdmin()
BufferedMutator
getBufferedMutator(BufferedMutatorParams params)
BufferedMutator
getBufferedMutator(TableName tableName)
org.apache.hadoop.conf.Configuration
getConfiguration()
Returns theConfiguration
object used by this instance.Set<TableName>
getDisabledTables()
Getter for the fielddisabledTables
.BigtableOptions
getOptions()
Getter for the fieldoptions
.RegionLocator
getRegionLocator(TableName tableName)
BigtableSession
getSession()
Getter for the fieldsession
.Table
getTable(String tableName)
Deprecated.Table
getTable(TableName tableName)
boolean
isAborted()
boolean
isClosed()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.hadoop.hbase.client.Connection
getTable, getTableBuilder
-
Methods inherited from interface org.apache.hadoop.hbase.client.CommonConnection
getAllRegionInfos
-
-
-
-
Field Detail
-
locatorCache
protected final Set<RegionLocator> locatorCache
-
-
Constructor Detail
-
AbstractBigtableConnection
public AbstractBigtableConnection(org.apache.hadoop.conf.Configuration conf) throws IOException
Constructor for AbstractBigtableConnection.- Parameters:
conf
- aConfiguration
object.- Throws:
IOException
- if any.
-
AbstractBigtableConnection
protected AbstractBigtableConnection(org.apache.hadoop.conf.Configuration conf, boolean managed, ExecutorService pool, User user) throws IOException
The constructor called fromConnectionFactory.createConnection(Configuration)
and in its many forms via reflection with this specific signature.- Parameters:
conf
- The configuration for this channel. SeeBigtableOptionsFactory
for more details.managed
- This should always be false. It's an artifact of old HBase behavior.pool
- AnExecutorService
to run HBase/Bigtable object conversions on. The RPCs themselves run via NIO, and not on a waiting threaduser
- This is an artifact of HBase which Cloud Bigtable ignores. User information is captured in the Credentials configuration in conf.- Throws:
IOException
- if the setup is not correct. The most likely issue is ALPN or OpenSSL misconfiguration.
-
-
Method Detail
-
getConfiguration
public org.apache.hadoop.conf.Configuration getConfiguration()
Returns theConfiguration
object used by this instance. The reference returned is not a copy, so any change made to it will affect this instance.- Specified by:
getConfiguration
in interfaceCommonConnection
- Specified by:
getConfiguration
in interfaceConnection
- Returns:
- a
Configuration
object.
-
getTable
public Table getTable(TableName tableName) throws IOException
- Specified by:
getTable
in interfaceConnection
- Throws:
IOException
-
getBufferedMutator
public BufferedMutator getBufferedMutator(BufferedMutatorParams params) throws IOException
- Specified by:
getBufferedMutator
in interfaceConnection
- Throws:
IOException
-
createAdapter
public HBaseRequestAdapter createAdapter(TableName tableName)
-
getBufferedMutator
public BufferedMutator getBufferedMutator(TableName tableName) throws IOException
- Specified by:
getBufferedMutator
in interfaceConnection
- Throws:
IOException
-
getTable
@Deprecated public Table getTable(String tableName) throws IOException
Deprecated.This should not be used. The hbase shell needs this in hbase 0.99.2. Remove this once 1.0.0 comes out.- Parameters:
tableName
- aString
object.- Returns:
- a
Table
object. - Throws:
IOException
- if any.
-
getRegionLocator
public RegionLocator getRegionLocator(TableName tableName) throws IOException
- Specified by:
getRegionLocator
in interfaceConnection
- Throws:
IOException
-
createSampledRowKeysAdapter
protected abstract SampledRowKeysAdapter createSampledRowKeysAdapter(TableName tableName, ServerName serverName)
There are some hbase 1.x and 2.x incompatibilities which require this abstract method. SeeSampledRowKeysAdapter
for more details.- Parameters:
tableName
- aTableName
object.serverName
- aServerName
object.- Returns:
- a
SampledRowKeysAdapter
object.
-
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interfaceConnection
-
close
public void close() throws IOException
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceConnection
- Throws:
IOException
-
getAdmin
public abstract Admin getAdmin() throws IOException
- Specified by:
getAdmin
in interfaceConnection
- Throws:
IOException
-
getOptions
public BigtableOptions getOptions()
Getter for the fieldoptions
.- Specified by:
getOptions
in interfaceCommonConnection
- Returns:
- a
BigtableOptions
object.
-
getDisabledTables
public Set<TableName> getDisabledTables()
Getter for the fielddisabledTables
.- Specified by:
getDisabledTables
in interfaceCommonConnection
- Returns:
- a
Set
object.
-
getSession
public BigtableSession getSession()
Getter for the fieldsession
.- Specified by:
getSession
in interfaceCommonConnection
- Returns:
- a
BigtableSession
object.
-
-