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

    Fields
    Modifier and Type
    Field
    Description
    private 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

    Constructors
    Constructor
    Description
    ScanPerNextResultScanner(org.apache.hadoop.hbase.client.AsyncTable<org.apache.hadoop.hbase.client.AdvancedScanResultConsumer> table, org.apache.hadoop.hbase.client.Scan scan)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    org.apache.hadoop.hbase.client.metrics.ScanMetrics
     
    org.apache.hadoop.hbase.client.Result
     
    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

      private final org.apache.hadoop.hbase.client.Scan scan
    • queue

      private final Queue<org.apache.hadoop.hbase.client.Result> queue
    • scanMetrics

      private org.apache.hadoop.hbase.client.metrics.ScanMetrics scanMetrics
    • closed

      private boolean closed
    • error

      private Throwable error
    • resumer

      private org.apache.hadoop.hbase.client.AdvancedScanResultConsumer.ScanResumer 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

      public void onError(Throwable error)
      Specified by:
      onError in interface org.apache.hadoop.hbase.client.ScanResultConsumerBase
    • onComplete

      public void onComplete()
      Specified by:
      onComplete in interface org.apache.hadoop.hbase.client.ScanResultConsumerBase
    • onScanMetricsCreated

      public void onScanMetricsCreated(org.apache.hadoop.hbase.client.metrics.ScanMetrics scanMetrics)
      Specified by:
      onScanMetricsCreated in interface org.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 interface org.apache.hadoop.hbase.client.AdvancedScanResultConsumer
    • onHeartbeat

      public void onHeartbeat(org.apache.hadoop.hbase.client.AdvancedScanResultConsumer.ScanController controller)
      Specified by:
      onHeartbeat in interface org.apache.hadoop.hbase.client.AdvancedScanResultConsumer
    • next

      public org.apache.hadoop.hbase.client.Result next() throws IOException
      Specified by:
      next in interface org.apache.hadoop.hbase.client.ResultScanner
      Throws:
      IOException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.apache.hadoop.hbase.client.ResultScanner
    • renewLease

      public boolean renewLease()
      Specified by:
      renewLease in interface org.apache.hadoop.hbase.client.ResultScanner
    • getScanMetrics

      public org.apache.hadoop.hbase.client.metrics.ScanMetrics getScanMetrics()
      Specified by:
      getScanMetrics in interface org.apache.hadoop.hbase.client.ResultScanner