1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase.client;
20
21 import static org.apache.hadoop.hbase.client.ConnectionUtils.noMoreResultsForReverseScan;
22
23 import java.io.IOException;
24 import java.util.concurrent.ExecutorService;
25
26 import org.apache.hadoop.conf.Configuration;
27 import org.apache.hadoop.hbase.TableName;
28 import org.apache.hadoop.hbase.classification.InterfaceAudience;
29 import org.apache.hadoop.hbase.ipc.RpcControllerFactory;
30
31
32
33
34 @InterfaceAudience.Private
35 public class ReversedClientScanner extends ClientScanner {
36
37
38
39
40
41
42
43
44
45
46
47
48 public ReversedClientScanner(Configuration conf, Scan scan, TableName tableName,
49 ClusterConnection connection, RpcRetryingCallerFactory rpcFactory,
50 RpcControllerFactory controllerFactory, ExecutorService pool, int primaryOperationTimeout)
51 throws IOException {
52 super(conf, scan, tableName, connection, rpcFactory, controllerFactory, pool,
53 primaryOperationTimeout);
54 }
55
56 @Override
57 protected boolean setNewStartKey() {
58 if (noMoreResultsForReverseScan(scan, currentRegion)) {
59 return false;
60 }
61 scan.withStartRow(currentRegion.getStartKey(), false);
62 return true;
63 }
64
65 @Override
66 protected ReversedScannerCallable createScannerCallable() {
67 return new ReversedScannerCallable(getConnection(), getTable(), scan, this.scanMetrics,
68 this.rpcControllerFactory);
69 }
70 }