You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2015/08/04 01:23:50 UTC

hbase git commit: HBASE-13965 Addendum tries different connector ports if BindException is encountered

Repository: hbase
Updated Branches:
  refs/heads/master 598cfeb77 -> 931e77d45


HBASE-13965 Addendum tries different connector ports if BindException is encountered


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

Branch: refs/heads/master
Commit: 931e77d4507e1650c452cefadda450e0bf3f0528
Parents: 598cfeb
Author: tedyu <yu...@gmail.com>
Authored: Mon Aug 3 16:23:52 2015 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Mon Aug 3 16:23:52 2015 -0700

----------------------------------------------------------------------
 .../hbase/TestStochasticBalancerJmxMetrics.java       | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/931e77d4/hbase-server/src/test/java/org/apache/hadoop/hbase/TestStochasticBalancerJmxMetrics.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestStochasticBalancerJmxMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestStochasticBalancerJmxMetrics.java
index 352c7c3..c8cb665 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestStochasticBalancerJmxMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestStochasticBalancerJmxMetrics.java
@@ -82,9 +82,17 @@ public class TestStochasticBalancerJmxMetrics extends BalancerTestBase {
     conf.setFloat("hbase.master.balancer.stochastic.maxMovePercent", 0.75f);
     conf.setFloat("hbase.regions.slop", 0.0f);
     conf.set(CoprocessorHost.REGIONSERVER_COPROCESSOR_CONF_KEY, JMXListener.class.getName());
-    conf.setInt("regionserver.rmi.registry.port", connectorPort);
-
-    UTIL.startMiniCluster();
+    for (int i = 0; i < 5; i++) {
+      try {
+        conf.setInt("regionserver.rmi.registry.port", connectorPort);
+
+        UTIL.startMiniCluster();
+        break;
+      } catch (Exception e) {
+        connectorPort++;
+        LOG.debug("Encountered exception when starting cluster. Trying port " + connectorPort, e);
+      }
+    }
   }
 
   @AfterClass