Package org.apache.hadoop.hbase.client
Class CancellableRegionServerCallable<T>
java.lang.Object
org.apache.hadoop.hbase.client.RegionServerCallable<T,org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface>
org.apache.hadoop.hbase.client.ClientServiceCallable<T>
org.apache.hadoop.hbase.client.CancellableRegionServerCallable<T>
- All Implemented Interfaces:
Cancellable
,RetryingCallable<T>
- Direct Known Subclasses:
MultiServerCallable
,RpcRetryingCallerWithReadReplicas.ReplicaRegionServerCallable
@Private
abstract class CancellableRegionServerCallable<T>
extends ClientServiceCallable<T>
implements Cancellable
This class is used to unify HTable calls with AsyncProcess Framework. HTable can use AsyncProcess
directly though this class. Also adds global timeout tracking on top of RegionServerCallable and
implements Cancellable. Global timeout tracking conflicts with logic in RpcRetryingCallerImpl's
callWithRetries. So you can only use this callable in AsyncProcess which only uses
callWithoutRetries and retries in its own implementation.
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.client.RegionServerCallable
location, requestAttributes, rpcController, stub
-
Constructor Summary
ConstructorDescriptionCancellableRegionServerCallable
(Connection connection, TableName tableName, byte[] row, org.apache.hbase.thirdparty.com.google.protobuf.RpcController rpcController, int rpcTimeout, RetryingTimeTracker tracker, int priority, Map<String, byte[]> requestAttributes) -
Method Summary
Modifier and TypeMethodDescriptioncall
(int operationTimeout) Override that changes call Exception fromException
toIOException
.void
cancel()
protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileResponse
doBulkLoadHFile
(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileRequest request) protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadResponse
doCleanupBulkLoad
(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadRequest request) protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiResponse
doMulti
(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiRequest request) protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadResponse
doPrepareBulkLoad
(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadRequest request) protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanResponse
doScan
(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanRequest request) (package private) RetryingTimeTracker
boolean
void
prepare
(boolean reload) Prepare by setting up any connections to servers, etc., ahead of call invocation.protected void
setStubByServiceName
(ServerName serviceName) Set the RCP client stubMethods inherited from class org.apache.hadoop.hbase.client.ClientServiceCallable
doGet, doMutate
Methods inherited from class org.apache.hadoop.hbase.client.RegionServerCallable
getConnection, getExceptionMessageAdditionalDetail, getHRegionInfo, getLocation, getPriority, getRow, getRpcController, getRpcControllerCellScanner, getStub, getTableName, rpcCall, setLocation, setRpcControllerCellScanner, setStub, sleep, throwable
-
Field Details
-
tracker
-
rpcTimeout
-
-
Constructor Details
-
CancellableRegionServerCallable
CancellableRegionServerCallable(Connection connection, TableName tableName, byte[] row, org.apache.hbase.thirdparty.com.google.protobuf.RpcController rpcController, int rpcTimeout, RetryingTimeTracker tracker, int priority, Map<String, byte[]> requestAttributes)
-
-
Method Details
-
call
Description copied from class:RegionServerCallable
Override that changes call Exception fromException
toIOException
. Also does set up of the rpcController.- Specified by:
call
in interfaceRetryingCallable<T>
- Overrides:
call
in classRegionServerCallable<T,
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface> - Parameters:
operationTimeout
- - the time available for this call. 0 for infinite.- Returns:
- computed result
- Throws:
IOException
-
prepare
Description copied from interface:RetryingCallable
Prepare by setting up any connections to servers, etc., ahead of call invocation. TODO: We call prepare before EVERY call. Seems wrong. FIX!!!!- Specified by:
prepare
in interfaceRetryingCallable<T>
- Overrides:
prepare
in classRegionServerCallable<T,
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface> - Parameters:
reload
- Set this to true if need to requery locations- Throws:
IOException
- e
-
setStubByServiceName
Description copied from class:RegionServerCallable
Set the RCP client stub- Overrides:
setStubByServiceName
in classClientServiceCallable<T>
- Parameters:
serviceName
- to get the rpc stub for- Throws:
IOException
- When client could not be created
-
cancel
- Specified by:
cancel
in interfaceCancellable
-
isCancelled
- Specified by:
isCancelled
in interfaceCancellable
-
doMulti
protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiResponse doMulti(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiRequest request) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException - Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
doScan
protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanResponse doScan(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanRequest request) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException - Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
doPrepareBulkLoad
protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadResponse doPrepareBulkLoad(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadRequest request) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException - Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
doBulkLoadHFile
protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileResponse doBulkLoadHFile(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileRequest request) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException - Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
doCleanupBulkLoad
protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadResponse doCleanupBulkLoad(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadRequest request) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException - Throws:
org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
getTracker
-