You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2017/11/30 03:14:54 UTC
[2/2] hbase git commit: HBASE-19379 TestEndToEndSplitTransaction
fails with NPE
HBASE-19379 TestEndToEndSplitTransaction fails with NPE
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8492952a
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8492952a
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8492952a
Branch: refs/heads/branch-1.4
Commit: 8492952a9dcfe9cf2e6c697e512cb2107b8934fb
Parents: ef12ee4
Author: Andrew Purtell <ap...@apache.org>
Authored: Wed Nov 29 19:11:05 2017 -0800
Committer: Andrew Purtell <ap...@apache.org>
Committed: Wed Nov 29 19:14:40 2017 -0800
----------------------------------------------------------------------
.../java/org/apache/hadoop/hbase/HRegionLocation.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/8492952a/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java
index 373e76b..2b354f8 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java
@@ -83,6 +83,9 @@ public class HRegionLocation implements Comparable<HRegionLocation> {
*/
@Override
public int hashCode() {
+ if (serverName == null) {
+ return System.identityHashCode(this);
+ }
return this.serverName.hashCode();
}
@@ -116,6 +119,13 @@ public class HRegionLocation implements Comparable<HRegionLocation> {
@Override
public int compareTo(HRegionLocation o) {
- return serverName.compareTo(o.getServerName());
+ if (serverName == null) {
+ if (o.serverName != null) {
+ return 1;
+ }
+ return 0;
+ } else {
+ return serverName.compareTo(o.getServerName());
+ }
}
}