HBASE-1425 ColumnValueFilter and WhileMatchFilter fixes on trunk

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@774964 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-05-14 23:43:09 +00:00
parent 5de2553738
commit 02a969d3e1
3 changed files with 7 additions and 16 deletions

View File

@ -129,6 +129,8 @@ Release 0.20.0 - Unreleased
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

View File

@ -161,9 +161,9 @@ public class ColumnValueFilter implements RowFilterInterface {
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 @@ public class ColumnValueFilter implements RowFilterInterface {
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;
}

View File

@ -159,7 +159,7 @@ public class WhileMatchRowFilter implements RowFilterInterface {
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();
}
}