boolean completed = jobComplete.apply(job.getJobId());
logger.trace("<< job(%s) complete(%s)", job, completed);
AsyncJob<T> jobWithResult = client.getAsyncJobClient().<T> getAsyncJob(job.getJobId());
checkState(completed, "job %s failed to complete in time %s", job.getJobId(), jobWithResult);
if (jobWithResult.getError() != null)
throw new UncheckedExecutionException(String.format("job %s failed with exception %s", job.getJobId(),
jobWithResult.getError().toString())) {
};
return jobWithResult.getResult();
}