Package org.apache.hadoop.hbase.client
Class ConnectionOverAsyncConnection
java.lang.Object
org.apache.hadoop.hbase.client.ConnectionOverAsyncConnection
- All Implemented Interfaces:
 Closeable,AutoCloseable,Abortable,Connection
The connection implementation based on 
AsyncConnection.- 
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate ExecutorServiceprivate final AsyncConnectionImplprivate final ConnectionConfigurationprivate static final org.slf4j.Logger - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidAbort the server or client.voidClear all the entries in the region location cache, for all the tables.voidclose()(package private) voidprivate ThreadPoolExecutorgetAdmin()Retrieve an Admin implementation to administer an HBase cluster.private ExecutorServiceRetrieve aBufferedMutatorfor performing client-side buffering of writes.Returns the cluster ID unique to this HBase cluster.org.apache.hadoop.conf.ConfigurationReturns Configuration instance being used by this Connection instance.getHbck()Retrieve an Hbck implementation to fix an HBase cluster.getHbck(ServerName masterServer) Retrieve an Hbck implementation to fix an HBase cluster.getRegionLocator(TableName tableName) Retrieve a RegionLocator implementation to inspect region information on a table.getTableBuilder(TableName tableName, ExecutorService pool) Returns anTableBuilderfor creatingTable.booleanCheck if the server or client was aborted.booleanisClosed()Returns whether the connection is closed or not.Convert this connection to anAsyncConnection.toString()An identifier that will remain the same for a given connection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.client.Connection
getBufferedMutator, getTable, getTable 
- 
Field Details
- 
LOG
 - 
aborted
 - 
batchPool
 - 
conn
 - 
connConf
 
 - 
 - 
Constructor Details
- 
ConnectionOverAsyncConnection
 
 - 
 - 
Method Details
- 
abort
Description copied from interface:AbortableAbort the server or client. - 
isAborted
Description copied from interface:AbortableCheck if the server or client was aborted. - 
getConfiguration
Description copied from interface:ConnectionReturns Configuration instance being used by this Connection instance.- Specified by:
 getConfigurationin interfaceConnection
 - 
getBufferedMutator
Description copied from interface:ConnectionRetrieve aBufferedMutatorfor performing client-side buffering of writes. TheBufferedMutatorreturned by this method is thread-safe. This object can be used for long lived table operations. The caller is responsible for callingBufferedMutator.close()on the returnedBufferedMutatorinstance.- Specified by:
 getBufferedMutatorin interfaceConnection- Parameters:
 params- details on how to instantiate theBufferedMutator.- Returns:
 - a 
BufferedMutatorfor the supplied tableName. - Throws:
 IOException
 - 
getRegionLocator
Description copied from interface:ConnectionRetrieve a RegionLocator implementation to inspect region information on a table. The returned RegionLocator is not thread-safe, so a new instance should be created for each using thread. This is a lightweight operation. Pooling or caching of the returned RegionLocator is neither required nor desired.
The caller is responsible for callingCloseable.close()on the returned RegionLocator instance. RegionLocator needs to be unmanaged- Specified by:
 getRegionLocatorin interfaceConnection- Parameters:
 tableName- Name of the table who's region is to be examined- Returns:
 - A RegionLocator instance
 - Throws:
 IOException
 - 
clearRegionLocationCache
Description copied from interface:ConnectionClear all the entries in the region location cache, for all the tables. If you only want to clear the cache for a specific table, useRegionLocator.clearRegionLocationCache(). This may cause performance issue so use it with caution.- Specified by:
 clearRegionLocationCachein interfaceConnection
 - 
getAdmin
Description copied from interface:ConnectionRetrieve an Admin implementation to administer an HBase cluster. The returned Admin is not guaranteed to be thread-safe. A new instance should be created for each using thread. This is a lightweight operation. Pooling or caching of the returned Admin is not recommended.
The caller is responsible for callingAdmin.close()on the returned Admin instance.- Specified by:
 getAdminin interfaceConnection- Returns:
 - an Admin instance for cluster administration
 - Throws:
 IOException
 - 
close
- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Specified by:
 closein interfaceConnection- Throws:
 IOException
 - 
closePool
void closePool() - 
isClosed
Description copied from interface:ConnectionReturns whether the connection is closed or not.- Specified by:
 isClosedin interfaceConnection- Returns:
 - true if this connection is closed
 
 - 
createThreadPool
 - 
getBatchPool
- Throws:
 IOException
 - 
getTableBuilder
Description copied from interface:ConnectionReturns anTableBuilderfor creatingTable.- Specified by:
 getTableBuilderin interfaceConnection- Parameters:
 tableName- the name of the tablepool- the thread pool to use for requests like batch and scan
 - 
toAsyncConnection
Description copied from interface:ConnectionConvert this connection to anAsyncConnection. Usually we will return the same instance if you call this method multiple times so you can consider this as a light-weighted operation.- Specified by:
 toAsyncConnectionin interfaceConnection
 - 
getClusterId
Description copied from interface:ConnectionReturns the cluster ID unique to this HBase cluster.
The default implementation is added to keep client compatibility.- Specified by:
 getClusterIdin interfaceConnection
 - 
getHbck
Description copied from interface:ConnectionRetrieve an Hbck implementation to fix an HBase cluster. The returned Hbck is not guaranteed to be thread-safe. A new instance should be created by each thread. This is a lightweight operation. Pooling or caching of the returned Hbck instance is not recommended.
The caller is responsible for callingCloseable.close()on the returned Hbck instance.
This will be used mostly by hbck tool.- Specified by:
 getHbckin interfaceConnection- Returns:
 - an Hbck instance for active master. Active master is fetched from the zookeeper.
 - Throws:
 IOException
 - 
getHbck
Description copied from interface:ConnectionRetrieve an Hbck implementation to fix an HBase cluster. The returned Hbck is not guaranteed to be thread-safe. A new instance should be created by each thread. This is a lightweight operation. Pooling or caching of the returned Hbck instance is not recommended.
The caller is responsible for callingCloseable.close()on the returned Hbck instance.
This will be used mostly by hbck tool. This may only be used to by pass getting registered master from ZK. In situations where ZK is not available or active master is not registered with ZK and user can get master address by other means, master can be explicitly specified.- Specified by:
 getHbckin interfaceConnection- Parameters:
 masterServer- explicitServerNamefor master server- Returns:
 - an Hbck instance for a specified master server
 - Throws:
 IOException
 - 
toString
An identifier that will remain the same for a given connection. 
 -