use of org.apache.ignite.internal.IgniteClientDisconnectedCheckedException in project ignite by apache.
the class GridCachePartitionExchangeManager method onKernalStop0.
/** {@inheritDoc} */
@Override
protected void onKernalStop0(boolean cancel) {
cctx.gridEvents().removeDiscoveryEventListener(discoLsnr);
cctx.io().removeHandler(0, GridDhtPartitionsSingleMessage.class);
cctx.io().removeHandler(0, GridDhtPartitionsFullMessage.class);
cctx.io().removeHandler(0, GridDhtPartitionsSingleRequest.class);
stopErr = cctx.kernalContext().clientDisconnected() ? new IgniteClientDisconnectedCheckedException(cctx.kernalContext().cluster().clientReconnectFuture(), "Client node disconnected: " + cctx.igniteInstanceName()) : new IgniteInterruptedCheckedException("Node is stopping: " + cctx.igniteInstanceName());
// Finish all exchange futures.
ExchangeFutureSet exchFuts0 = exchFuts;
if (exchFuts0 != null) {
for (GridDhtPartitionsExchangeFuture f : exchFuts.values()) f.onDone(stopErr);
}
for (AffinityReadyFuture f : readyFuts.values()) f.onDone(stopErr);
if (!cctx.kernalContext().clientNode()) {
for (int cnt = 0; cnt < cctx.gridConfig().getRebalanceThreadPoolSize(); cnt++) cctx.io().removeOrderedHandler(rebalanceTopic(cnt));
}
U.cancel(exchWorker);
if (log.isDebugEnabled())
log.debug("Before joining on exchange worker: " + exchWorker);
U.join(exchWorker, log);
ResendTimeoutObject resendTimeoutObj = pendingResend.getAndSet(null);
if (resendTimeoutObj != null)
cctx.time().removeTimeoutObject(resendTimeoutObj);
}
use of org.apache.ignite.internal.IgniteClientDisconnectedCheckedException in project ignite by apache.
the class GridCacheProcessor method onDisconnected.
/** {@inheritDoc} */
@Override
public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
IgniteClientDisconnectedCheckedException err = new IgniteClientDisconnectedCheckedException(ctx.cluster().clientReconnectFuture(), "Failed to execute dynamic cache change request, client node disconnected.");
for (IgniteInternalFuture fut : pendingFuts.values()) ((GridFutureAdapter) fut).onDone(err);
for (IgniteInternalFuture fut : pendingTemplateFuts.values()) ((GridFutureAdapter) fut).onDone(err);
for (GridCacheAdapter cache : caches.values()) {
GridCacheContext cctx = cache.context();
cctx.gate().onDisconnected(reconnectFut);
List<GridCacheManager> mgrs = cache.context().managers();
for (ListIterator<GridCacheManager> it = mgrs.listIterator(mgrs.size()); it.hasPrevious(); ) {
GridCacheManager mgr = it.previous();
mgr.onDisconnected(reconnectFut);
}
}
sharedCtx.onDisconnected(reconnectFut);
cachesInfo.onDisconnect();
}
use of org.apache.ignite.internal.IgniteClientDisconnectedCheckedException in project ignite by apache.
the class GridCacheUtils method convertToCacheException.
/**
* @param e Ignite checked exception.
* @return CacheException runtime exception, never null.
*/
@NotNull
public static RuntimeException convertToCacheException(IgniteCheckedException e) {
IgniteClientDisconnectedCheckedException disconnectedErr = e.getCause(IgniteClientDisconnectedCheckedException.class);
if (disconnectedErr != null) {
assert disconnectedErr.reconnectFuture() != null : disconnectedErr;
e = disconnectedErr;
}
if (e.hasCause(CacheWriterException.class))
return new CacheWriterException(U.convertExceptionNoWrap(e));
if (e instanceof CachePartialUpdateCheckedException)
return new CachePartialUpdateException((CachePartialUpdateCheckedException) e);
else if (e instanceof CacheAtomicUpdateTimeoutCheckedException)
return new CacheAtomicUpdateTimeoutException(e.getMessage(), e);
else if (e instanceof ClusterTopologyServerNotFoundException)
return new CacheServerNotFoundException(e.getMessage(), e);
if (e.getCause() instanceof CacheException)
return (CacheException) e.getCause();
if (e.getCause() instanceof NullPointerException)
return (NullPointerException) e.getCause();
C1<IgniteCheckedException, IgniteException> converter = U.getExceptionConverter(e.getClass());
return converter != null ? new CacheException(converter.apply(e)) : new CacheException(e);
}
use of org.apache.ignite.internal.IgniteClientDisconnectedCheckedException in project ignite by apache.
the class GridCacheMvccManager method onDisconnected.
/** {@inheritDoc} */
@Override
public void onDisconnected(IgniteFuture reconnectFut) {
IgniteClientDisconnectedCheckedException err = disconnectedError(reconnectFut);
cancelClientFutures(err);
}
use of org.apache.ignite.internal.IgniteClientDisconnectedCheckedException in project ignite by apache.
the class GridCacheDistributedQueryManager method addQueryFuture.
/**
* Removes query future from futures map.
*
* @param reqId Request id.
* @param fut Query future.
*/
protected void addQueryFuture(long reqId, GridCacheDistributedQueryFuture<?, ?, ?> fut) {
futs.put(reqId, fut);
if (cctx.kernalContext().clientDisconnected()) {
IgniteClientDisconnectedCheckedException err = new IgniteClientDisconnectedCheckedException(cctx.kernalContext().cluster().clientReconnectFuture(), "Query was cancelled, client node disconnected.");
fut.onDone(err);
}
}
Aggregations