hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r774982 - in /hadoop/hbase/trunk_on_hadoop-0.18.3: CHANGES.txt src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java src/java/org/apache/hadoop/hbase/filter/WhileMatchRowFilter.java
Date Fri, 15 May 2009 02:05:49 GMT
Author: apurtell
Date: Fri May 15 02:05:48 2009
New Revision: 774982

URL: http://svn.apache.org/viewvc?rev=774982&view=rev
Log:
HBASE-1425 ColumnValueFilter and WhileMatchFilter fixes on trunk (Clint Morgan via Stack)

Modified:
    hadoop/hbase/trunk_on_hadoop-0.18.3/CHANGES.txt
    hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java
    hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/filter/WhileMatchRowFilter.java

Modified: hadoop/hbase/trunk_on_hadoop-0.18.3/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk_on_hadoop-0.18.3/CHANGES.txt?rev=774982&r1=774981&r2=774982&view=diff
==============================================================================
--- hadoop/hbase/trunk_on_hadoop-0.18.3/CHANGES.txt (original)
+++ hadoop/hbase/trunk_on_hadoop-0.18.3/CHANGES.txt Fri May 15 02:05:48 2009
@@ -129,6 +129,8 @@
    HBASE-1391  NPE in TableInputFormatBase$TableRecordReader.restart if zoo.cfg
                is wrong or missing on task trackers
    HBASE-1323  hbase-1234 broke TestThriftServer; fix and reenable
+   HBASE-1425  ColumnValueFilter and WhileMatchFilter fixes on trunk
+               (Clint Morgan via Stack)
 
   IMPROVEMENTS
    HBASE-1089  Add count of regions on filesystem to master UI; add percentage

Modified: hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java?rev=774982&r1=774981&r2=774982&view=diff
==============================================================================
--- hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java
(original)
+++ hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java
Fri May 15 02:05:48 2009
@@ -161,9 +161,9 @@
       final int length) {
     int compareResult;
     if (comparator != null) {
-      compareResult = comparator.compareTo(data);
+      compareResult = comparator.compareTo(Arrays.copyOfRange(data, offset, offset+length));
     } else {
-      compareResult = compare(value, data);
+      compareResult = Bytes.compareTo(value, 0, value.length, data, offset, length);
     }
 
     switch (compareOp) {
@@ -228,21 +228,10 @@
     if (found == null) {
       return false;
     }
-    return this.filterColumnValue(found.getValue(), found.getValueOffset(),
+    return this.filterColumnValue(found.getBuffer(), found.getValueOffset(),
       found.getValueLength());
   }
 
-  private int compare(final byte[] b1, final byte[] b2) {
-    int len = Math.min(b1.length, b2.length);
-
-    for (int i = 0; i < len; i++) {
-      if (b1[i] != b2[i]) {
-        return b1[i] - b2[i];
-      }
-    }
-    return b1.length - b2.length;
-  }
-
   public boolean processAlways() {
     return false;
   }

Modified: hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/filter/WhileMatchRowFilter.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/filter/WhileMatchRowFilter.java?rev=774982&r1=774981&r2=774982&view=diff
==============================================================================
--- hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/filter/WhileMatchRowFilter.java
(original)
+++ hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/filter/WhileMatchRowFilter.java
Fri May 15 02:05:48 2009
@@ -159,7 +159,7 @@
   public boolean filterColumn(byte[] rowKey, int roffset, int rlength,
       byte[] colunmName, int coffset, int clength, byte[] columnValue,
       int voffset, int vlength) {
-    // TODO Auto-generated method stub
-    return false;
+    changeFAR(this.filter.filterColumn(rowKey, roffset, rlength, colunmName, coffset, clength,
columnValue, voffset, vlength));
+    return filterAllRemaining();
   }
 }



Mime
View raw message