hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsamj...@apache.org
Subject svn commit: r1553079 - in /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase: coprocessor/ regionserver/
Date Mon, 23 Dec 2013 07:03:04 GMT
Author: anoopsamjohn
Date: Mon Dec 23 07:03:03 2013
New Revision: 1553079

URL: http://svn.apache.org/r1553079
Log:
HBASE-10225 Bug in calls to RegionObsever.postScannerFilterRow

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserver.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedRegionScannerImpl.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserver.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserver.java?rev=1553079&r1=1553078&r2=1553079&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserver.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserver.java
Mon Dec 23 07:03:03 2013
@@ -436,10 +436,11 @@ public abstract class BaseRegionObserver
 
   @Override
   public boolean postScannerFilterRow(final ObserverContext<RegionCoprocessorEnvironment>
e,
-      final InternalScanner s, final byte[] currentRow, final boolean hasMore) throws IOException
{
+      final InternalScanner s, final byte[] currentRow, final int offset, final short length,
+      final boolean hasMore) throws IOException {
     return hasMore;
   }
-  
+
   @Override
   public void preScannerClose(final ObserverContext<RegionCoprocessorEnvironment> e,
       final InternalScanner s) throws IOException {

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java?rev=1553079&r1=1553078&r2=1553079&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java
Mon Dec 23 07:03:03 2013
@@ -967,12 +967,15 @@ public interface RegionObserver extends 
    * @param c the environment provided by the region server
    * @param s the scanner
    * @param currentRow The current rowkey which got filtered out
+   * @param offset offset to rowkey
+   * @param length length of rowkey
    * @param hasMore the 'has more' indication
    * @return whether more rows are available for the scanner or not
    * @throws IOException
    */
   boolean postScannerFilterRow(final ObserverContext<RegionCoprocessorEnvironment>
c,
-      final InternalScanner s, final byte[] currentRow, final boolean hasMore) throws IOException;
+      final InternalScanner s, final byte[] currentRow, final int offset, final short length,
+      final boolean hasMore) throws IOException;
   
   /**
    * Called before the client closes a scanner.

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=1553079&r1=1553078&r2=1553079&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
Mon Dec 23 07:03:03 2013
@@ -3944,8 +3944,8 @@ public class HRegion implements HeapSize
       resetFilters();
       // Calling the hook in CP which allows it to do a fast forward
       return this.region.getCoprocessorHost() == null
-          || this.region.getCoprocessorHost().postScannerFilterRow(this,
-                                                                   currentRow);
+          || this.region.getCoprocessorHost()
+              .postScannerFilterRow(this, currentRow, offset, length);
     }
 
     protected boolean isStopRow(byte[] currentRow, int offset, short length) {

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java?rev=1553079&r1=1553078&r2=1553079&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
Mon Dec 23 07:03:03 2013
@@ -1503,11 +1503,13 @@ public class RegionCoprocessorHost
    * filter.
    * @param s the scanner
    * @param currentRow The current rowkey which got filtered out
+   * @param offset offset to rowkey
+   * @param length length of rowkey
    * @return whether more rows are available for the scanner or not
    * @throws IOException
    */
-  public boolean postScannerFilterRow(final InternalScanner s, final byte[] currentRow)
-      throws IOException {
+  public boolean postScannerFilterRow(final InternalScanner s, final byte[] currentRow, int
offset,
+      short length) throws IOException {
     boolean hasMore = true; // By default assume more rows there.
     ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env : coprocessors) {
@@ -1515,7 +1517,7 @@ public class RegionCoprocessorHost
         ctx = ObserverContext.createAndPrepare(env, ctx);
         try {
           hasMore = ((RegionObserver) env.getInstance()).postScannerFilterRow(ctx, s, currentRow,
-              hasMore);
+              offset, length, hasMore);
         } catch (Throwable e) {
           handleCoprocessorThrowable(env, e);
         }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedRegionScannerImpl.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedRegionScannerImpl.java?rev=1553079&r1=1553078&r2=1553079&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedRegionScannerImpl.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedRegionScannerImpl.java
Mon Dec 23 07:03:03 2013
@@ -73,7 +73,7 @@ class ReversedRegionScannerImpl extends 
     // Calling the hook in CP which allows it to do a fast forward
     if (this.region.getCoprocessorHost() != null) {
       return this.region.getCoprocessorHost().postScannerFilterRow(this,
-          currentRow);
+          currentRow, offset, length);
     }
     return true;
   }



Mime
View raw message