Interface ScanResultCache

All Known Implementing Classes:
AllowPartialScanResultCache, BatchScanResultCache, CompleteScanResultCache

@Private interface ScanResultCache
Used to separate the row constructing logic.

After we add heartbeat support for scan, RS may return partial result even if allowPartial is false and batch is 0. With this interface, the implementation now looks like:

  1. Get results from ScanResponse proto.
  2. Pass them to ScanResultCache and get something back.
  3. If we actually get something back, then pass it to ScanConsumer.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Result[]
     
  • Method Summary

    Modifier and Type
    Method
    Description
    addAndGet(Result[] results, boolean isHeartbeatMessage)
    Add the given results to cache and get valid results back.
    void
    Clear the cached result if any.
    int
    Return the number of complete rows.
  • Field Details

  • Method Details

    • addAndGet

      Result[] addAndGet(Result[] results, boolean isHeartbeatMessage) throws IOException
      Add the given results to cache and get valid results back.
      Parameters:
      results - the results of a scan next. Must not be null.
      isHeartbeatMessage - indicate whether the results is gotten from a heartbeat response.
      Returns:
      valid results, never null.
      Throws:
      IOException
    • clear

      void clear()
      Clear the cached result if any. Called when scan error and we will start from a start of a row again.
    • numberOfCompleteRows

      Return the number of complete rows. Used to implement limited scan.