org.apache.hadoop.hbase.regionserver
Interface RegionScanner

All Superinterfaces:
Closeable, InternalScanner

public interface RegionScanner
extends InternalScanner

RegionScanner describes iterators over rows in an HRegion.


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

Method Detail

getRegionInfo

HRegionInfo getRegionInfo()
Returns:
The RegionInfo for this scanner.

isFilterDone

boolean isFilterDone()
Returns:
True if a filter indicates that this scanner will return no further rows.

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

getMvccReadPoint

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

nextRaw

boolean nextRaw(List<KeyValue> result,
                String metric)
                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. See nextRaw(List, int, String)

Parameters:
result - return output array
metric - the metric name
Returns:
true if more rows exist after this one, false if scanner is done
Throws:
IOException - e

nextRaw

boolean nextRaw(List<KeyValue> result,
                int limit,
                String metric)
                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
metric - the metric name
Returns:
true if more rows exist after this one, false if scanner is done
Throws:
IOException - e


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.