return properties;
}
protected YarnApplicationState waitState(ApplicationId applicationId, long timeout, TimeUnit unit,
YarnApplicationState... applicationStates) throws Exception {
YarnApplicationState state = null;
long end = System.currentTimeMillis() + unit.toMillis(timeout);
// break label for inner loop
done: do {
state = findState(getYarnClient(), applicationId);
if (state == null) {
break;
}
for (YarnApplicationState stateCheck : applicationStates) {
if (state.equals(stateCheck)) {
break done;
}
}
Thread.sleep(1000);
} while (System.currentTimeMillis() < end);