Review Board 1.7.22


HBASE-4197: Fix Scanner interfaces in HRegion, HRegionServer, and RegionObserver.

Review Request #1496 - Created Aug. 13, 2011 and submitted

Lars Hofhansl
trunk
HBASE-4197
Reviewers
hbase
mingjielai, tedyu
hbase
1. Don't require custom scanners created by coprocessors to be subclasses of HRegion.RegionScanner (see HBASE-4197).
2. Simplify the interfaces for Scanners in HRegion, HRegionServer, and RegionObserver. This avoids a bunch instanceof checks and casts to HRegion.RegionScanner.

(Sorry HBase-git would not accept my patch)
Manual test attached to the bug.
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserver.java
Revision 1157311 New Change
[20] 28 lines
[+20]
29
import org.apache.hadoop.hbase.client.Scan;
29
import org.apache.hadoop.hbase.client.Scan;
30
import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
30
import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
31
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
31
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
32
import org.apache.hadoop.hbase.regionserver.HRegion;
32
import org.apache.hadoop.hbase.regionserver.HRegion;
33
import org.apache.hadoop.hbase.regionserver.InternalScanner;
33
import org.apache.hadoop.hbase.regionserver.InternalScanner;

    
   
34
import org.apache.hadoop.hbase.regionserver.RegionScanner;
34
import org.apache.hadoop.hbase.regionserver.wal.HLogKey;
35
import org.apache.hadoop.hbase.regionserver.wal.HLogKey;
35
import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
36
import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
36

    
   
37

   
37
import java.io.IOException;
38
import java.io.IOException;
38

    
   
39

   
[+20] [20] 155 lines
[+20] [+] public void preIncrement(final ObserverContext<RegionCoprocessorEnvironment> e,
194
  public void postIncrement(final ObserverContext<RegionCoprocessorEnvironment> e,
195
  public void postIncrement(final ObserverContext<RegionCoprocessorEnvironment> e,
195
      final Increment increment, final Result result) throws IOException {
196
      final Increment increment, final Result result) throws IOException {
196
  }
197
  }
197

    
   
198

   
198
  @Override
199
  @Override
199
  public InternalScanner preScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> e,
200
  public RegionScanner preScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> e,
200
      final Scan scan, final InternalScanner s) throws IOException {
201
      final Scan scan, final RegionScanner s) throws IOException {
201
    return s;
202
    return s;
202
  }
203
  }
203

    
   
204

   
204
  @Override
205
  @Override
205
  public InternalScanner postScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> e,
206
  public RegionScanner postScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> e,
206
      final Scan scan, final InternalScanner s) throws IOException {
207
      final Scan scan, final RegionScanner s) throws IOException {
207
    return s;
208
    return s;
208
  }
209
  }
209

    
   
210

   
210
  @Override
211
  @Override
211
  public boolean preScannerNext(final ObserverContext<RegionCoprocessorEnvironment> e,
212
  public boolean preScannerNext(final ObserverContext<RegionCoprocessorEnvironment> e,
[+20] [20] 32 lines
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
Revision 1157311 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
Revision 1157311 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Revision 1157311 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
Revision 1157311 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScanner.java
New File
 
http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java
Revision 1157311 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
Revision 1157311 New Change
 
http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java
Revision 1157311 New Change
 
  1. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserver.java: Loading...
  2. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java: Loading...
  3. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java: Loading...
  4. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java: Loading...
  5. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java: Loading...
  6. http://svn.apache.org/repos/asf/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScanner.java: Loading...
  7. http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java: Loading...
  8. http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java: Loading...
  9. http://svn.apache.org/repos/asf/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java: Loading...