@InterfaceAudience.Private public class AsyncConnectionImpl extends Object implements AsyncConnection
Constructor and Description |
---|
AsyncConnectionImpl(org.apache.hadoop.conf.Configuration conf,
ConnectionRegistry registry,
String clusterId,
User user) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAdmin, getAdmin, getBufferedMutator, getBufferedMutator, getTable, getTable
public AsyncConnectionImpl(org.apache.hadoop.conf.Configuration conf, ConnectionRegistry registry, String clusterId, User user)
public User getUser()
public ConnectionRegistry getConnectionRegistry()
public org.apache.hadoop.conf.Configuration getConfiguration()
AsyncConnection
Configuration
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 AsyncConnection
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public boolean isClosed()
AsyncConnection
isClosed
in interface AsyncConnection
public AsyncTableRegionLocator getRegionLocator(TableName tableName)
AsyncConnection
getRegionLocator
in interface AsyncConnection
tableName
- Name of the table who's region is to be examinedpublic NonceGenerator getNonceGenerator()
public AsyncTableBuilder<AdvancedScanResultConsumer> getTableBuilder(TableName tableName)
AsyncConnection
AsyncTableBuilder
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 AsyncConnection
tableName
- the name of the tablepublic AsyncTableBuilder<ScanResultConsumer> getTableBuilder(TableName tableName, ExecutorService pool)
AsyncConnection
AsyncTableBuilder
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 AsyncConnection
tableName
- the name of the tablepool
- the thread pool to use for executing callbackpublic AsyncAdminBuilder getAdminBuilder()
AsyncConnection
AsyncAdminBuilder
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 AsyncConnection
public AsyncAdminBuilder getAdminBuilder(ExecutorService pool)
AsyncConnection
AsyncAdminBuilder
for creating AsyncAdmin
.getAdminBuilder
in interface AsyncConnection
pool
- the thread pool to use for executing callbackpublic AsyncBufferedMutatorBuilder getBufferedMutatorBuilder(TableName tableName)
AsyncConnection
AsyncBufferedMutatorBuilder
for creating AsyncBufferedMutator
.getBufferedMutatorBuilder
in interface AsyncConnection
tableName
- the name of the tablepublic AsyncBufferedMutatorBuilder getBufferedMutatorBuilder(TableName tableName, ExecutorService pool)
AsyncConnection
AsyncBufferedMutatorBuilder
for creating AsyncBufferedMutator
.getBufferedMutatorBuilder
in interface AsyncConnection
tableName
- the name of the tablepool
- the thread pool to use for executing callbackpublic CompletableFuture<Hbck> getHbck()
AsyncConnection
Closeable.close()
on the returned Hbck instance.
This will be used mostly by hbck tool.getHbck
in interface AsyncConnection
public Hbck getHbck(ServerName masterServer)
AsyncConnection
Closeable.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 AsyncConnection
masterServer
- explicit ServerName
for master serverpublic void clearRegionLocationCache()
AsyncConnection
AsyncTableRegionLocator.clearRegionLocationCache()
.
This may cause performance issue so use it with caution.clearRegionLocationCache
in interface AsyncConnection
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.