org.apache.hadoop.hbase.regionserver
Interface RegionScanner

All Superinterfaces:
Closeable, InternalScanner

@InterfaceAudience.LimitedPrivate(value="Coprocesssor")
@InterfaceStability.Stable
public interface RegionScanner
extends InternalScanner

RegionScanner describes iterators over rows in an HRegion.


Method Summary
 long getMaxResultSize()
           
 long getMvccReadPoint()
           
 HRegionInfo getRegionInfo()
           
 boolean isFilterDone()
           
 boolean nextRaw(List<Cell> result)
          Grab the next row's worth of values with the default limit on the number of values to return.
 boolean nextRaw(List<Cell> result, int limit)
          Grab the next row's worth of values with a limit on the number of values to return.
 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 Detail

getRegionInfo

HRegionInfo 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.

Throws:
IOException
IllegalArgumentException - if row is null

getMaxResultSize

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

getMvccReadPoint

long getMvccReadPoint()
Returns:
The Scanner's MVCC readPt see MultiVersionConsistencyControl

nextRaw

boolean nextRaw(List<Cell> result)
                throws IOException
Grab the next row's worth of values with the default limit on the number of values to return. 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, int)

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,
                int limit)
                throws IOException
Grab the next row's worth of values with a limit on the number of values to return. 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 = ...
 MultiVersionConsistencyControl.setThreadReadPoint(scanner.getMvccReadPoint());
 region.startRegionOperation();
 try {
   synchronized(scanner) {
     ...
     boolean moreRows = scanner.nextRaw(values);
     ...
   }
 } finally {
   region.closeRegionOperation();
 }
 

Parameters:
result - return output array
limit - limit on row count to get
Returns:
true if more rows exist after this one, false if scanner is done
Throws:
IOException - e


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.