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:53 UTC

[1/2] hbase git commit: HBASE-19379 TestEndToEndSplitTransaction fails with NPE

Repository: hbase
Updated Branches:
  refs/heads/branch-1 0b704d481 -> cf34adaf5
  refs/heads/branch-1.4 ef12ee480 -> 8492952a9


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/cf34adaf
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/cf34adaf
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/cf34adaf

Branch: refs/heads/branch-1
Commit: cf34adaf5ef3ad6b89d57e1a6adb874fbe1cfc68
Parents: 0b704d4
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:11:05 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/cf34adaf/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());
+    }
   }
 }


[2/2] hbase git commit: HBASE-19379 TestEndToEndSplitTransaction fails with NPE

Posted by ap...@apache.org.
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());
+    }
   }
 }