diff --git a/CHANGES.txt b/CHANGES.txt index 2198ef7bd01..1d8ec455ad1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -48,7 +48,8 @@ Release 0.20.0 - Unreleased server recovery, we could inadvertantly try to reassign regions assigned to a restarted server with a different start code; Improve lease handling - HBASE-1267 binary keys broken in trunk (again) (Ryan Rawson via Stack) + HBASE-1267 binary keys broken in trunk (again) -- part 2 and 3 + (Ryan Rawson via Stack) IMPROVEMENTS HBASE-1089 Add count of regions on filesystem to master UI; add percentage diff --git a/src/java/org/apache/hadoop/hbase/HStoreKey.java b/src/java/org/apache/hadoop/hbase/HStoreKey.java index c2f204ed04b..7008cffe1c5 100644 --- a/src/java/org/apache/hadoop/hbase/HStoreKey.java +++ b/src/java/org/apache/hadoop/hbase/HStoreKey.java @@ -792,7 +792,7 @@ public class HStoreKey implements WritableComparable, HeapSize { } else if (left.getTimestamp() > right.getTimestamp()) { result = -1; } - return result; + return 0; // are equal } protected int compareRows(final byte [] left, final int loffset, diff --git a/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java b/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java index d33fb99ff1d..43f7e3441e9 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java @@ -265,7 +265,7 @@ class Memcache { if (b == null) { return a; } - return Bytes.compareTo(a, b) <= 0? a: b; + return this.rawcomparator.compareRows(a, b) <= 0? a: b; } /** @@ -300,7 +300,7 @@ class Memcache { // Iterate until we fall into the next row; i.e. move off current row for (Map.Entry es: tailMap.entrySet()) { HStoreKey itKey = es.getKey(); - if (Bytes.compareTo(itKey.getRow(), row) <= 0) + if (this.rawcomparator.compareRows(itKey.getRow(), row) <= 0) continue; // Note: Not suppressing deletes or expired cells. result = itKey.getRow(); @@ -433,7 +433,7 @@ class Memcache { // the search key, or a range of values between the first candidate key // and the ultimate search key (or the end of the cache) if (!tailMap.isEmpty() && - Bytes.compareTo(tailMap.firstKey().getRow(), + this.rawcomparator.compareRows(tailMap.firstKey().getRow(), search_key.getRow()) <= 0) { Iterator key_iterator = tailMap.keySet().iterator(); @@ -442,9 +442,9 @@ class Memcache { HStoreKey deletedOrExpiredRow = null; for (HStoreKey found_key = null; key_iterator.hasNext() && (found_key == null || - Bytes.compareTo(found_key.getRow(), row) <= 0);) { + this.rawcomparator.compareRows(found_key.getRow(), row) <= 0);) { found_key = key_iterator.next(); - if (Bytes.compareTo(found_key.getRow(), row) <= 0) { + if (this.rawcomparator.compareRows(found_key.getRow(), row) <= 0) { if (HLogEdit.isDeleted(tailMap.get(found_key))) { Store.handleDeleted(found_key, candidateKeys, deletes); if (deletedOrExpiredRow == null) {