use of org.smartdata.SmartServiceState in project SSM by Intel-bigdata.
the class IntegrationSmartServer method waitTillSSMExitSafeMode.
private 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--;
}
}
}
use of org.smartdata.SmartServiceState in project SSM by Intel-bigdata.
the class MiniSmartClusterHarness method waitTillSSMExitSafeMode.
public void waitTillSSMExitSafeMode() throws Exception {
SmartAdmin client = new SmartAdmin(smartContext.getConf());
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