Package org.apache.hadoop.hbase.client
Class ScanPerNextResultScanner
java.lang.Object
org.apache.hadoop.hbase.client.ScanPerNextResultScanner
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<org.apache.hadoop.hbase.client.Result>
,org.apache.hadoop.hbase.client.AdvancedScanResultConsumer
,org.apache.hadoop.hbase.client.ResultScanner
,org.apache.hadoop.hbase.client.ScanResultConsumerBase
@Private
public class ScanPerNextResultScanner
extends Object
implements org.apache.hadoop.hbase.client.ResultScanner, org.apache.hadoop.hbase.client.AdvancedScanResultConsumer
A ResultScanner which will only send request to RS when there are no cached results when calling
next, just like the ResultScanner in the old time. Mainly used for writing UTs, that we can
control when to send request to RS. The default ResultScanner implementation will fetch in
background.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.client.AdvancedScanResultConsumer
org.apache.hadoop.hbase.client.AdvancedScanResultConsumer.ScanController, org.apache.hadoop.hbase.client.AdvancedScanResultConsumer.ScanResumer
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private Throwable
private final Queue<org.apache.hadoop.hbase.client.Result>
private org.apache.hadoop.hbase.client.AdvancedScanResultConsumer.ScanResumer
private final org.apache.hadoop.hbase.client.Scan
private org.apache.hadoop.hbase.client.metrics.ScanMetrics
private final org.apache.hadoop.hbase.client.AsyncTable<org.apache.hadoop.hbase.client.AdvancedScanResultConsumer>
-
Constructor Summary
ConstructorDescriptionScanPerNextResultScanner
(org.apache.hadoop.hbase.client.AsyncTable<org.apache.hadoop.hbase.client.AdvancedScanResultConsumer> table, org.apache.hadoop.hbase.client.Scan scan) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
org.apache.hadoop.hbase.client.metrics.ScanMetrics
org.apache.hadoop.hbase.client.Result
next()
void
void
void
onHeartbeat
(org.apache.hadoop.hbase.client.AdvancedScanResultConsumer.ScanController controller) void
onNext
(org.apache.hadoop.hbase.client.Result[] results, org.apache.hadoop.hbase.client.AdvancedScanResultConsumer.ScanController controller) void
onScanMetricsCreated
(org.apache.hadoop.hbase.client.metrics.ScanMetrics scanMetrics) boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.apache.hadoop.hbase.client.ResultScanner
iterator, next
-
Field Details
-
table
private final org.apache.hadoop.hbase.client.AsyncTable<org.apache.hadoop.hbase.client.AdvancedScanResultConsumer> table -
scan
-
queue
-
scanMetrics
-
closed
-
error
-
resumer
-
-
Constructor Details
-
ScanPerNextResultScanner
public ScanPerNextResultScanner(org.apache.hadoop.hbase.client.AsyncTable<org.apache.hadoop.hbase.client.AdvancedScanResultConsumer> table, org.apache.hadoop.hbase.client.Scan scan)
-
-
Method Details
-
onError
- Specified by:
onError
in interfaceorg.apache.hadoop.hbase.client.ScanResultConsumerBase
-
onComplete
- Specified by:
onComplete
in interfaceorg.apache.hadoop.hbase.client.ScanResultConsumerBase
-
onScanMetricsCreated
- Specified by:
onScanMetricsCreated
in interfaceorg.apache.hadoop.hbase.client.ScanResultConsumerBase
-
onNext
public void onNext(org.apache.hadoop.hbase.client.Result[] results, org.apache.hadoop.hbase.client.AdvancedScanResultConsumer.ScanController controller) - Specified by:
onNext
in interfaceorg.apache.hadoop.hbase.client.AdvancedScanResultConsumer
-
onHeartbeat
public void onHeartbeat(org.apache.hadoop.hbase.client.AdvancedScanResultConsumer.ScanController controller) - Specified by:
onHeartbeat
in interfaceorg.apache.hadoop.hbase.client.AdvancedScanResultConsumer
-
next
- Specified by:
next
in interfaceorg.apache.hadoop.hbase.client.ResultScanner
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.apache.hadoop.hbase.client.ResultScanner
-
renewLease
- Specified by:
renewLease
in interfaceorg.apache.hadoop.hbase.client.ResultScanner
-
getScanMetrics
- Specified by:
getScanMetrics
in interfaceorg.apache.hadoop.hbase.client.ResultScanner
-