HBASE-1264 Wrong return values of comparators for ColumnValueFilter
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@771459 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8abe303d1f
commit
31cd01f656
13
CHANGES.txt
13
CHANGES.txt
|
@ -25,8 +25,8 @@ Release 0.20.0 - Unreleased
|
|||
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 @@ Release 0.20.0 - Unreleased
|
|||
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 @@ Release 0.20.0 - Unreleased
|
|||
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
|
||||
|
|
|
@ -172,9 +172,9 @@ public class ColumnValueFilter implements RowFilterInterface {
|
|||
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:
|
||||
|
|
|
@ -68,7 +68,7 @@ public class RegexStringComparator implements WritableByteArrayComparable {
|
|||
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 {
|
||||
|
|
|
@ -57,7 +57,7 @@ public class SubstringComparator implements WritableByteArrayComparable {
|
|||
}
|
||||
|
||||
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 {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class TestColumnValueFilter extends TestCase {
|
|||
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,
|
||||
|
|
Loading…
Reference in New Issue