/** {@inheritDoc} */ @Override public String toString() { return getClass() + ": " + getMessage(); } }
/** * @param e Error if occurred. */ public void error(IgniteCheckedException e) { err = e.getMessage(); errCode = errorCode(e); }
@Override public IgniteException apply(IgniteCheckedException e) { return new TransactionRollbackException(e.getMessage(), e); } });
@Override public IgniteException apply(IgniteCheckedException e) { return new IgniteFutureCancelledException(e.getMessage(), e); } });
@Override public IgniteException apply(IgniteCheckedException e) { return new ClusterGroupEmptyException(e.getMessage(), e); } });
@Override public IgniteException apply(IgniteCheckedException e) { return new IgniteDeploymentException(e.getMessage(), e); } });
/** */ private void verifyException(IgniteCheckedException e) throws Exception { String msg = e.getMessage(); if (msg == null || !msg.contains("Class name is null")) throw new Exception("Exception with unexpected message was thrown: " + msg, e); }
@Override public IgniteException apply(IgniteCheckedException e) { return new IgniteInterruptedException(e.getMessage(), (InterruptedException)e.getCause()); } });
@Override public void apply(IgniteInternalFuture<?> fut) { try { fut.get(); } catch (IgniteCheckedException e) { U.error(log, e.getMessage(), e); } } };
@Override public IgniteException apply(IgniteCheckedException e) { if (e.getCause() instanceof TransactionDeadlockException) return new TransactionTimeoutException(e.getMessage(), e.getCause()); return new TransactionTimeoutException(e.getMessage(), e); } });
/** {@inheritDoc} */ @Override public void disableStatistics() { try { cache.context().shared().cache().enableStatistics(Collections.singleton(cache.name()), false); } catch (IgniteCheckedException e) { throw new RuntimeException(e.getMessage()); } } }
/** {@inheritDoc} */ @Override public void enableStatistics() { try { cache.context().shared().cache().enableStatistics(Collections.singleton(cache.name()), true); } catch (IgniteCheckedException e) { throw new RuntimeException(e.getMessage()); } }
@Override public void apply(IgniteInternalFuture<?> f) { try { f.get(); // Check for errors of a parent future. } catch (IgniteCheckedException e) { log.debug("Failed to prepare transaction during rollback (will ignore) [tx=" + this + ", msg=" + e.getMessage() + ']'); } fut.finish(false); } });
/** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { super.onKernalStop0(cancel); for (JCacheQuery lsnr : jCacheLsnrs.values()) { try { lsnr.cancel(); } catch (IgniteCheckedException e) { if (log.isDebugEnabled()) log.debug("Failed to stop JCache entry listener: " + e.getMessage()); } } }
@Override public void onError(IgniteCheckedException e) { if (!(e instanceof ClusterTopologyCheckedException)) completeWithException(res, e); else { if (log.isDebugEnabled()) log.debug("Vacuum failed to receive an Mvcc snapshot. " + "Need to retry on the stable topology. " + e.getMessage()); res.onDone(new VacuumMetrics()); } } });
/** {@inheritDoc} */ @Override public void stop() { try { for (CacheDataStore store : cacheDataStores()) destroyCacheDataStore(store); if (pendingEntries != null) pendingEntries.destroy(); } catch (IgniteCheckedException e) { throw new IgniteException(e.getMessage(), e); } }
/** {@inheritDoc} */ @Override public void commit(Xid xid, boolean onePhase) throws XAException { assert this.xid.equals(xid); if (log.isDebugEnabled()) log.debug("XA resource commit(...) [xid=" + xid + ", onePhase=" + onePhase + "]"); try { ctx.cache().context().commitTxAsync(cacheTx).get(); } catch (IgniteCheckedException e) { throwException("Failed to commit cache transaction: " + e.getMessage(), e); } }
@Override public IgniteException apply(IgniteCheckedException e) { ClusterTopologyException topEx = new ClusterTopologyException(e.getMessage(), e); ClusterTopologyCheckedException checked = (ClusterTopologyCheckedException)e; if (checked.retryReadyFuture() != null) topEx.retryReadyFuture(new IgniteFutureImpl<>(checked.retryReadyFuture())); return topEx; } });
/** {@inheritDoc} */ @Override public void rollback(Xid xid) throws XAException { assert this.xid.equals(xid); if (log.isDebugEnabled()) log.debug("XA resource rollback(...) [xid=" + xid + "]"); try { ctx.cache().context().rollbackTxAsync(cacheTx).get(); } catch (IgniteCheckedException e) { throwException("Failed to rollback cache transaction: " + e.getMessage(), e); } }
/** */ protected GridNearTxLocal checkCurrentTx() { if (!ctx.mvccEnabled()) return ctx.tm().threadLocalTx(ctx); try { return MvccUtils.currentTx(ctx.kernalContext(), null); } catch (MvccUtils.UnsupportedTxModeException | MvccUtils.NonMvccTransactionException e) { throw new TransactionException(e.getMessage()); } }