Search in sources :

Example 1 with Cancellable

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;
    }
}
Also used : IgniteException(org.apache.ignite.lang.IgniteException) Cancellable(org.apache.ignite.internal.util.Cancellable) IgniteException(org.apache.ignite.lang.IgniteException)

Aggregations

Cancellable (org.apache.ignite.internal.util.Cancellable)1 IgniteException (org.apache.ignite.lang.IgniteException)1