Package org.apache.hadoop.hbase.client
Class ReversedScannerCallable
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<Result[]>
org.apache.hadoop.hbase.client.ScannerCallable
org.apache.hadoop.hbase.client.ReversedScannerCallable
- All Implemented Interfaces:
RetryingCallable<Result[]>
A reversed ScannerCallable which supports backward scanning.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.client.ScannerCallable
ScannerCallable.MoreResults -
Field Summary
FieldsFields inherited from class org.apache.hadoop.hbase.client.ScannerCallable
closed, cursor, heartbeatMessage, id, instantiated, isRegionServerRemote, LOG, LOG_SCANNER_ACTIVITY, LOG_SCANNER_LATENCY_CUTOFF, renew, rpcControllerFactory, scan, scanMetrics, scannerIdFields inherited from class org.apache.hadoop.hbase.client.RegionServerCallable
location, requestAttributes, rpcController, stub -
Constructor Summary
ConstructorsConstructorDescriptionReversedScannerCallable(ClusterConnection connection, TableName tableName, Scan scan, ScanMetrics scanMetrics, RpcControllerFactory rpcFactory, int replicaId, Map<String, byte[]> requestAttributes) -
Method Summary
Modifier and TypeMethodDescriptiongetScannerCallableForReplica(int id) private Pair<HRegionLocation,byte[]> locateLastRegionInRange(byte[] startKey, byte[] endKey) Get the last region before the endkey, which will be used to execute the reverse scanvoidprepare(boolean reload) Prepare by setting up any connections to servers, etc., ahead of call invocation.voidCalled when call throws an exception and we are going to retry; take action to make it so we succeed on next call (clear caches, do relookup of locations, etc.).Methods inherited from class org.apache.hadoop.hbase.client.ScannerCallable
checkIfRegionServerIsRemote, getCaching, getCursor, getHRegionInfo, getLocationForReplica, getRegionLocationsForPrepare, getScan, isHeartbeatMessage, moreResultsForScan, moreResultsInRegion, rpcCall, setCaching, setClose, setMoreResultsForScan, setMoreResultsInRegion, setRenewMethods inherited from class org.apache.hadoop.hbase.client.ClientServiceCallable
doGet, doMutate, setStubByServiceNameMethods inherited from class org.apache.hadoop.hbase.client.RegionServerCallable
call, getConnection, getExceptionMessageAdditionalDetail, getLocation, getPriority, getRow, getRpcController, getRpcControllerCellScanner, getStub, getTableName, setLocation, setRpcControllerCellScanner, setStub, sleep
-
Field Details
-
locationSearchKey
-
-
Constructor Details
-
ReversedScannerCallable
public ReversedScannerCallable(ClusterConnection connection, TableName tableName, Scan scan, ScanMetrics scanMetrics, RpcControllerFactory rpcFactory, int replicaId, Map<String, byte[]> requestAttributes) - Parameters:
connection- which connectiontableName- table callable is onscan- the scan to executescanMetrics- the ScanMetrics to used, if it is null, ScannerCallable won't collect metricsrpcFactory- to create anRpcControllerto talk to the regionserverreplicaId- the replica id
-
-
Method Details
-
throwable
Description copied from interface:RetryingCallableCalled when call throws an exception and we are going to retry; take action to make it so we succeed on next call (clear caches, do relookup of locations, etc.).- Specified by:
throwablein interfaceRetryingCallable<Result[]>- Overrides:
throwablein classRegionServerCallable<Result[],org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface> - Parameters:
t- throwable which was thrownretrying- True if we are in retrying mode (we are not in retrying mode when max retries == 1; we ARE in retrying mode if retries > 1 even when we are the last attempt)
-
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<Result[]>- Overrides:
preparein classScannerCallable- Parameters:
reload- force reload of server location- Throws:
IOException- e
-
locateLastRegionInRange
private Pair<HRegionLocation,byte[]> locateLastRegionInRange(byte[] startKey, byte[] endKey) throws IOException Get the last region before the endkey, which will be used to execute the reverse scan- Parameters:
startKey- Starting row in range, inclusiveendKey- Ending row in range, exclusive- Returns:
- The last location, and the rowKey used to find it. May be null, if a region could not be found.
- Throws:
IOException
-
getScannerCallableForReplica
- Overrides:
getScannerCallableForReplicain classScannerCallable
-