/** * @return cluster status */ public ClusterMetrics getClusterMetrics() throws IOException { return getClusterMetrics(EnumSet.allOf(Option.class)); }
@Override public long getLastMajorCompactionTimestamp(TableName table) throws IOException { return getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS)) .getLastMajorCompactionTimestamp(table); }
@Override public long getLastMajorCompactionTimestampForRegion(byte[] regionName) throws IOException { return getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS)) .getLastMajorCompactionTimestamp(regionName); }
@Override public ClusterMetrics getClusterMetrics() throws IOException { HMaster master = getMaster(); return master == null ? null : master.getClusterMetrics(); }
/** * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * Use {@link #getClusterMetrics()} instead. */ @Deprecated public ClusterStatus getClusterStatus() throws IOException { HMaster master = getMaster(); return master == null ? null : new ClusterStatus(master.getClusterMetrics()); }
private void waitUntilRegionServerDead() throws InterruptedException, IOException { // Wait until the master processes the RS shutdown for (int i=0; (cluster.getMaster().getClusterMetrics() .getLiveServerMetrics().size() > NB_SERVERS || cluster.getLiveRegionServerThreads().size() > NB_SERVERS) && i<100; i++) { LOG.info("Waiting on server to go down"); Thread.sleep(100); } assertFalse("Waited too long for RS to die", cluster.getMaster().getClusterMetrics(). getLiveServerMetrics().size() > NB_SERVERS || cluster.getLiveRegionServerThreads().size() > NB_SERVERS); }
@Override public GetClusterStatusResponse getClusterStatus(RpcController controller, GetClusterStatusRequest req) throws ServiceException { GetClusterStatusResponse.Builder response = GetClusterStatusResponse.newBuilder(); try { master.checkInitialized(); response.setClusterStatus(ClusterMetricsBuilder.toClusterStatus( master.getClusterMetrics(ClusterMetricsBuilder.toOptions(req.getOptionsList())))); } catch (IOException e) { throw new ServiceException(e); } return response.build(); }
HMaster active = cluster.getMaster(); ClusterMetrics clusterStatus = active.getClusterMetrics(); assertTrue(clusterStatus.getBalancerOn()); clusterStatus = active.getClusterMetrics(); assertTrue(clusterStatus.getBalancerOn()); clusterStatus = active.getClusterMetrics(); assertFalse(clusterStatus.getBalancerOn());
ClusterMetrics status = active.getClusterMetrics(); assertEquals(2, status.getBackupMasterNames().size());
ClusterMetrics status = active.getClusterMetrics(); assertTrue(status.getMasterName().equals(activeName)); assertEquals(2, status.getBackupMasterNames().size()); int rsCount = masterThreads.get(activeIndex).getMaster().getClusterMetrics() .getLiveServerMetrics().size(); LOG.info("Active master " + active.getServerName() + " managing " + rsCount + status = active.getClusterMetrics(); assertTrue(status.getMasterName().equals(activeName)); assertEquals(1, status.getBackupMasterNames().size()); status = active.getClusterMetrics(); ServerName mastername = status.getMasterName(); assertTrue(mastername.equals(active.getServerName()));
@BeforeClass public static void setUpBeforeClass() throws Exception { cluster = TEST_UTIL.startMiniCluster(ServerNum); table = TEST_UTIL.createTable(tableName, FAMILY, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); TEST_UTIL.waitTableAvailable(tableName, 1000); TEST_UTIL.loadTable(table, FAMILY); for (int i = 0; i < ServerNum; i++) { HRegionServer server = cluster.getRegionServer(i); for (HRegion region : server.getRegions(tableName)) { region.flush(true); } } finder.setConf(TEST_UTIL.getConfiguration()); finder.setServices(cluster.getMaster()); finder.setClusterMetrics(cluster.getMaster().getClusterMetrics()); }
LOG.info("Found " + firstGoodPair.toString()); Collection<ServerName> servers = master.getClusterMetrics().getLiveServerMetrics().keySet(); String destName = null; String serverNameForFirstRegion = firstGoodPair.getServerName().toString();
@Override public ClusterMetrics getClusterMetrics() throws IOException { HMaster master = getMaster(); return master == null ? null : master.getClusterMetrics(); }
/** * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * Use {@link #getClusterMetrics()} instead. */ @Deprecated public ClusterStatus getClusterStatus() throws IOException { HMaster master = getMaster(); return master == null ? null : new ClusterStatus(master.getClusterMetrics()); }
private void waitUntilRegionServerDead() throws InterruptedException, IOException { // Wait until the master processes the RS shutdown for (int i=0; (cluster.getMaster().getClusterMetrics() .getLiveServerMetrics().size() > NB_SERVERS || cluster.getLiveRegionServerThreads().size() > NB_SERVERS) && i<100; i++) { LOG.info("Waiting on server to go down"); Thread.sleep(100); } assertFalse("Waited too long for RS to die", cluster.getMaster().getClusterMetrics(). getLiveServerMetrics().size() > NB_SERVERS || cluster.getLiveRegionServerThreads().size() > NB_SERVERS); }
ClusterMetrics status = active.getClusterMetrics(); assertEquals(2, status.getBackupMasterNames().size());
HMaster active = cluster.getMaster(); ClusterMetrics clusterStatus = active.getClusterMetrics(); assertTrue(clusterStatus.getBalancerOn()); clusterStatus = active.getClusterMetrics(); assertTrue(clusterStatus.getBalancerOn()); clusterStatus = active.getClusterMetrics(); assertFalse(clusterStatus.getBalancerOn());
ClusterMetrics status = active.getClusterMetrics(); assertTrue(status.getMasterName().equals(activeName)); assertEquals(2, status.getBackupMasterNames().size()); int rsCount = masterThreads.get(activeIndex).getMaster().getClusterMetrics() .getLiveServerMetrics().size(); LOG.info("Active master " + active.getServerName() + " managing " + rsCount + status = active.getClusterMetrics(); assertTrue(status.getMasterName().equals(activeName)); assertEquals(1, status.getBackupMasterNames().size()); status = active.getClusterMetrics(); ServerName mastername = status.getMasterName(); assertTrue(mastername.equals(active.getServerName()));
@BeforeClass public static void setUpBeforeClass() throws Exception { cluster = TEST_UTIL.startMiniCluster(1, ServerNum); table = TEST_UTIL.createTable(tableName, FAMILY, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); TEST_UTIL.waitTableAvailable(tableName, 1000); TEST_UTIL.loadTable(table, FAMILY); for (int i = 0; i < ServerNum; i++) { HRegionServer server = cluster.getRegionServer(i); for (HRegion region : server.getRegions(tableName)) { region.flush(true); } } finder.setConf(TEST_UTIL.getConfiguration()); finder.setServices(cluster.getMaster()); finder.setClusterMetrics(cluster.getMaster().getClusterMetrics()); }
LOG.info("Found " + firstGoodPair.toString()); Collection<ServerName> servers = master.getClusterMetrics().getLiveServerMetrics().keySet(); String destName = null; String serverNameForFirstRegion = firstGoodPair.getServerName().toString();