use of org.apache.ignite.internal.util.Cancellable in project ignite-3 by apache.
the class QueryCancel method cancel.
/**
* Executes cancel closure.
*/
public synchronized void cancel() {
if (canceled) {
return;
}
canceled = true;
IgniteException ex = null;
// Run actions in the reverse order.
for (int i = cancelActions.size() - 1; i >= 0; i--) {
try {
Cancellable act = cancelActions.get(i);
act.cancel();
} catch (Exception e) {
if (ex == null) {
ex = new IgniteException(e);
} else {
ex.addSuppressed(e);
}
}
}
if (ex != null) {
throw ex;
}
}
Aggregations