hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1211630 - in /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase: HRegionInfo.java master/CatalogJanitor.java
Date Wed, 07 Dec 2011 21:02:55 GMT
Author: tedyu
Date: Wed Dec  7 21:02:54 2011
New Revision: 1211630

URL: http://svn.apache.org/viewvc?rev=1211630&view=rev
Log:
HBASE-4927 Addendum fixes case where start key is empty and end key is empty

Modified:
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java?rev=1211630&r1=1211629&r2=1211630&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java Wed Dec  7
21:02:54 2011
@@ -777,8 +777,14 @@ implements WritableComparable<HRegionInf
     result = Bytes.compareTo(this.endKey, o.endKey);
 
     if (result != 0) {
-      if (this.getEndKey().length == 0) return 1; // this is last region
-      if (o.getEndKey().length == 0) return -1; // o is the last region
+      if (this.getStartKey().length != 0
+              && this.getEndKey().length == 0) {
+          return 1; // this is last region
+      }
+      if (o.getStartKey().length != 0
+              && o.getEndKey().length == 0) {
+          return -1; // o is the last region
+      }
       return result;
     }
     if (this.offLine == o.offLine)

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java?rev=1211630&r1=1211629&r2=1211630&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java Wed
Dec  7 21:02:54 2011
@@ -158,8 +158,14 @@ class CatalogJanitor extends Chore {
       // Compare end keys.
       result = Bytes.compareTo(left.getEndKey(), right.getEndKey());
       if (result != 0) {
-        if (left.getEndKey().length == 0) return -1;  // left is last region
-        if (right.getEndKey().length == 0) return 1;  // right is the last region
+        if (left.getStartKey().length != 0
+                && left.getEndKey().length == 0) {
+            return -1;  // left is last region
+        }
+        if (right.getStartKey().length != 0
+                && right.getEndKey().length == 0) {
+            return 1;  // right is the last region
+        }
         return -result; // Flip the result so parent comes first.
       }
       return result;



Mime
View raw message