HBASE-4927 Addendum fixes case where start key is empty and end key is empty
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1211632 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
888fad5f0d
commit
bb7f82ac71
|
@ -777,8 +777,14 @@ implements WritableComparable<HRegionInfo> {
|
||||||
result = Bytes.compareTo(this.endKey, o.endKey);
|
result = Bytes.compareTo(this.endKey, o.endKey);
|
||||||
|
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
if (this.getEndKey().length == 0) return 1; // this is last region
|
if (this.getStartKey().length != 0
|
||||||
if (o.getEndKey().length == 0) return -1; // o is the last region
|
&& 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;
|
return result;
|
||||||
}
|
}
|
||||||
if (this.offLine == o.offLine)
|
if (this.offLine == o.offLine)
|
||||||
|
|
|
@ -158,8 +158,14 @@ class CatalogJanitor extends Chore {
|
||||||
// Compare end keys.
|
// Compare end keys.
|
||||||
result = Bytes.compareTo(left.getEndKey(), right.getEndKey());
|
result = Bytes.compareTo(left.getEndKey(), right.getEndKey());
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
if (left.getEndKey().length == 0) return -1; // left is last region
|
if (left.getStartKey().length != 0
|
||||||
if (right.getEndKey().length == 0) return 1; // right is the last region
|
&& 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; // Flip the result so parent comes first.
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue