hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [2/2] hbase git commit: HBASE-16244 LocalHBaseCluster start timeout should be configurable (Siddharth Wagle)
Date Tue, 19 Jul 2016 21:48:25 GMT
HBASE-16244 LocalHBaseCluster start timeout should be configurable (Siddharth Wagle)


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

Branch: refs/heads/branch-1
Commit: d86f8a4943ae3ddca606bd6b3838c8b5f508bda4
Parents: 82ddc93
Author: Enis Soztutar <enis@apache.org>
Authored: Tue Jul 19 14:12:47 2016 -0700
Committer: Enis Soztutar <enis@apache.org>
Committed: Tue Jul 19 14:12:54 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/master/HMasterCommandLine.java  | 2 ++
 .../java/org/apache/hadoop/hbase/util/JVMClusterUtil.java   | 9 +++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d86f8a49/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java
index d2957c7..cc5ca0b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java
@@ -217,6 +217,8 @@ public class HMasterCommandLine extends ServerCommandLine {
         // Run a subclass that does the zk cluster shutdown on its way out.
         int mastersCount = conf.getInt("hbase.masters", 1);
         int regionServersCount = conf.getInt("hbase.regionservers", 1);
+        // Set start timeout to 5 minutes for cmd line start operations
+        conf.setIfUnset("hbase.master.start.timeout.localHBaseCluster", "300000");
         LOG.info("Starting up instance of localHBaseCluster; master=" + mastersCount +
           ", regionserversCount=" + regionServersCount);
         LocalHBaseCluster cluster = new LocalHBaseCluster(conf, mastersCount, regionServersCount,

http://git-wip-us.apache.org/repos/asf/hbase/blob/d86f8a49/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
index 4db20f2..25ed63c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JVMClusterUtil.java
@@ -172,11 +172,14 @@ public class JVMClusterUtil {
   public static String startup(final List<JVMClusterUtil.MasterThread> masters,
       final List<JVMClusterUtil.RegionServerThread> regionservers) throws IOException
{
 
+    Configuration configuration = null;
+
     if (masters == null || masters.isEmpty()) {
       return null;
     }
 
     for (JVMClusterUtil.MasterThread t : masters) {
+      configuration = t.getMaster().getConfiguration();
       t.start();
     }
 
@@ -190,8 +193,10 @@ public class JVMClusterUtil {
       } catch (InterruptedException e) {
         throw (InterruptedIOException)new InterruptedIOException().initCause(e);
       }
-      if (System.currentTimeMillis() > startTime + 30000) {
-        throw new RuntimeException("Master not active after 30 seconds");
+      int startTimeout = configuration != null ? Integer.parseInt(
+        configuration.get("hbase.master.start.timeout.localHBaseCluster", "30000")) : 30000;
+      if (System.currentTimeMillis() > startTime + startTimeout) {
+        throw new RuntimeException(String.format("Master not active after %s seconds", startTimeout));
       }
     }
 


Mime
View raw message