HBASE-15824 LocalHBaseCluster gets bind exception in master info port

Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/c3223a59
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/c3223a59
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/c3223a59

Branch: refs/heads/HBASE-14850
Commit: c3223a59ffc0f4c8b0f5c7bc452677ef05cdbc11
Parents: 084b036
Author: Enis Soztutar <[email protected]>
Authored: Sun May 15 23:02:11 2016 -0700
Committer: Enis Soztutar <[email protected]>
Committed: Mon May 16 10:32:43 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java    | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c3223a59/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
index 82dc934..8b16a5b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
@@ -144,6 +144,9 @@ public class LocalHBaseCluster {
     // Always have masters and regionservers come up on port '0' so we don't
     // clash over default ports.
     conf.set(HConstants.MASTER_PORT, "0");
+    if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) {
+      conf.set(HConstants.MASTER_INFO_PORT, "0");
+    }
     conf.set(HConstants.REGIONSERVER_PORT, "0");
     if (conf.getInt(HConstants.REGIONSERVER_INFO_PORT, 0) != -1) {
       conf.set(HConstants.REGIONSERVER_INFO_PORT, "0");
@@ -196,6 +199,7 @@ public class LocalHBaseCluster {
   throws IOException, InterruptedException {
     return user.runAs(
         new PrivilegedExceptionAction<JVMClusterUtil.RegionServerThread>() {
+          @Override
           public JVMClusterUtil.RegionServerThread run() throws Exception {
             return addRegionServer(config, index);
           }
@@ -228,6 +232,7 @@ public class LocalHBaseCluster {
   throws IOException, InterruptedException {
     return user.runAs(
         new PrivilegedExceptionAction<JVMClusterUtil.MasterThread>() {
+          @Override
           public JVMClusterUtil.MasterThread run() throws Exception {
             return addMaster(c, index);
           }

Reply via email to