/** {@inheritDoc} */ @Override public Throwable error() { return fut.error(); }
@Override public void apply(IgniteInternalFuture<?> t) { boolean rmv = activeFuts.remove(t); assert rmv; Throwable err = t.error(); if (err != null && !(err instanceof IgniteClientDisconnectedCheckedException)) { LT.error(log, t.error(), "DataStreamer operation failed.", true); failCntr.increment(); synchronized (DataStreamerImpl.this) { if(cancellationReason == null) cancellationReason = err; cancelled = true; } } } };
@Override public void apply(IgniteInternalFuture<GridNioSession> fut) { if (fut.error() != null) finish(false); } });
@Override public void apply(IgniteInternalFuture<MetadataUpdateResult> doneFut) { fut.onDone(doneFut.result(), doneFut.error()); } });
@Override public void apply(IgniteInternalFuture<Long> fut) { assert fut.error() != null || fut.result() != null : fut; try { clearLocalFuture((GridDhtTxQueryEnlistFuture)fut); GridNearTxQueryEnlistResponse res = fut.error() == null ? createResponse(fut) : null; localMini.onResult(res, fut.error()); } catch (IgniteCheckedException e) { localMini.onResult(null, e); } finally { CU.unwindEvicts(cctx); } } });
@Override public void apply(IgniteInternalFuture<Long> fut) { assert fut.error() != null || fut.result() != null : fut; try { clearLocalFuture((GridDhtTxAbstractEnlistFuture)fut); GridNearTxQueryResultsEnlistResponse res = fut.error() == null ? createResponse(fut) : null; if (checkResponse(nodeId, res, fut.error())) sendNextBatches(nodeId); } catch (IgniteCheckedException e) { checkResponse(nodeId, null, e); } finally { CU.unwindEvicts(cctx); } } });
@Override public void apply(IgniteInternalFuture<GridCacheReturn> fut) { try { clearLocalFuture((GridDhtTxAbstractEnlistFuture)fut); GridNearTxEnlistResponse res = fut.error() == null ? createResponse(fut) : null; if (checkResponse(nodeId, res, fut.error())) sendNextBatches(nodeId); } catch (IgniteCheckedException e) { checkResponse(nodeId, null, e); } finally { CU.unwindEvicts(cctx); } } });
/** * @param fut Completed future to finish this process with. */ private void onResult(IgniteInternalFuture<Map<KeyCacheObject, EntryGetResult>> fut) { assert fut.isDone(); if (fut.error() != null) onDone(fut.error()); else { try { onDone(toEntryInfo(fut.get())); } catch (IgniteCheckedException ignored) { assert false; // Should never happen. } } }
@Override public void apply(IgniteInternalFuture<Boolean> fut) { Throwable e = fut.error(); if (e != null) { onDone(e); return; } IgniteInternalFuture<Map<KeyCacheObject, EntryGetResult>> fut0 = cache().getDhtAllAsync( Collections.singleton(key), args, readThrough, subjId, taskName, expiryPlc, skipVals, recovery, null, mvccSnapshot); fut0.listen(createGetFutureListener()); } }
@Override public void apply(IgniteInternalFuture<Object> fut) { Throwable e = fut.error(); if (e != null) { // Check error first. if (log.isDebugEnabled()) log.debug("Failed to request keys from preloader " + "[keys=" + key + ", err=" + e + ']'); if (e instanceof NodeStoppingException) return; onDone(e); } else map0(true); } }
@Override public String apply(IgniteInternalFuture<?> f) { if (isMini(f)) { return "[node=" + ((MiniFuture)f).primary().id() + ", loc=" + ((MiniFuture)f).primary().isLocal() + ", done=" + f.isDone() + ", err=" + f.error() + "]"; } else return f.toString(); } });
@Override public void apply(IgniteInternalFuture fut) { idxRebuildFuts.remove(cacheId, usrFut); Throwable err = fut.error(); usrFut.onDone(err); CacheConfiguration ccfg = cacheCtx.config(); if (ccfg != null) { if (err == null) log().info("Finished indexes rebuilding for cache [name=" + ccfg.getName() + ", grpName=" + ccfg.getGroupName() + ']'); else { if (!(err instanceof NodeStoppingException)) log().error("Failed to rebuild indexes for cache [name=" + ccfg.getName() + ", grpName=" + ccfg.getGroupName() + ']', err); } } } });
/** */ private void onFinishFutureDone(IgniteInternalFuture<IgniteInternalTx> fut) { GridNearTxLocal tx = tx(); Throwable err = fut.error(); if (tx.state() == TransactionState.COMMITTED) tx.context().coordinators().ackTxCommit(tx.mvccSnapshot()) .listen(fut0 -> onDone(tx, addSuppressed(err, fut0.error()))); else { tx.context().coordinators().ackTxRollback(tx.mvccSnapshot()); onDone(tx, err); } }
/** * @param nodeId Node ID. * @param req Request. * @return Future. */ @Nullable private IgniteInternalFuture<IgniteInternalTx> processNearTxFinishRequest( UUID nodeId, GridNearTxFinishRequest req ) { if (txFinishMsgLog.isDebugEnabled()) txFinishMsgLog.debug("Received near finish request [txId=" + req.version() + ", node=" + nodeId + ']'); IgniteInternalFuture<IgniteInternalTx> fut = finish(nodeId, null, req); assert req.txState() != null || fut == null || fut.error() != null || (ctx.tm().tx(req.version()) == null && ctx.tm().nearTx(req.version()) == null) : "[req=" + req + ", fut=" + fut + "]"; return fut; }
/** * @param nearNode Sender node. * @param req Request. */ private void processNearTxPrepareRequest0(ClusterNode nearNode, GridNearTxPrepareRequest req) { IgniteInternalFuture<GridNearTxPrepareResponse> fut; if (req.firstClientRequest() && req.allowWaitTopologyFuture()) { for (;;) { if (waitForExchangeFuture(nearNode, req)) return; fut = prepareNearTx(nearNode, req); if (fut != null) break; } } else fut = prepareNearTx(nearNode, req); assert req.txState() != null || fut == null || fut.error() != null || (ctx.tm().tx(req.version()) == null && ctx.tm().nearTx(req.version()) == null); }