use of com.baidu.hugegraph.job.EphemeralJob in project incubator-hugegraph by apache.
the class HugeTask method syncWait.
public void syncWait() {
// This method is just called by tests
HugeTask<?> task = null;
try {
task = this.scheduler().waitUntilTaskCompleted(this.id());
} catch (Throwable e) {
if (this.callable() instanceof EphemeralJob && e.getClass() == NotFoundException.class && e.getMessage().contains("Can't find task with id")) {
/*
* The task with EphemeralJob won't saved in backends and
* will be removed from memory when completed
*/
return;
}
throw new HugeException("Failed to wait for task '%s' completed", e, this.id);
}
assert task != null;
/*
* This can be enabled for debug to expose schema-clear errors early,
* but also lead to some negative tests failed,
*/
boolean debugTest = false;
if (debugTest && !task.success()) {
throw new HugeException("Task '%s' is failed with error: %s", task.id(), task.result());
}
}
Aggregations