Interface AsyncConnection
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
AsyncConnectionImpl
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidClear all the entries in the region location cache, for all the tables.default AsyncAdmingetAdmin()Retrieve anAsyncAdminimplementation to administer an HBase cluster.default AsyncAdmingetAdmin(ExecutorService pool) Retrieve anAsyncAdminimplementation to administer an HBase cluster.Returns anAsyncAdminBuilderfor creatingAsyncAdmin.Returns anAsyncAdminBuilderfor creatingAsyncAdmin.default AsyncBufferedMutatorgetBufferedMutator(TableName tableName) Retrieve anAsyncBufferedMutatorfor performing client-side buffering of writes.default AsyncBufferedMutatorgetBufferedMutator(TableName tableName, ExecutorService pool) Retrieve anAsyncBufferedMutatorfor performing client-side buffering of writes.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.default AsyncTable<AdvancedScanResultConsumer>Retrieve anAsyncTableimplementation for accessing a table.default AsyncTable<ScanResultConsumer>getTable(TableName tableName, ExecutorService pool) Retrieve anAsyncTableimplementation for accessing 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.
-
Method Details
-
getConfiguration
org.apache.hadoop.conf.Configuration getConfiguration()Returns theConfigurationobject used by this instance.The reference returned is not a copy, so any change made to it will affect this instance.
-
getRegionLocator
Retrieve 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.- Parameters:
tableName- Name of the table who's region is to be examined- Returns:
- An AsyncRegionLocator instance
-
clearRegionLocationCache
void clearRegionLocationCache()Clear 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. -
getTable
Retrieve anAsyncTableimplementation for accessing a table.The returned instance will use default configs. Use
getTableBuilder(TableName)if you want to customize some configs.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.
The 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. And also the observer style scan API will useAdvancedScanResultConsumerwhich is designed for experts only. Only use it when you know what you are doing.- Parameters:
tableName- the name of the table- Returns:
- an AsyncTable to use for interactions with this table
- See Also:
-
getTableBuilder
Returns 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.
- Parameters:
tableName- the name of the table
-
getTable
Retrieve anAsyncTableimplementation for accessing a table.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.
- Parameters:
tableName- the name of the tablepool- the thread pool to use for executing callback- Returns:
- an AsyncTable to use for interactions with this table
-
getTableBuilder
Returns 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.
- Parameters:
tableName- the name of the tablepool- the thread pool to use for executing callback
-
getAdmin
Retrieve anAsyncAdminimplementation to administer an HBase cluster.The returned instance will use default configs. Use
getAdminBuilder()if you want to customize some configs.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.- Returns:
- an
AsyncAdmininstance for cluster administration
-
getAdminBuilder
Returns 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. -
getAdmin
Retrieve anAsyncAdminimplementation to administer an HBase cluster.The returned instance will use default configs. Use
getAdminBuilder(ExecutorService)if you want to customize some configs.- Parameters:
pool- the thread pool to use for executing callback- Returns:
- an
AsyncAdmininstance for cluster administration
-
getAdminBuilder
Returns anAsyncAdminBuilderfor creatingAsyncAdmin.- Parameters:
pool- the thread pool to use for executing callback
-
getBufferedMutator
Retrieve anAsyncBufferedMutatorfor performing client-side buffering of writes.The returned instance will use default configs. Use
getBufferedMutatorBuilder(TableName)if you want to customize some configs.- Parameters:
tableName- the name of the table- Returns:
- an
AsyncBufferedMutatorfor the supplied tableName.
-
getBufferedMutatorBuilder
Returns anAsyncBufferedMutatorBuilderfor creatingAsyncBufferedMutator.- Parameters:
tableName- the name of the table
-
getBufferedMutator
Retrieve anAsyncBufferedMutatorfor performing client-side buffering of writes.The returned instance will use default configs. Use
getBufferedMutatorBuilder(TableName, ExecutorService)if you want to customize some configs.- Parameters:
tableName- the name of the tablepool- the thread pool to use for executing callback- Returns:
- an
AsyncBufferedMutatorfor the supplied tableName.
-
getBufferedMutatorBuilder
Returns anAsyncBufferedMutatorBuilderfor creatingAsyncBufferedMutator.- Parameters:
tableName- the name of the tablepool- the thread pool to use for executing callback
-
isClosed
boolean isClosed()Returns whether the connection is closed or not.- Returns:
- true if this connection is closed
-
getHbck
Retrieve 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.- Returns:
- an Hbck instance for active master. Active master is fetched from the zookeeper.
-
getHbck
Retrieve 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.- Parameters:
masterServer- explicitServerNamefor master server- Returns:
- an Hbck instance for a specified master server
- Throws:
IOException
-