/** * Shortcut method that creates an instance of {@link GridClosureException}. * * @param e Exception to wrap. * @return Newly created instance of {@link GridClosureException}. */ public static GridClosureException wrap(Throwable e) { return new GridClosureException(e); }
@Override public T apply(IgniteInternalFuture<IgniteInternalTx> f) { throw new GridClosureException(e); } });
@Override public T apply(IgniteInternalFuture<IgniteInternalTx> f) { throw new GridClosureException(ex); } });
@Override public T apply(IgniteInternalFuture<V> fut) { assert IgniteFutureImpl.this.fut == fut; try { return doneCb.apply(IgniteFutureImpl.this); } catch (Exception e) { throw new GridClosureException(e); } } };
@Override public IgniteInternalFuture<Map<KeyCacheObject, EntryGetResult>> apply(Boolean b, Exception e) { if (e != null) throw new GridClosureException(e); return cache().getDhtAllAsync( keys.keySet(), args, readThrough, subjId, taskName, expiryPlc, skipVals, recovery, txLbl, mvccSnapshot); } }
/** {@inheritDoc} */ @Override public final IgniteInternalFuture<T> apply(T t, Exception e) { boolean rollback = true; try { if (e != null) throw new GridClosureException(e); IgniteInternalFuture<T> fut = postMiss(t); rollback = false; return fut; } catch (IgniteCheckedException ex) { throw new GridClosureException(ex); } finally { if (rollback) setRollbackOnly(); } }
@Override public Void apply(IgniteInternalFuture<Map<Object, Object>> f) { try { Map<Object, Object> map = f.get(); processLoaded(map, keys, needVer, c); return null; } catch (Exception e) { setRollbackOnly(); throw new GridClosureException(e); } } });
@Override public Void apply(IgniteInternalFuture<Map<Object, Object>> f) { try { Map<Object, Object> map = f.get(); processLoaded(map, keys, needVer, c); return null; } catch (Exception e) { setRollbackOnly(); throw new GridClosureException(e); } } });
@Override public Void apply(IgniteInternalFuture<Object> f) { try { Object val = f.get(); processLoaded(key, val, needVer, skipVals, c); return null; } catch (Exception e) { setRollbackOnly(); throw new GridClosureException(e); } } });
/** {@inheritDoc} */ @Override public final T apply(T t, @Nullable Exception e) { boolean rollback = true; try { if (e != null) throw new GridClosureException(e); t = finish(t); // Commit implicit transactions. if (implicit()) commit(); rollback = false; return t; } catch (IgniteCheckedException ex) { throw new GridClosureException(ex); } finally { if (rollback) setRollbackOnly(); } }
/** {@inheritDoc} */ @Override public final IgniteInternalFuture<T> apply(Boolean locked, @Nullable Exception e) { boolean rollback = true; try { if (e != null) throw new GridClosureException(e); if (!locked) throw new GridClosureException(new IgniteTxTimeoutCheckedException("Failed to acquire lock " + "within provided timeout for transaction [timeout=" + timeout() + ", tx=" + CU.txString(IgniteTxLocalAdapter.this) + ']')); IgniteInternalFuture<T> fut = postLock(); rollback = false; return fut; } catch (IgniteCheckedException ex) { throw new GridClosureException(ex); } finally { if (rollback) setRollbackOnly(); } }
@Override public Map<K, V> apply(Void v, Exception e) { if (e != null) { setRollbackOnly(); throw new GridClosureException(e); } if (isRollbackOnly()) { if (timedOut()) throw new GridClosureException(new IgniteTxTimeoutCheckedException( "Transaction has been timed out: " + GridNearTxLocal.this)); else throw new GridClosureException(new IgniteTxRollbackCheckedException( "Transaction has been rolled back: " + GridNearTxLocal.this)); } return map; } },
@Override public T apply(IgniteInternalFuture<IgfsMessage> fut) { try { IgfsControlResponse res = (IgfsControlResponse)fut.get(); if (res.hasError()) res.throwError(); return (T)res.response(); } catch (IgfsException | IgniteCheckedException e) { throw new GridClosureException(e); } } };
return rollbackAsync().chain(new C1<IgniteInternalFuture<IgniteInternalTx>, T>() { @Override public T apply(IgniteInternalFuture<IgniteInternalTx> f) { throw new GridClosureException(e); throw new GridClosureException(e); setRollbackOnly(); final GridClosureException ex = new GridClosureException( new IgniteTxTimeoutCheckedException("Failed to acquire lock within provided timeout " + "for transaction [timeout=" + timeout() + ", tx=" + CU.txString(IgniteTxLocalAdapter.this) + return rollbackAsync().chain(new C1<IgniteInternalFuture<IgniteInternalTx>, T>() { @Override public T apply(IgniteInternalFuture<IgniteInternalTx> f) { throw new GridClosureException(ex); throw new GridClosureException(ex);
/** {@inheritDoc} */ @Override public void apply(IgniteInternalFuture<GridCacheReturn> fut0) { GridDhtTxAbstractEnlistFuture fut = (GridDhtTxAbstractEnlistFuture)fut0; GridCacheContext<?, ?> cctx = fut.cctx; GridDhtTxLocal tx = (GridDhtTxLocal)fut.tx; UUID nearNodeId = fut.nearNodeId; GridNearTxEnlistResponse res = createResponse(fut); try { cctx.io().send(nearNodeId, res, cctx.ioPolicy()); } catch (IgniteCheckedException e) { U.error(fut.log, "Failed to send near enlist response (will rollback transaction) [" + "tx=" + CU.txString(tx) + ", node=" + nearNodeId + ", res=" + res + ']', e); try { tx.rollbackDhtLocalAsync(); } catch (Throwable e1) { e.addSuppressed(e1); } throw new GridClosureException(e); } } }
", res=" + res + ']', e); throw new GridClosureException(e); throw new GridClosureException(e);
throw new GridClosureException(e);
throw new GridClosureException(e);
ex = new GridClosureException(e);
/** * Shortcut method that creates an instance of {@link GridClosureException}. * * @param e Exception to wrap. * @return Newly created instance of {@link GridClosureException}. */ public static GridClosureException wrap(Throwable e) { return new GridClosureException(e); }