hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-13965 Addendum tries different connector ports if BindException is encountered
Date Mon, 03 Aug 2015 23:23:50 GMT
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 <yuzhihong@gmail.com>
Authored: Mon Aug 3 16:23:52 2015 -0700
Committer: tedyu <yuzhihong@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


Mime
View raw message