/** * Task map callback. */ public void onMapped() { ((GridFutureAdapter)mapFut.internalFuture()).onDone(); }
/** */ private void completeWithException(GridFutureAdapter fut, Throwable e) { fut.onDone(e); if (e instanceof Error) throw (Error)e; }
/** * @param err Error. */ public IgniteFinishedFutureImpl(Throwable err) { super(new GridFinishedFuture<V>(err)); }
@Override public Object call() throws Exception { GridFutureAdapter<String> fut = new GridFutureAdapter<>(); fut.onCancelled(); return fut.get(); } }, IgniteFutureCancelledCheckedException.class, null);
/** * Synchronously waits for completion of the task for up to the given timeout. * * @param timeout The maximum time to wait in milliseconds. * @throws IgniteCheckedException In case of an error. */ protected void waitForComplete(long timeout) throws IgniteCheckedException { completeStateFut.get(timeout); }
@Override public Void call() throws Exception { fut.get(); return null; } }, expectedException(), "test error");
/** {@inheritDoc} */ @Override public <T> IgniteInternalFuture<T> chain( IgniteClosure<? super IgniteInternalFuture<R>, T> doneCb, Executor exec ) { ChainFuture<R, T> fut = new ChainFuture<>(this, doneCb, exec); if (ignoreInterrupts) fut.ignoreInterrupts(); return fut; }
/** * @return Futures size. */ private synchronized int futuresCount() { return futuresCountNoLock(); }
/** * Finish task callback. */ public void onDone() { ((GridFutureAdapter)mapFut.internalFuture()).onDone(); }
/** * @param err Error. */ public IgniteFinishedCacheFutureImpl(Throwable err) { super(new GridFinishedFuture<V>(err)); } }
/** * @throws IgniteCheckedException If failed. */ void waitFirstReconnect() throws IgniteCheckedException { firstReconnectFut.get(); }
@Override public Void call() throws Exception { fut.get(); return null; } }, expectedException(), null);
/** {@inheritDoc} */ @Override public void completed(Integer res, AsyncFileIO attach) { if (attach != null) { if (res != -1) attach.position += res; } // Release waiter and allow next operation to begin. super.onDone(res, null); }
/** {@inheritDoc} */ @Override public void onCreated(Iterable<CacheEntryEvent<? extends Integer, ? extends String>> evts) { (((GridFutureAdapter)((IgniteFutureImpl)res).internalFuture())).onDone("by listener"); } }
/** * Callback to notify that future is finished with {@code null} result. * This method must delegate to {@link #onDone(Object, Throwable)} method. * * @return {@code True} if result was set by this call. */ public final boolean onDone() { return onDone(null, null); }
/** * Callback to notify that future is cancelled. * * @return {@code True} if cancel flag was set by this call. */ public boolean onCancelled() { return onDone(null, null, true); }
/** * Completes current latch. */ void complete() { complete.onDone(); }
/** * Callback invoked on shuffle finish response. */ public void onShuffleFinishResponse() { fut.onDone(); }