Search in sources :

Example 1 with MasterGoalState

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());
}
Also used : MasterMonitorInfo(org.apache.accumulo.core.master.thrift.MasterMonitorInfo) MasterGoalState(org.apache.accumulo.core.master.thrift.MasterGoalState) MasterState(org.apache.accumulo.core.master.thrift.MasterState) Test(org.junit.Test)

Aggregations

MasterGoalState (org.apache.accumulo.core.master.thrift.MasterGoalState)1 MasterMonitorInfo (org.apache.accumulo.core.master.thrift.MasterMonitorInfo)1 MasterState (org.apache.accumulo.core.master.thrift.MasterState)1 Test (org.junit.Test)1