Class ReversedScannerCallable

java.lang.Object
org.apache.hadoop.hbase.client.RegionServerCallable<T,org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface>
All Implemented Interfaces:
RetryingCallable<Result[]>

@Private public class ReversedScannerCallable extends ScannerCallable
A reversed ScannerCallable which supports backward scanning.
  • Field Details

  • Constructor Details

    • ReversedScannerCallable

      public ReversedScannerCallable(ClusterConnection connection, TableName tableName, Scan scan, ScanMetrics scanMetrics, RpcControllerFactory rpcFactory, int replicaId, Map<String,byte[]> requestAttributes)
      Parameters:
      connection - which connection
      tableName - table callable is on
      scan - the scan to execute
      scanMetrics - the ScanMetrics to used, if it is null, ScannerCallable won't collect metrics
      rpcFactory - to create an RpcController to talk to the regionserver
      replicaId - the replica id
  • Method Details

    • throwable

      public void throwable(Throwable t, boolean retrying)
      Description copied from interface: RetryingCallable
      Called 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:
      throwable in interface RetryingCallable<Result[]>
      Overrides:
      throwable in class RegionServerCallable<Result[],org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface>
      Parameters:
      t - throwable which was thrown
      retrying - 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

      public void prepare(boolean reload) throws IOException
      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 interface RetryingCallable<Result[]>
      Overrides:
      prepare in class ScannerCallable
      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, inclusive
      endKey - 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:
      getScannerCallableForReplica in class ScannerCallable