From c1ada0a373561132a3359b48a27975b2e85978da Mon Sep 17 00:00:00 2001 From: Enis Soztutar Date: Wed, 18 May 2016 11:36:10 -0700 Subject: [PATCH] HBASE-15824 LocalHBaseCluster gets bind exception in master info port - ADDENDUM --- .../main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java | 5 +---- .../test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) 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 8b16a5b0818..84367b05e07 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,9 +144,6 @@ 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"); @@ -450,4 +447,4 @@ public class LocalHBaseCluster { connection.close(); cluster.shutdown(); } -} \ No newline at end of file +} diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java index 002bdb2e73c..f788bed1d26 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java @@ -86,6 +86,9 @@ public class MiniHBaseCluster extends HBaseCluster { throws IOException, InterruptedException { super(conf); conf.set(HConstants.MASTER_PORT, "0"); + if (conf.getInt(HConstants.MASTER_INFO_PORT, 0) != -1) { + conf.set(HConstants.MASTER_INFO_PORT, "0"); + } // Hadoop 2 CompatibilityFactory.getInstance(MetricsAssertHelper.class).init();