Interface RegionScanner
- All Superinterfaces:
AutoCloseable
,Closeable
,InternalScanner
- All Known Implementing Classes:
RegionScannerImpl
,ReversedRegionScannerImpl
RegionScanner describes iterators over rows in an HRegion.
-
Method Summary
Modifier and TypeMethodDescriptionint
getBatch()
long
long
Returns The Scanner's MVCC readPt seeMultiVersionConcurrencyControl
default String
Returns The RegionInfo for this scanner.boolean
boolean
Grab the next row's worth of values.boolean
nextRaw
(List<Cell> result, ScannerContext scannerContext) Grab the next row's worth of values.boolean
reseek
(byte[] row) Do a reseek to the required row.Methods inherited from interface org.apache.hadoop.hbase.regionserver.InternalScanner
close, next, next
-
Method Details
-
getRegionInfo
Returns The RegionInfo for this scanner. -
isFilterDone
- 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
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
long getMaxResultSize()- Returns:
- The preferred max buffersize. See
Scan.setMaxResultSize(long)
-
getMvccReadPoint
long getMvccReadPoint()Returns The Scanner's MVCC readPt seeMultiVersionConcurrencyControl
-
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
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. SeenextRaw(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
Grab the next row's worth of values. TheScannerContext
is used to enforce and track any limits associated with this call. Any progress that exists in theScannerContext
prior to calling this method will be LOST ifScannerContext.getKeepProgress()
is false. Upon returning from this method, theScannerContext
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 arrayscannerContext
- TheScannerContext
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
-