@BeforeClass public static void setUpClass() throws Exception { TESTING_UTIL.getConfiguration().setLong(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, 500); TESTING_UTIL.getConfiguration().setLong(HConstants.HBASE_CLIENT_META_OPERATION_TIMEOUT, 500); TESTING_UTIL.getConfiguration().setLong(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 500); TESTING_UTIL.getConfiguration().setLong(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1); // Set RegionServer class and use default values for other options. StartMiniClusterOption option = StartMiniClusterOption.builder() .rsClass(DelayedRegionServer.class).build(); TESTING_UTIL.startMiniCluster(option); }
@BeforeClass public static void setUpBeforeClass() throws Exception { final int DEFAULT_BLOCK_SIZE = 1024 * 1024; TEST_UTIL.getConfiguration().setLong("dfs.blocksize", DEFAULT_BLOCK_SIZE); TEST_UTIL.getConfiguration().setInt("dfs.replication", 1); TEST_UTIL.getConfiguration().setLong("hbase.hregion.max.filesize", 322122547200L); String[] dataNodeHosts = new String[] {"host1", "host2", "host3"}; int regionServersCount = 3; StartMiniClusterOption option = StartMiniClusterOption.builder() .numRegionServers(regionServersCount).dataNodeHosts(dataNodeHosts).build(); TEST_UTIL.startMiniCluster(option); }
@BeforeClass public static void startCluster() throws Exception { LOG.info("Starting cluster"); // Set master class and use default values for other options. StartMiniClusterOption option = StartMiniClusterOption.builder().masterClass(MyMaster.class) .rsClass(MyRegionServer.class).build(); TEST_UTIL.startMiniCluster(option); cluster = TEST_UTIL.getHBaseCluster(); LOG.info("Waiting for active/ready master"); cluster.waitForActiveAndReadyMaster(); master = cluster.getMaster(); }
@BeforeClass public static void setUp() throws Exception { StartMiniClusterOption option = StartMiniClusterOption.builder() .numMasters(2).numRegionServers(3).numDataNodes(3).build(); UTIL.startMiniCluster(option); }
@BeforeClass public static void setup() throws Exception { // Set master number and use default values for other options. StartMiniClusterOption option = StartMiniClusterOption.builder().numMasters(2).build(); TEST_UTIL.startMiniCluster(option); }
@BeforeClass public static void before() throws Exception { TESTING_UTIL.getConfiguration().setInt(HConstants.HBASE_BALANCER_PERIOD, 60000); StartMiniClusterOption option = StartMiniClusterOption.builder() .masterClass(MyMaster.class).numRegionServers(NB_SERVERS).numDataNodes(NB_SERVERS).build(); TESTING_UTIL.startMiniCluster(option); }
@BeforeClass public static void setUp() throws Exception { UTIL.getConfiguration().setInt(HConstants.HBASE_RPC_SHORTOPERATION_TIMEOUT_KEY, 60000); UTIL.startMiniCluster( StartMiniClusterOption.builder().numRegionServers(2).masterClass(MockHMaster.class).build()); UTIL.createTable(TABLE_NAME, CF); UTIL.getAdmin().balancerSwitch(false, true); }
@Before public void setUp() throws Exception { StartMiniClusterOption option = StartMiniClusterOption.builder() .numMasters(2).numRegionServers(2).build(); TEST_UTIL.startMiniHBaseCluster(option); }
@Before public void setup() throws Exception { setupConf(UTIL.getConfiguration()); // Set master number and use default values for other options. StartMiniClusterOption option = StartMiniClusterOption.builder().numMasters(2).build(); UTIL.startMiniCluster(option); final ProcedureExecutor<MasterProcedureEnv> procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExec, false); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExec, false); }
/** * Start up a minicluster of hbase, dfs and zookeeper all using default options. * Option default value can be found in {@link StartMiniClusterOption.Builder}. * @see #startMiniCluster(StartMiniClusterOption option) * @see #shutdownMiniDFSCluster() */ public MiniHBaseCluster startMiniCluster() throws Exception { return startMiniCluster(StartMiniClusterOption.builder().build()); }
/** * Start up a minicluster of hbase, dfs and zookeeper clusters with given slave node number. * All other options will use default values, defined in {@link StartMiniClusterOption.Builder}. * @param numSlaves slave node number, for both HBase region server and HDFS data node. * @see #startMiniCluster(StartMiniClusterOption option) * @see #shutdownMiniDFSCluster() */ public MiniHBaseCluster startMiniCluster(int numSlaves) throws Exception { StartMiniClusterOption option = StartMiniClusterOption.builder() .numRegionServers(numSlaves).numDataNodes(numSlaves).build(); return startMiniCluster(option); }
/** * Starts up mini hbase cluster using default options. * Default options can be found in {@link StartMiniClusterOption.Builder}. * @see #startMiniHBaseCluster(StartMiniClusterOption) * @see #shutdownMiniHBaseCluster() */ public MiniHBaseCluster startMiniHBaseCluster() throws IOException, InterruptedException { return startMiniHBaseCluster(StartMiniClusterOption.builder().build()); }
@Before public void setUp() throws Exception { // Use 2 DataNodes and default values for other StartMiniCluster options. TEST_UTIL.startMiniCluster(StartMiniClusterOption.builder().numDataNodes(2).build()); cluster = TEST_UTIL.getHBaseCluster(); dfsCluster = TEST_UTIL.getDFSCluster(); fs = TEST_UTIL.getTestFileSystem(); admin = TEST_UTIL.getAdmin(); // disable region rebalancing (interferes with log watching) cluster.getMaster().balanceSwitch(false); }
@BeforeClass public static void setupTest() throws Exception { // Set createWALDir to true and use default values for other options. UTIL.startMiniCluster(StartMiniClusterOption.builder().createWALDir(true).build()); }
public void setupCluster() throws Exception { setupConf(UTIL.getConfiguration()); StartMiniClusterOption option = StartMiniClusterOption.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()); }
@BeforeClass public static void setUp() throws Exception { UTIL.getConfiguration().setClass(HConstants.MASTER_IMPL, HMasterForTest.class, HMaster.class); UTIL .startMiniCluster(StartMiniClusterOption.builder().numMasters(2).numRegionServers(2).build()); UTIL.createTable(NAME, CF); UTIL.waitTableAvailable(NAME); UTIL.getAdmin().balancerSwitch(false, true); }
public void setupCluster() throws Exception { setupConf(UTIL.getConfiguration()); StartMiniClusterOption option = StartMiniClusterOption.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()); }
@Before public void setup() throws Exception { setupConf(UTIL.getConfiguration()); StartMiniClusterOption option = StartMiniClusterOption.builder() .numMasters(2).numRegionServers(3).numDataNodes(3).build(); UTIL.startMiniCluster(option); }
@BeforeClass public static void beforeAllTests() throws Exception { // Start a cluster StartMiniClusterOption option = StartMiniClusterOption.builder() .masterClass(MyMaster.class).numRegionServers(NB_SERVERS).numDataNodes(NB_SERVERS).build(); TEST_UTIL.startMiniCluster(option); MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); MASTER = cluster.getMaster(); MASTER.balanceSwitch(false); ADMIN = TEST_UTIL.getConnection().getAdmin(); }
@BeforeClass public static void setUpBeforeClass() throws Exception { StartMiniClusterOption option = StartMiniClusterOption.builder() .numRegionServers(3).rsClass(MyRegionServer.class).numDataNodes(3).build(); TEST_UTIL.startMiniCluster(option); }