use of org.apache.hadoop.hbase.StartTestingClusterOption in project hbase by apache.
the class TestTableSnapshotScanner method setupCluster.
public void setupCluster() throws Exception {
setupConf(UTIL.getConfiguration());
StartTestingClusterOption option = StartTestingClusterOption.builder().numRegionServers(NUM_REGION_SERVERS).numDataNodes(NUM_REGION_SERVERS).createRootDir(true).build();
UTIL.startMiniCluster(option);
rootDir = UTIL.getHBaseCluster().getMaster().getMasterFileSystem().getRootDir();
fs = rootDir.getFileSystem(UTIL.getConfiguration());
}
use of org.apache.hadoop.hbase.StartTestingClusterOption in project hbase by apache.
the class TestFailedMetaReplicaAssigment method setUp.
@BeforeClass
public static void setUp() throws Exception {
// using our rigged master, to force a failed meta replica assignment when start up master
// this test can be removed once we remove the HConstants.META_REPLICAS_NUM config.
Configuration conf = TEST_UTIL.getConfiguration();
conf.setInt(HConstants.META_REPLICAS_NUM, 3);
StartTestingClusterOption option = StartTestingClusterOption.builder().numAlwaysStandByMasters(1).numMasters(1).numRegionServers(1).masterClass(BrokenMetaReplicaMaster.class).build();
TEST_UTIL.startMiniCluster(option);
}
use of org.apache.hadoop.hbase.StartTestingClusterOption in project hbase by apache.
the class TestClusterId method testClusterId.
@Test
public void testClusterId() throws Exception {
TEST_UTIL.startMiniZKCluster();
TEST_UTIL.startMiniDFSCluster(1);
Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
// start region server, needs to be separate
// so we get an unset clusterId
rst = JVMClusterUtil.createRegionServerThread(conf, HRegionServer.class, 0);
rst.start();
// Make sure RS is in blocking state
Thread.sleep(10000);
StartTestingClusterOption option = StartTestingClusterOption.builder().numMasters(1).numRegionServers(0).build();
TEST_UTIL.startMiniHBaseCluster(option);
rst.waitForServerOnline();
String clusterId = ZKClusterId.readClusterIdZNode(TEST_UTIL.getZooKeeperWatcher());
assertNotNull(clusterId);
assertEquals(clusterId, rst.getRegionServer().getClusterId());
}
use of org.apache.hadoop.hbase.StartTestingClusterOption in project hbase by apache.
the class TestRSGroupsOfflineMode method setUp.
@BeforeClass
public static void setUp() throws Exception {
TEST_UTIL = new HBaseTestingUtil();
RSGroupUtil.enableRSGroup(TEST_UTIL.getConfiguration());
TEST_UTIL.getConfiguration().set(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, "1");
StartTestingClusterOption option = StartTestingClusterOption.builder().numMasters(2).numRegionServers(3).numDataNodes(3).build();
TEST_UTIL.startMiniCluster(option);
cluster = TEST_UTIL.getHBaseCluster();
master = ((SingleProcessHBaseCluster) cluster).getMaster();
master.balanceSwitch(false);
hbaseAdmin = TEST_UTIL.getAdmin();
// wait till the balancer is in online mode
TEST_UTIL.waitFor(WAIT_TIMEOUT, new Waiter.Predicate<Exception>() {
@Override
public boolean evaluate() throws Exception {
return master.isInitialized() && ((RSGroupBasedLoadBalancer) master.getLoadBalancer()).isOnline() && master.getServerManager().getOnlineServersList().size() >= 3;
}
});
}
use of org.apache.hadoop.hbase.StartTestingClusterOption in project hbase by apache.
the class TestGetReplicationLoad method startCluster.
@BeforeClass
public static void startCluster() throws Exception {
LOG.info("Starting cluster");
TEST_UTIL = new HBaseTestingUtil();
// Set master class and use default values for other options.
StartTestingClusterOption option = StartTestingClusterOption.builder().masterClass(TestMasterMetrics.MyMaster.class).build();
TEST_UTIL.startMiniCluster(option);
cluster = TEST_UTIL.getHBaseCluster();
LOG.info("Waiting for active/ready master");
cluster.waitForActiveAndReadyMaster();
master = cluster.getMaster();
}
Aggregations