HBASE-1267 binary keys broken in trunk (again). -- part 3

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@755875 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-03-19 08:52:18 +00:00
parent 04904e3ba8
commit 4f9c466426
3 changed files with 8 additions and 7 deletions

View File

@ -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

View File

@ -792,7 +792,7 @@ public class HStoreKey implements WritableComparable<HStoreKey>, HeapSize {
} else if (left.getTimestamp() > right.getTimestamp()) {
result = -1;
}
return result;
return 0; // are equal
}
protected int compareRows(final byte [] left, final int loffset,

View File

@ -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<HStoreKey, byte []> 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<HStoreKey> 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) {