Index: src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java (revision 1340043) +++ src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java (working copy) @@ -67,7 +67,7 @@ /** 'local:' */ public static final String LOCAL_COLON = LOCAL + ":"; private final Configuration conf; - private final Class masterClass; + private Class masterClass; private final Class regionServerClass; /** @@ -132,8 +132,8 @@ */ @SuppressWarnings("unchecked") public LocalHBaseCluster(final Configuration conf, final int noMasters, - final int noRegionServers, final Class masterClass, - final Class regionServerClass) + final int noRegionServers, Class masterClass, + final Class regionServerClass) throws IOException { this.conf = conf; // Always have masters and regionservers come up on port '0' so we don't @@ -144,7 +144,7 @@ conf.getClass(HConstants.MASTER_IMPL, masterClass); // Start the HMasters. for (int i = 0; i < noMasters; i++) { - addMaster(new Configuration(conf), i); + addMaster(new Configuration(conf), i, masterClass); } // Start the HRegionServers. this.regionServerClass = @@ -185,28 +185,28 @@ }); } - public JVMClusterUtil.MasterThread addMaster() throws IOException { - return addMaster(new Configuration(conf), this.masterThreads.size()); + public JVMClusterUtil.MasterThread addMaster(Class masterClass) throws IOException { + return addMaster(new Configuration(conf), this.masterThreads.size(), masterClass); } - public JVMClusterUtil.MasterThread addMaster(Configuration c, final int index) + public JVMClusterUtil.MasterThread addMaster(Configuration c, final int index, Class masterClass) throws IOException { // Create each master with its own Configuration instance so each has // its HConnection instance rather than share (see HBASE_INSTANCES down in // the guts of HConnectionManager. JVMClusterUtil.MasterThread mt = JVMClusterUtil.createMasterThread(c, - this.masterClass, index); + masterClass, index); this.masterThreads.add(mt); return mt; } public JVMClusterUtil.MasterThread addMaster( - final Configuration c, final int index, User user) + final Configuration c, final int index, User user, final Class masterClass) throws IOException, InterruptedException { return user.runAs( new PrivilegedExceptionAction() { public JVMClusterUtil.MasterThread run() throws Exception { - return addMaster(c, index); + return addMaster(c, index, masterClass); } }); } Index: src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java =================================================================== --- src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (revision 1340043) +++ src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (working copy) @@ -424,6 +424,7 @@ // System.getProperty("test.cache.data", "build/test/cache"); // It's also deprecated System.setProperty("test.cache.data", this.clusterTestDir.toString()); + this.conf.set("dfs.datanode.data.dir.perm", "700"); // Ok, now we can start this.dfsCluster = new MiniDFSCluster(0, this.conf, servers, true, true, Index: src/test/java/org/apache/hadoop/hbase/TestClusterBootOrder.java =================================================================== --- src/test/java/org/apache/hadoop/hbase/TestClusterBootOrder.java (revision 1340043) +++ src/test/java/org/apache/hadoop/hbase/TestClusterBootOrder.java (working copy) @@ -20,6 +20,7 @@ import static org.junit.Assert.assertTrue; +import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread; import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread; import org.junit.After; @@ -70,7 +71,8 @@ } private void startMaster() throws Exception { - master = cluster.addMaster(); + master = cluster.addMaster((Class) testUtil.getConfiguration().getClass( + HConstants.MASTER_IMPL, HMaster.class)); master.start(); for (int i=0; i * SLEEP_INTERVAL < SLEEP_TIME ;i++) {