Package org.apache.hadoop.hbase.client
Class SharedAsyncConnection
java.lang.Object
org.apache.hadoop.hbase.client.SharedAsyncConnection
- All Implemented Interfaces:
Closeable,AutoCloseable,AsyncConnection
Wraps a
AsyncConnection to make it can't be closed.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClear all the entries in the region location cache, for all the tables.voidclose()Returns anAsyncAdminBuilderfor creatingAsyncAdmin.Returns anAsyncAdminBuilderfor creatingAsyncAdmin.getBufferedMutatorBuilder(TableName tableName) Returns anAsyncBufferedMutatorBuilderfor creatingAsyncBufferedMutator.getBufferedMutatorBuilder(TableName tableName, ExecutorService pool) Returns anAsyncBufferedMutatorBuilderfor creatingAsyncBufferedMutator.org.apache.hadoop.conf.ConfigurationReturns theConfigurationobject used by this 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 AsyncRegionLocator implementation to inspect region information on a table.getTableBuilder(TableName tableName) Returns anAsyncTableBuilderfor creatingAsyncTable.getTableBuilder(TableName tableName, ExecutorService pool) Returns anAsyncTableBuilderfor creatingAsyncTable.booleanisClosed()Returns whether the connection is closed or not.Convert this connection to aConnection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.client.AsyncConnection
getAdmin, getAdmin, getBufferedMutator, getBufferedMutator, getTable, getTable
-
Field Details
-
conn
-
-
Constructor Details
-
SharedAsyncConnection
-
-
Method Details
-
isClosed
Description copied from interface:AsyncConnectionReturns whether the connection is closed or not.- Specified by:
isClosedin interfaceAsyncConnection- Returns:
- true if this connection is closed
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getConfiguration
Description copied from interface:AsyncConnectionReturns theConfigurationobject used by this instance.The reference returned is not a copy, so any change made to it will affect this instance.
- Specified by:
getConfigurationin interfaceAsyncConnection
-
getRegionLocator
Description copied from interface:AsyncConnectionRetrieve a AsyncRegionLocator implementation to inspect region information on a table. The returned AsyncRegionLocator 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 AsyncRegionLocator is neither required nor desired.- Specified by:
getRegionLocatorin interfaceAsyncConnection- Parameters:
tableName- Name of the table who's region is to be examined- Returns:
- An AsyncRegionLocator instance
-
clearRegionLocationCache
Description copied from interface:AsyncConnectionClear all the entries in the region location cache, for all the tables. If you only want to clear the cache for a specific table, useAsyncTableRegionLocator.clearRegionLocationCache(). This may cause performance issue so use it with caution.- Specified by:
clearRegionLocationCachein interfaceAsyncConnection
-
getTableBuilder
Description copied from interface:AsyncConnectionReturns anAsyncTableBuilderfor creatingAsyncTable.This method no longer checks table existence. An exception will be thrown if the table does not exist only when the first operation is attempted.
- Specified by:
getTableBuilderin interfaceAsyncConnection- Parameters:
tableName- the name of the table
-
getTableBuilder
public AsyncTableBuilder<ScanResultConsumer> getTableBuilder(TableName tableName, ExecutorService pool) Description copied from interface:AsyncConnectionReturns anAsyncTableBuilderfor creatingAsyncTable.This method no longer checks table existence. An exception will be thrown if the table does not exist only when the first operation is attempted.
- Specified by:
getTableBuilderin interfaceAsyncConnection- Parameters:
tableName- the name of the tablepool- the thread pool to use for executing callback
-
getAdminBuilder
Description copied from interface:AsyncConnectionReturns anAsyncAdminBuilderfor creatingAsyncAdmin.The admin operation's returned
CompletableFuturewill be finished directly in the rpc framework's callback thread, so typically you should not do any time consuming work inside these methods.- Specified by:
getAdminBuilderin interfaceAsyncConnection
-
getAdminBuilder
Description copied from interface:AsyncConnectionReturns anAsyncAdminBuilderfor creatingAsyncAdmin.- Specified by:
getAdminBuilderin interfaceAsyncConnection- Parameters:
pool- the thread pool to use for executing callback
-
getBufferedMutatorBuilder
Description copied from interface:AsyncConnectionReturns anAsyncBufferedMutatorBuilderfor creatingAsyncBufferedMutator.- Specified by:
getBufferedMutatorBuilderin interfaceAsyncConnection- Parameters:
tableName- the name of the table
-
getBufferedMutatorBuilder
public AsyncBufferedMutatorBuilder getBufferedMutatorBuilder(TableName tableName, ExecutorService pool) Description copied from interface:AsyncConnectionReturns anAsyncBufferedMutatorBuilderfor creatingAsyncBufferedMutator.- Specified by:
getBufferedMutatorBuilderin interfaceAsyncConnection- Parameters:
tableName- the name of the tablepool- the thread pool to use for executing callback
-
getHbck
Description copied from interface:AsyncConnectionRetrieve 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 interfaceAsyncConnection- Returns:
- an Hbck instance for active master. Active master is fetched from the zookeeper.
-
getHbck
Description copied from interface:AsyncConnectionRetrieve 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 interfaceAsyncConnection- Parameters:
masterServer- explicitServerNamefor master server- Returns:
- an Hbck instance for a specified master server
- Throws:
IOException
-
toConnection
Description copied from interface:AsyncConnectionConvert this connection to aConnection. 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:
toConnectionin interfaceAsyncConnection
-