@Override public List<RegionPlan> balanceCluster(Map<ServerName, List<RegionInfo>> clusterState) throws HBaseIOException { if (!isOnline()) { throw new ConstraintException(RSGroupInfoManager.RSGROUP_TABLE_NAME + " is not online, unable to perform balance");
@Test public void testEnableRSGroup() throws IOException, InterruptedException { TEST_UTIL.getMiniHBaseCluster().stopMaster(0); TEST_UTIL.getMiniHBaseCluster().waitOnMaster(0); LOG.info("stopped master..."); final Configuration conf = TEST_UTIL.getMiniHBaseCluster().getConfiguration(); conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, RSGroupAdminEndpoint.class.getName()); conf.set(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, RSGroupBasedLoadBalancer.class.getName()); TEST_UTIL.getMiniHBaseCluster().startMaster(); TEST_UTIL.getMiniHBaseCluster().waitForActiveAndReadyMaster(60000); LOG.info("started master..."); // check if master started successfully assertTrue(TEST_UTIL.getMiniHBaseCluster().getMaster() != null); // wait RSGroupBasedLoadBalancer online RSGroupBasedLoadBalancer loadBalancer = (RSGroupBasedLoadBalancer) TEST_UTIL.getMiniHBaseCluster().getMaster().getLoadBalancer(); long start = System.currentTimeMillis(); while (System.currentTimeMillis() - start <= 60000 && !loadBalancer.isOnline()) { LOG.info("waiting for rsgroup load balancer onLine..."); sleep(200); } assertTrue(loadBalancer.isOnline()); }
@Override public List<RegionPlan> balanceCluster(Map<ServerName, List<RegionInfo>> clusterState) throws HBaseIOException { if (!isOnline()) { throw new ConstraintException(RSGroupInfoManager.RSGROUP_TABLE_NAME + " is not online, unable to perform balance");
@Override public List<RegionPlan> balanceCluster(Map<ServerName, List<RegionInfo>> clusterState) throws HBaseIOException { if (!isOnline()) { throw new ConstraintException(RSGroupInfoManager.RSGROUP_TABLE_NAME + " is not online, unable to perform balance");
@Test public void testEnableRSGroup() throws IOException, InterruptedException { TEST_UTIL.getMiniHBaseCluster().stopMaster(0); TEST_UTIL.getMiniHBaseCluster().waitOnMaster(0); LOG.info("stopped master..."); final Configuration conf = TEST_UTIL.getMiniHBaseCluster().getConfiguration(); conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, RSGroupAdminEndpoint.class.getName()); conf.set(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, RSGroupBasedLoadBalancer.class.getName()); TEST_UTIL.getMiniHBaseCluster().startMaster(); TEST_UTIL.getMiniHBaseCluster().waitForActiveAndReadyMaster(60000); LOG.info("started master..."); // check if master started successfully assertTrue(TEST_UTIL.getMiniHBaseCluster().getMaster() != null); // wait RSGroupBasedLoadBalancer online RSGroupBasedLoadBalancer loadBalancer = (RSGroupBasedLoadBalancer) TEST_UTIL.getMiniHBaseCluster().getMaster().getLoadBalancer(); long start = System.currentTimeMillis(); while (System.currentTimeMillis() - start <= 60000 && !loadBalancer.isOnline()) { LOG.info("waiting for rsgroup load balancer onLine..."); sleep(200); } assertTrue(loadBalancer.isOnline()); }