From fe298e08d33485fec0c0bbb56f0d149802742077 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Fri, 25 Apr 2014 21:31:42 +0000 Subject: [PATCH] HBASE-11081 Trunk Master won't start; looking for Constructor that takes conf only git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1590154 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/hadoop/hbase/master/HMaster.java | 6 +++--- .../org/apache/hadoop/hbase/master/HMasterCommandLine.java | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 6efe5d93f96..2d2461ae5e8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -1752,11 +1752,11 @@ public class HMaster extends HRegionServer implements MasterServices, Server { * @return HMaster instance. */ public static HMaster constructMaster(Class masterClass, - final Configuration conf) { + final Configuration conf, final ConsensusProvider cp) { try { Constructor c = - masterClass.getConstructor(Configuration.class); - return c.newInstance(conf); + masterClass.getConstructor(Configuration.class, ConsensusProvider.class); + return c.newInstance(conf, cp); } catch (InvocationTargetException ite) { Throwable target = ite.getTargetException() != null? ite.getTargetException(): ite; 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 587459c5015..fda77c60399 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 @@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.LocalHBaseCluster; import org.apache.hadoop.hbase.ZooKeeperConnectionException; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.consensus.ConsensusProvider; +import org.apache.hadoop.hbase.consensus.ConsensusProviderFactory; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.util.JVMClusterUtil; import org.apache.hadoop.hbase.util.ServerCommandLine; @@ -186,7 +187,8 @@ public class HMasterCommandLine extends ServerCommandLine { waitOnMasterThreads(cluster); } else { logProcessInfo(getConf()); - HMaster master = HMaster.constructMaster(masterClass, conf); + ConsensusProvider cp = ConsensusProviderFactory.getConsensusProvider(conf); + HMaster master = HMaster.constructMaster(masterClass, conf, cp); if (master.isStopped()) { LOG.info("Won't bring the Master up as a shutdown is requested"); return 1;