/** * Checks if there are pending futures. This is not the same as * {@link #isDone()} because child classes may override {@link #onDone(Object, Throwable)} * call and delay completion. * * @return {@code True} if there are pending futures. */ protected final boolean hasPending() { synchronized (this) { int size = futuresCountNoLock(); // Avoid iterator creation and collection copy. for (int i = 0; i < size; i++) { IgniteInternalFuture<T> fut = future(i); if (!fut.isDone()) return true; } } return false; }
/** * Checks if there are pending futures. This is not the same as * {@link #isDone()} because child classes may override {@link #onDone(Object, Throwable)} * call and delay completion. * * @return {@code True} if there are pending futures. */ @SuppressWarnings("ForLoopReplaceableByForEach") protected final boolean hasPending() { synchronized (this) { int size = futuresCountNoLock(); // Avoid iterator creation and collection copy. for (int i = 0; i < size; i++) { IgniteInternalFuture<T> fut = future(i); if (!fut.isDone()) return true; } } return false; }