Interface RegionScanner

All Superinterfaces:
AutoCloseable, Closeable, InternalScanner
All Known Implementing Classes:
RegionScannerImpl, ReversedRegionScannerImpl

@LimitedPrivate("Coprocesssor") @Evolving public interface RegionScanner extends InternalScanner
RegionScanner describes iterators over rows in an HRegion.
  • Method Details

    • getRegionInfo

      Returns The RegionInfo for this scanner.
    • isFilterDone

      boolean isFilterDone() throws IOException
      Returns:
      True if a filter indicates that this scanner will return no further rows.
      Throws:
      IOException - in case of I/O failure on a filter.
    • reseek

      boolean reseek(byte[] row) throws IOException
      Do a reseek to the required row. Should not be used to seek to a key which may come before the current position. Always seeks to the beginning of a row boundary. if row is null
      Throws:
      IOException
    • getMaxResultSize

      Returns:
      The preferred max buffersize. See Scan.setMaxResultSize(long)
    • getMvccReadPoint

      Returns The Scanner's MVCC readPt see MultiVersionConcurrencyControl
    • getBatch

      int getBatch()
      Returns:
      The limit on the number of cells to retrieve on each call to next(). See Scan.setBatch(int)
    • getOperationId

      Returns:
      The Scanner's OperationWithAttributes.ID_ATRIBUTE value, or null if not set.
    • nextRaw

      boolean nextRaw(List<Cell> result) throws IOException
      Grab the next row's worth of values. This is a special internal method to be called from coprocessor hooks to avoid expensive setup. Caller must set the thread's readpoint, start and close a region operation, an synchronize on the scanner object. Caller should maintain and update metrics. See nextRaw(List, ScannerContext)
      Parameters:
      result - return output array
      Returns:
      true if more rows exist after this one, false if scanner is done
      Throws:
      IOException - e
    • nextRaw

      boolean nextRaw(List<Cell> result, ScannerContext scannerContext) throws IOException
      Grab the next row's worth of values. The ScannerContext is used to enforce and track any limits associated with this call. Any progress that exists in the ScannerContext prior to calling this method will be LOST if ScannerContext.getKeepProgress() is false. Upon returning from this method, the ScannerContext will contain information about the progress made towards the limits. This is a special internal method to be called from coprocessor hooks to avoid expensive setup. Caller must set the thread's readpoint, start and close a region operation, an synchronize on the scanner object. Example: HRegion region = ...; RegionScanner scanner = ... MultiVersionConcurrencyControl.setThreadReadPoint(scanner.getMvccReadPoint()); region.startRegionOperation(); try { synchronized(scanner) { ... boolean moreRows = scanner.nextRaw(values); ... } } finally { region.closeRegionOperation(); }
      Parameters:
      result - return output array
      scannerContext - The ScannerContext instance encapsulating all limits that should be tracked during calls to this method. The progress towards these limits can be tracked within this instance.
      Returns:
      true if more rows exist after this one, false if scanner is done
      Throws:
      IOException - e