@InterfaceAudience.Private public class AsyncConnectionImpl extends Object implements AsyncConnection
| Modifier and Type | Field and Description |
|---|---|
protected RpcClient |
rpcClient |
protected int |
rpcTimeout |
protected User |
user |
| Constructor and Description |
|---|
AsyncConnectionImpl(org.apache.hadoop.conf.Configuration conf,
ConnectionRegistry registry,
String clusterId,
SocketAddress localAddress,
User user) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearRegionLocationCache()
Clear all the entries in the region location cache, for all the tables.
|
void |
close() |
AsyncAdminBuilder |
getAdminBuilder()
Returns an
AsyncAdminBuilder for creating AsyncAdmin. |
AsyncAdminBuilder |
getAdminBuilder(ExecutorService pool)
Returns an
AsyncAdminBuilder for creating AsyncAdmin. |
AsyncBufferedMutatorBuilder |
getBufferedMutatorBuilder(TableName tableName)
Returns an
AsyncBufferedMutatorBuilder for creating AsyncBufferedMutator. |
AsyncBufferedMutatorBuilder |
getBufferedMutatorBuilder(TableName tableName,
ExecutorService pool)
Returns an
AsyncBufferedMutatorBuilder for creating AsyncBufferedMutator. |
org.apache.hadoop.conf.Configuration |
getConfiguration()
Returns the
Configuration object used by this instance. |
ConnectionRegistry |
getConnectionRegistry() |
CompletableFuture<Hbck> |
getHbck()
Retrieve an Hbck implementation to fix an HBase cluster.
|
Hbck |
getHbck(ServerName masterServer)
Retrieve an Hbck implementation to fix an HBase cluster.
|
AsyncTableRegionLocator |
getRegionLocator(TableName tableName)
Retrieve a AsyncRegionLocator implementation to inspect region information on a table.
|
AsyncTableBuilder<AdvancedScanResultConsumer> |
getTableBuilder(TableName tableName)
Returns an
AsyncTableBuilder for creating AsyncTable. |
AsyncTableBuilder<ScanResultConsumer> |
getTableBuilder(TableName tableName,
ExecutorService pool)
Returns an
AsyncTableBuilder for creating AsyncTable. |
User |
getUser() |
boolean |
isClosed()
Returns whether the connection is closed or not.
|
Connection |
toConnection()
Convert this connection to a
Connection. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAdmin, getAdmin, getBufferedMutator, getBufferedMutator, getTable, getTableprotected final User user
protected final int rpcTimeout
protected final RpcClient rpcClient
public AsyncConnectionImpl(org.apache.hadoop.conf.Configuration conf,
ConnectionRegistry registry,
String clusterId,
SocketAddress localAddress,
User user)
public User getUser()
public ConnectionRegistry getConnectionRegistry()
public org.apache.hadoop.conf.Configuration getConfiguration()
AsyncConnectionConfiguration object used by this instance.
The reference returned is not a copy, so any change made to it will affect this instance.
getConfiguration in interface AsyncConnectionpublic boolean isClosed()
AsyncConnectionisClosed in interface AsyncConnectionpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic AsyncTableRegionLocator getRegionLocator(TableName tableName)
AsyncConnectiongetRegionLocator in interface AsyncConnectiontableName - Name of the table who's region is to be examinedpublic void clearRegionLocationCache()
AsyncConnectionAsyncTableRegionLocator.clearRegionLocationCache().
This may cause performance issue so use it with caution.clearRegionLocationCache in interface AsyncConnectionpublic AsyncTableBuilder<AdvancedScanResultConsumer> getTableBuilder(TableName tableName)
AsyncConnectionAsyncTableBuilder for creating AsyncTable.
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.
getTableBuilder in interface AsyncConnectiontableName - the name of the tablepublic AsyncTableBuilder<ScanResultConsumer> getTableBuilder(TableName tableName, ExecutorService pool)
AsyncConnectionAsyncTableBuilder for creating AsyncTable.
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.
getTableBuilder in interface AsyncConnectiontableName - the name of the tablepool - the thread pool to use for executing callbackpublic AsyncAdminBuilder getAdminBuilder()
AsyncConnectionAsyncAdminBuilder for creating AsyncAdmin.
The admin operation's returned CompletableFuture will be finished directly in the rpc
framework's callback thread, so typically you should not do any time consuming work inside
these methods.
getAdminBuilder in interface AsyncConnectionpublic AsyncAdminBuilder getAdminBuilder(ExecutorService pool)
AsyncConnectionAsyncAdminBuilder for creating AsyncAdmin.getAdminBuilder in interface AsyncConnectionpool - the thread pool to use for executing callbackpublic AsyncBufferedMutatorBuilder getBufferedMutatorBuilder(TableName tableName)
AsyncConnectionAsyncBufferedMutatorBuilder for creating AsyncBufferedMutator.getBufferedMutatorBuilder in interface AsyncConnectiontableName - the name of the tablepublic AsyncBufferedMutatorBuilder getBufferedMutatorBuilder(TableName tableName, ExecutorService pool)
AsyncConnectionAsyncBufferedMutatorBuilder for creating AsyncBufferedMutator.getBufferedMutatorBuilder in interface AsyncConnectiontableName - the name of the tablepool - the thread pool to use for executing callbackpublic Connection toConnection()
AsyncConnectionConnection.
Usually we will return the same instance if you call this method multiple times so you can
consider this as a light-weighted operation.toConnection in interface AsyncConnectionpublic CompletableFuture<Hbck> getHbck()
AsyncConnectionCloseable.close() on the returned Hbck instance.
This will be used mostly by hbck tool.getHbck in interface AsyncConnectionpublic Hbck getHbck(ServerName masterServer)
AsyncConnectionCloseable.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.getHbck in interface AsyncConnectionmasterServer - explicit ServerName for master serverCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.