Class BufferingScanResultConsumer

java.lang.Object
org.apache.hadoop.hbase.client.BufferingScanResultConsumer
All Implemented Interfaces:
org.apache.hadoop.hbase.client.AdvancedScanResultConsumer, org.apache.hadoop.hbase.client.ScanResultConsumerBase

class BufferingScanResultConsumer extends Object implements org.apache.hadoop.hbase.client.AdvancedScanResultConsumer
A scan result consumer which buffers all the data in memory and you can call the take() method below to get the result one by one. Should only be used by tests, do not write production code like this as the buffer is unlimited and may cause OOM.
  • 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 Throwable
     
    private boolean
     
    private final Queue<org.apache.hadoop.hbase.client.Result>
     
    private org.apache.hadoop.hbase.client.metrics.ScanMetrics
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.hadoop.hbase.client.AdvancedScanResultConsumer

    onHeartbeat
  • Field Details

    • scanMetrics

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

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

      private boolean finished
    • error

      private Throwable error
  • Constructor Details

  • Method Details

    • 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
    • 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
    • take

      public org.apache.hadoop.hbase.client.Result take() throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException
    • getScanMetrics

      public org.apache.hadoop.hbase.client.metrics.ScanMetrics getScanMetrics()