}
}
private void awaitUp(final String host) throws TimeoutException {
final TaskStatus status = Polling.awaitUnchecked(
TIMEOUT_MILLIS, MILLISECONDS, new Callable<TaskStatus>() {
@Override
public TaskStatus call() throws Exception {
final JobStatus status = Futures.getUnchecked(client.jobStatus(job.getId()));
if (status == null) {
log.debug("Job status not available");
return null;
}
final TaskStatus taskStatus = status.getTaskStatuses().get(host);
if (taskStatus == null) {
log.debug("Task status not available on {}", host);
return null;
}
verifyHealthy(host, taskStatus);
final TaskStatus.State state = taskStatus.getState();
log.info("Job state of {}: {}", job.getImage(), state);
if (state == TaskStatus.State.RUNNING) {
return taskStatus;
}