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
FieldsFields inherited from class org.apache.hadoop.hbase.client.RegionServerCallable
location, requestAttributes, rpcController, stub -
Constructor Summary
ConstructorsConstructorDescriptionCancellableRegionServerCallable(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 fromExceptiontoIOException.voidcancel()protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileResponsedoBulkLoadHFile(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileRequest request) protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadResponsedoCleanupBulkLoad(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadRequest request) protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiResponsedoMulti(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.MultiRequest request) protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadResponsedoPrepareBulkLoad(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadRequest request) protected org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanResponsedoScan(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanRequest request) (package private) RetryingTimeTrackerbooleanvoidprepare(boolean reload) Prepare by setting up any connections to servers, etc., ahead of call invocation.protected voidsetStubByServiceName(ServerName serviceName) Set the RCP client stubMethods inherited from class org.apache.hadoop.hbase.client.ClientServiceCallable
doGet, doMutateMethods 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:RegionServerCallableOverride that changes call Exception fromExceptiontoIOException. Also does set up of the rpcController.- Specified by:
callin interfaceRetryingCallable<T>- Overrides:
callin 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:RetryingCallablePrepare by setting up any connections to servers, etc., ahead of call invocation. TODO: We call prepare before EVERY call. Seems wrong. FIX!!!!- Specified by:
preparein interfaceRetryingCallable<T>- Overrides:
preparein 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:RegionServerCallableSet the RCP client stub- Overrides:
setStubByServiceNamein classClientServiceCallable<T>- Parameters:
serviceName- to get the rpc stub for- Throws:
IOException- When client could not be created
-
cancel
- Specified by:
cancelin interfaceCancellable
-
isCancelled
- Specified by:
isCancelledin 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
-