use of org.apache.accumulo.core.master.thrift.MasterGoalState in project accumulo by apache.
the class MiniAccumuloClusterImplTest method saneMonitorInfo.
@Test(timeout = 60000)
public void saneMonitorInfo() throws Exception {
MasterMonitorInfo stats;
while (true) {
stats = accumulo.getMasterMonitorInfo();
if (stats.tableMap.size() <= 2) {
continue;
}
if (null != stats.tServerInfo && stats.tServerInfo.size() == NUM_TSERVERS) {
break;
}
}
List<MasterState> validStates = Arrays.asList(MasterState.values());
List<MasterGoalState> validGoals = Arrays.asList(MasterGoalState.values());
Assert.assertTrue("master state should be valid.", validStates.contains(stats.state));
Assert.assertTrue("master goal state should be in " + validGoals + ". is " + stats.goalState, validGoals.contains(stats.goalState));
Assert.assertNotNull("should have a table map.", stats.tableMap);
Assert.assertTrue("root table should exist in " + stats.tableMap.keySet(), stats.tableMap.keySet().contains(RootTable.ID.canonicalID()));
Assert.assertTrue("meta table should exist in " + stats.tableMap.keySet(), stats.tableMap.keySet().contains(MetadataTable.ID.canonicalID()));
Assert.assertTrue("our test table should exist in " + stats.tableMap.keySet(), stats.tableMap.keySet().contains(testTableID));
Assert.assertNotNull("there should be tservers.", stats.tServerInfo);
Assert.assertEquals(NUM_TSERVERS, stats.tServerInfo.size());
}
Aggregations