use of org.smartdata.common.SmartServiceState in project SSM by Intel-bigdata.
the class TestEmptyMiniSmartCluster method waitTillSSMExitSafeMode.
public void waitTillSSMExitSafeMode() throws Exception {
SmartAdmin client = new SmartAdmin(conf);
long start = System.currentTimeMillis();
int retry = 5;
while (true) {
try {
SmartServiceState state = client.getServiceState();
if (state != SmartServiceState.SAFEMODE) {
break;
}
int secs = (int) (System.currentTimeMillis() - start) / 1000;
System.out.println("Waited for " + secs + " seconds ...");
Thread.sleep(1000);
} catch (Exception e) {
if (retry <= 0) {
throw e;
}
retry--;
}
}
}
Aggregations