Package org.apache.hadoop.hbase.client
Class AsyncClusterConnectionImpl
java.lang.Object
org.apache.hadoop.hbase.client.AsyncConnectionImpl
org.apache.hadoop.hbase.client.AsyncClusterConnectionImpl
- All Implemented Interfaces:
Closeable
,AutoCloseable
,AsyncClusterConnection
,AsyncConnection
@Private
class AsyncClusterConnectionImpl
extends AsyncConnectionImpl
implements AsyncClusterConnection
The implementation of AsyncClusterConnection.
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.client.AsyncConnectionImpl
callerFactory, connConf, registry, RETRY_TIMER, rpcClient, rpcControllerFactory, rpcTimeout, user
-
Constructor Summary
ConstructorDescriptionAsyncClusterConnectionImpl
(org.apache.hadoop.conf.Configuration conf, ConnectionRegistry registry, String clusterId, SocketAddress localAddress, User user) -
Method Summary
Modifier and TypeMethodDescriptionbulkLoad
(TableName tableName, List<Pair<byte[], String>> familyPaths, byte[] row, boolean assignSeqNum, org.apache.hadoop.security.token.Token<?> userToken, String bulkToken, boolean copyFiles, List<String> clusterIds, boolean replicate) Securely bulk load a list of HFiles, passing additional list of clusters ids tracking clusters where the given bulk load has already been processed (important for bulk loading replication).cleanupBulkLoad
(TableName tableName, String bulkToken) Clean up after finishing bulk load, no matter success or not.CompletableFuture<org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse>
flush
(byte[] regionName, boolean writeFlushWALMarker) Flush a region and get the response.getAllBootstrapNodes
(ServerName regionServer) Get the bootstrap node list of another region server.getLiveRegionServers
(MasterAddressTracker masterAddrTracker, int count) Get live region servers from masters.Get the nonce generator for this connection.getRegionLocations
(TableName tableName, byte[] row, boolean reload) Return all the replicas for a region.getRegionServerAdmin
(ServerName serverName) Get the admin service for the given region server.Get the rpc client we used to communicate with other servers.prepareBulkLoad
(TableName tableName) Return the token for this bulk load.replicate
(RegionInfo replica, List<WAL.Entry> entries, int retries, long rpcTimeoutNs, long operationTimeoutNs) Replicate wal edits to a secondary replica.Methods inherited from class org.apache.hadoop.hbase.client.AsyncConnectionImpl
clearMasterStubCache, clearRegionLocationCache, close, getAdminBuilder, getAdminBuilder, getAdminStub, getBackoffPolicy, getBufferedMutatorBuilder, getBufferedMutatorBuilder, getChoreService, getClusterId, getConfiguration, getConnectionMetrics, getConnectionRegistry, getHbck, getHbck, getLocator, getMasterStub, getRegionLocator, getRegionServerStub, getStatisticsTracker, getTableBuilder, getTableBuilder, getUser, isClosed, toConnection
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.client.AsyncConnection
clearRegionLocationCache, getAdmin, getAdmin, getAdminBuilder, getAdminBuilder, getBufferedMutator, getBufferedMutator, getBufferedMutatorBuilder, getBufferedMutatorBuilder, getConfiguration, getHbck, getHbck, getRegionLocator, getTable, getTable, getTableBuilder, getTableBuilder, isClosed, toConnection
-
Constructor Details
-
AsyncClusterConnectionImpl
public AsyncClusterConnectionImpl(org.apache.hadoop.conf.Configuration conf, ConnectionRegistry registry, String clusterId, SocketAddress localAddress, User user)
-
-
Method Details
-
getNonceGenerator
Description copied from interface:AsyncClusterConnection
Get the nonce generator for this connection.- Specified by:
getNonceGenerator
in interfaceAsyncClusterConnection
- Overrides:
getNonceGenerator
in classAsyncConnectionImpl
-
getRpcClient
Description copied from interface:AsyncClusterConnection
Get the rpc client we used to communicate with other servers.- Specified by:
getRpcClient
in interfaceAsyncClusterConnection
-
getRegionServerAdmin
Description copied from interface:AsyncClusterConnection
Get the admin service for the given region server.- Specified by:
getRegionServerAdmin
in interfaceAsyncClusterConnection
-
flush
public CompletableFuture<org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse> flush(byte[] regionName, boolean writeFlushWALMarker) Description copied from interface:AsyncClusterConnection
Flush a region and get the response.- Specified by:
flush
in interfaceAsyncClusterConnection
-
getRegionLocations
public CompletableFuture<RegionLocations> getRegionLocations(TableName tableName, byte[] row, boolean reload) Description copied from interface:AsyncClusterConnection
Return all the replicas for a region. Used for region replica replication.- Specified by:
getRegionLocations
in interfaceAsyncClusterConnection
-
prepareBulkLoad
Description copied from interface:AsyncClusterConnection
Return the token for this bulk load.- Specified by:
prepareBulkLoad
in interfaceAsyncClusterConnection
-
bulkLoad
public CompletableFuture<Boolean> bulkLoad(TableName tableName, List<Pair<byte[], String>> familyPaths, byte[] row, boolean assignSeqNum, org.apache.hadoop.security.token.Token<?> userToken, String bulkToken, boolean copyFiles, List<String> clusterIds, boolean replicate) Description copied from interface:AsyncClusterConnection
Securely bulk load a list of HFiles, passing additional list of clusters ids tracking clusters where the given bulk load has already been processed (important for bulk loading replication). Defined as default here to avoid breaking callers who rely on the bulkLoad version that does not expect additional clusterIds param.- Specified by:
bulkLoad
in interfaceAsyncClusterConnection
- Parameters:
tableName
- the target tablefamilyPaths
- hdfs path for the the table family dirs containg files to be loaded.row
- row key.assignSeqNum
- seq num for the event on WAL.userToken
- user token.bulkToken
- bulk load token.copyFiles
- flag for copying the loaded hfiles.clusterIds
- list of cluster ids where the given bulk load has already been processed.replicate
- flags if the bulkload is targeted for replication.
-
cleanupBulkLoad
Description copied from interface:AsyncClusterConnection
Clean up after finishing bulk load, no matter success or not.- Specified by:
cleanupBulkLoad
in interfaceAsyncClusterConnection
-
getLiveRegionServers
public CompletableFuture<List<ServerName>> getLiveRegionServers(MasterAddressTracker masterAddrTracker, int count) Description copied from interface:AsyncClusterConnection
Get live region servers from masters.- Specified by:
getLiveRegionServers
in interfaceAsyncClusterConnection
-
getAllBootstrapNodes
Description copied from interface:AsyncClusterConnection
Get the bootstrap node list of another region server.- Specified by:
getAllBootstrapNodes
in interfaceAsyncClusterConnection
-
replicate
public CompletableFuture<Void> replicate(RegionInfo replica, List<WAL.Entry> entries, int retries, long rpcTimeoutNs, long operationTimeoutNs) Description copied from interface:AsyncClusterConnection
Replicate wal edits to a secondary replica.- Specified by:
replicate
in interfaceAsyncClusterConnection
-