Interface ResultScanner

All Superinterfaces:
AutoCloseable, Closeable, Iterable<Result>
All Known Implementing Classes:
AbstractClientScanner, AsyncTableResultScanner, ClientAsyncPrefetchScanner, ClientScanner, ClientSideRegionScanner, ClientSimpleScanner, RegionScannerAsResultScanner, ReversedClientScanner, TableSnapshotScanner, ThriftTable.Scanner

@Public public interface ResultScanner extends Closeable, Iterable<Result>
Interface for client-side scanning. Go to Table to obtain instances.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the scanner and releases any resources it has allocated
    Returns the scan metrics, or null if we do not enable metrics.
    default Iterator<Result>
     
    Grab the next row's worth of values.
    default Result[]
    next(int nbRows)
    Get nbRows rows.
    boolean
    Allow the client to renew the scanner's lease on the server.

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • iterator

      default Iterator<Result> iterator()
      Specified by:
      iterator in interface Iterable<Result>
    • next

      Grab the next row's worth of values. The scanner will return a Result.
      Returns:
      Result object if there is another row, null if the scanner is exhausted.
      Throws:
      IOException - e
    • next

      default Result[] next(int nbRows) throws IOException
      Get nbRows rows. How many RPCs are made is determined by the Scan.setCaching(int) setting (or hbase.client.scanner.caching in hbase-site.xml).
      Parameters:
      nbRows - number of rows to return
      Returns:
      Between zero and nbRows rowResults. Scan is done if returned array is of zero-length (We never return null).
      Throws:
      IOException
    • close

      void close()
      Closes the scanner and releases any resources it has allocated
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • renewLease

      boolean renewLease()
      Allow the client to renew the scanner's lease on the server.
      Returns:
      true if the lease was successfully renewed, false otherwise.
    • getScanMetrics

      Returns the scan metrics, or null if we do not enable metrics.