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
This commit is contained in:
Michael Stack 2014-04-25 21:31:42 +00:00
parent ca303c699d
commit fe298e08d3
2 changed files with 6 additions and 4 deletions

View File

@ -1752,11 +1752,11 @@ public class HMaster extends HRegionServer implements MasterServices, Server {
* @return HMaster instance.
*/
public static HMaster constructMaster(Class<? extends HMaster> masterClass,
final Configuration conf) {
final Configuration conf, final ConsensusProvider cp) {
try {
Constructor<? extends HMaster> 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;

View File

@ -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;