Search in sources :

Example 11 with IgniteClientDisconnectedCheckedException

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);
}
Also used : IgniteInterruptedCheckedException(org.apache.ignite.internal.IgniteInterruptedCheckedException) GridDhtPartitionsExchangeFuture(org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture) IgniteClientDisconnectedCheckedException(org.apache.ignite.internal.IgniteClientDisconnectedCheckedException)

Example 12 with IgniteClientDisconnectedCheckedException

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();
}
Also used : IgniteClientDisconnectedCheckedException(org.apache.ignite.internal.IgniteClientDisconnectedCheckedException) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture)

Example 13 with IgniteClientDisconnectedCheckedException

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);
}
Also used : CacheAtomicUpdateTimeoutException(org.apache.ignite.cache.CacheAtomicUpdateTimeoutException) CacheServerNotFoundException(org.apache.ignite.cache.CacheServerNotFoundException) CacheException(javax.cache.CacheException) CachePartialUpdateException(org.apache.ignite.cache.CachePartialUpdateException) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteException(org.apache.ignite.IgniteException) ClusterTopologyServerNotFoundException(org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException) IgniteClientDisconnectedCheckedException(org.apache.ignite.internal.IgniteClientDisconnectedCheckedException) CacheWriterException(javax.cache.integration.CacheWriterException) NotNull(org.jetbrains.annotations.NotNull)

Example 14 with IgniteClientDisconnectedCheckedException

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);
}
Also used : IgniteClientDisconnectedCheckedException(org.apache.ignite.internal.IgniteClientDisconnectedCheckedException)

Example 15 with IgniteClientDisconnectedCheckedException

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);
    }
}
Also used : IgniteClientDisconnectedCheckedException(org.apache.ignite.internal.IgniteClientDisconnectedCheckedException)

Aggregations

IgniteClientDisconnectedCheckedException (org.apache.ignite.internal.IgniteClientDisconnectedCheckedException)19 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)10 IgniteException (org.apache.ignite.IgniteException)7 HashMap (java.util.HashMap)4 Map (java.util.Map)4 ConcurrentMap (java.util.concurrent.ConcurrentMap)3 ClusterTopologyException (org.apache.ignite.cluster.ClusterTopologyException)3 IgniteInternalFuture (org.apache.ignite.internal.IgniteInternalFuture)3 IgniteInterruptedCheckedException (org.apache.ignite.internal.IgniteInterruptedCheckedException)3 ClusterTopologyCheckedException (org.apache.ignite.internal.cluster.ClusterTopologyCheckedException)3 ArrayList (java.util.ArrayList)2 UUID (java.util.UUID)2 CacheException (javax.cache.CacheException)2 JMException (javax.management.JMException)2 IgniteClientDisconnectedException (org.apache.ignite.IgniteClientDisconnectedException)2 IgniteDataStreamerTimeoutException (org.apache.ignite.IgniteDataStreamerTimeoutException)2 IgniteInterruptedException (org.apache.ignite.IgniteInterruptedException)2 CacheExistsException (org.apache.ignite.cache.CacheExistsException)2 ClusterNode (org.apache.ignite.cluster.ClusterNode)2 IgniteFutureTimeoutCheckedException (org.apache.ignite.internal.IgniteFutureTimeoutCheckedException)2