You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2009/03/19 09:52:19 UTC
svn commit: r755875 - in /hadoop/hbase/trunk: CHANGES.txt
src/java/org/apache/hadoop/hbase/HStoreKey.java
src/java/org/apache/hadoop/hbase/regionserver/Memcache.java
Author: stack
Date: Thu Mar 19 08:52:18 2009
New Revision: 755875
URL: http://svn.apache.org/viewvc?rev=755875&view=rev
Log:
HBASE-1267 binary keys broken in trunk (again). -- part 3
Modified:
hadoop/hbase/trunk/CHANGES.txt
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HStoreKey.java
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java
Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=755875&r1=755874&r2=755875&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Thu Mar 19 08:52:18 2009
@@ -48,7 +48,8 @@
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
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HStoreKey.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HStoreKey.java?rev=755875&r1=755874&r2=755875&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HStoreKey.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HStoreKey.java Thu Mar 19 08:52:18 2009
@@ -792,7 +792,7 @@
} else if (left.getTimestamp() > right.getTimestamp()) {
result = -1;
}
- return result;
+ return 0; // are equal
}
protected int compareRows(final byte [] left, final int loffset,
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java?rev=755875&r1=755874&r2=755875&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Memcache.java Thu Mar 19 08:52:18 2009
@@ -265,7 +265,7 @@
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 @@
// 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 @@
// 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 @@
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) {