Package org.apache.hadoop.hbase.client
Interface ResultScanner
- All Superinterfaces:
AutoCloseable
,Closeable
,Iterable<Result>
- All Known Implementing Classes:
AbstractClientScanner
,AsyncTableResultScanner
,ClientAsyncPrefetchScanner
,ClientScanner
,ClientSideRegionScanner
,ClientSimpleScanner
,RegionScannerAsResultScanner
,ReversedClientScanner
,TableSnapshotScanner
,ThriftTable.Scanner
Interface for client-side scanning. Go to
Table
to obtain instances.-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the scanner and releases any resources it has allocatedReturns the scan metrics, ornull
if we do not enable metrics.iterator()
next()
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
-
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
Get nbRows rows. How many RPCs are made is determined by theScan.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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
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, ornull
if we do not enable metrics.
-