hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r771459 - in /hadoop/hbase/trunk: ./ src/java/org/apache/hadoop/hbase/filter/ src/test/org/apache/hadoop/hbase/filter/
Date Mon, 04 May 2009 21:50:03 GMT
Author: apurtell
Date: Mon May  4 21:50:02 2009
New Revision: 771459

URL: http://svn.apache.org/viewvc?rev=771459&view=rev
Log:
HBASE-1264 Wrong return values of comparators for ColumnValueFilter

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/SubstringComparator.java
    hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/filter/TestColumnValueFilter.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=771459&r1=771458&r2=771459&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon May  4 21:50:02 2009
@@ -25,8 +25,8 @@
                sync (temporary until HADOOP-4379 is resolved)
    HBASE-1121  Cluster confused about where -ROOT- is
    HBASE-1148  Always flush HLog on root or meta region updates
-   HBASE-1181  src/saveVersion.sh bails on non-standard Bourne shells (e.g. dash)
-               (K M via Jean-Daniel Cryans)
+   HBASE-1181  src/saveVersion.sh bails on non-standard Bourne shells
+               (e.g. dash) (K M via Jean-Daniel Cryans)
    HBASE-1175  HBA administrative tools do not work when specifying region
                name (Jonathan Gray via Andrew Purtell)
    HBASE-1190  TableInputFormatBase with row filters scan too far (Dave
@@ -47,9 +47,10 @@
                to compact when loaded with hundreds of regions
    HBASE-1247  checkAndSave doesn't Write Ahead Log
    HBASE-1243  oldlogfile.dat is screwed, so is it's region
-   HBASE-1169  When a shutdown is requested, stop scanning META regions immediately
-   HBASE-1251  HConnectionManager.getConnection(HBaseConfiguration) returns same
-               HConnection for different HBaseConfigurations 
+   HBASE-1169  When a shutdown is requested, stop scanning META regions
+               immediately
+   HBASE-1251  HConnectionManager.getConnection(HBaseConfiguration) returns 
+               same HConnection for different HBaseConfigurations 
    HBASE-1157, HBASE-1156 If we do not take start code as a part of region
                server recovery, we could inadvertantly try to reassign regions
                assigned to a restarted server with a different start code;
@@ -104,6 +105,8 @@
    HBASE-1365  Typo in TableInputFormatBase.setInputColums (Jon Gray via Stack)
    HBASE-1279  Fix the way hostnames and IPs are handled
    HBASE-1368  HBASE-1279 broke the build
+   HBASE-1264  Wrong return values of comparators for ColumnValueFilter
+               (Thomas Schneider via Andrew Purtell)
 
   IMPROVEMENTS
    HBASE-1089  Add count of regions on filesystem to master UI; add percentage

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java?rev=771459&r1=771458&r2=771459&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/ColumnValueFilter.java Mon
May  4 21:50:02 2009
@@ -172,9 +172,9 @@
     case LESS_OR_EQUAL:
       return compareResult < 0;
     case EQUAL:
-      return compareResult != 0;
-    case NOT_EQUAL:
       return compareResult == 0;
+    case NOT_EQUAL:
+      return compareResult != 0;
     case GREATER_OR_EQUAL:
       return compareResult > 0;
     case GREATER:

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java?rev=771459&r1=771458&r2=771459&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java
(original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/RegexStringComparator.java
Mon May  4 21:50:02 2009
@@ -68,7 +68,7 @@
   public int compareTo(byte[] value) {
     // Use find() for subsequence match instead of matches() (full sequence
     // match) to adhere to the principle of least surprise.
-    return pattern.matcher(Bytes.toString(value)).find() ? 1 : 0;
+    return pattern.matcher(Bytes.toString(value)).find() ? 0 : 1;
   }
 
   public void readFields(DataInput in) throws IOException {

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/SubstringComparator.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/SubstringComparator.java?rev=771459&r1=771458&r2=771459&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/SubstringComparator.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/filter/SubstringComparator.java Mon
May  4 21:50:02 2009
@@ -57,7 +57,7 @@
   }
 
   public int compareTo(byte[] value) {
-    return Bytes.toString(value).toLowerCase().contains(substr) ? 1 : 0;
+    return Bytes.toString(value).toLowerCase().contains(substr) ? 0 : 1;
   }
 
   public void readFields(DataInput in) throws IOException {

Modified: hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/filter/TestColumnValueFilter.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/filter/TestColumnValueFilter.java?rev=771459&r1=771458&r2=771459&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/filter/TestColumnValueFilter.java
(original)
+++ hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/filter/TestColumnValueFilter.java
Mon May  4 21:50:02 2009
@@ -46,7 +46,7 @@
   private static final byte[] FULLSTRING_2 = 
     Bytes.toBytes("The slow grey fox trips over the lazy dog.");
   private static final String QUICK_SUBSTR = "quick";
-  private static final String QUICK_REGEX = "[q][u][i][c][k]";
+  private static final String QUICK_REGEX = ".+quick.+";
 
   private RowFilterInterface basicFilterNew() {
     return new ColumnValueFilter(COLUMN,



Mime
View raw message