.../src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java | 2 +- .../org/apache/hadoop/hbase/regionserver/StoreFile.java | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java index 59519e0..1c33bc1 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValueUtil.java @@ -286,7 +286,7 @@ public class KeyValueUtil { * @return Last possible KeyValue on passed row */ public static KeyValue createLastOnRow(final byte[] row) { - return new KeyValue(row, null, null, HConstants.LATEST_TIMESTAMP, Type.Minimum); + return new KeyValue(row, null, null, HConstants.OLDEST_TIMESTAMP, Type.Minimum); } /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java index eb76440..daea870 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java @@ -1362,19 +1362,16 @@ public class StoreFile { && Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW)) { return true; } - KeyValue smallestScanKeyValue = scan.isReversed() ? KeyValueUtil - .createFirstOnRow(scan.getStopRow()) : KeyValueUtil.createFirstOnRow(scan - .getStartRow()); - KeyValue largestScanKeyValue = scan.isReversed() ? KeyValueUtil - .createLastOnRow(scan.getStartRow()) : KeyValueUtil.createLastOnRow(scan - .getStopRow()); + byte[] smallestScanRow = scan.isReversed() ? scan.getStopRow() : scan.getStartRow(); + byte[] largestScanRow = scan.isReversed() ? scan.getStartRow() : scan.getStopRow(); Cell firstKeyKV = this.getFirstKey(); Cell lastKeyKV = this.getLastKey(); - boolean nonOverLapping = ((getComparator().compare(firstKeyKV, largestScanKeyValue)) > 0 + boolean nonOverLapping = (getComparator().compareRows(firstKeyKV, + largestScanRow, 0, largestScanRow.length) > 0 && !Bytes .equals(scan.isReversed() ? scan.getStartRow() : scan.getStopRow(), HConstants.EMPTY_END_ROW)) - || (getComparator().compare(lastKeyKV, smallestScanKeyValue)) < 0; + || getComparator().compareRows(lastKeyKV, smallestScanRow, 0, smallestScanRow.length) < 0; return !nonOverLapping; }