Search in sources :

Example 16 with ClusterTopologyServerNotFoundException

use of org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException 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)

Aggregations

ClusterTopologyServerNotFoundException (org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException)16 ClusterNode (org.apache.ignite.cluster.ClusterNode)9 KeyCacheObject (org.apache.ignite.internal.processors.cache.KeyCacheObject)9 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)8 ClusterTopologyCheckedException (org.apache.ignite.internal.cluster.ClusterTopologyCheckedException)7 AffinityTopologyVersion (org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion)7 GridCacheVersion (org.apache.ignite.internal.processors.cache.version.GridCacheVersion)5 ArrayList (java.util.ArrayList)4 GridCacheEntryRemovedException (org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException)4 Map (java.util.Map)3 CachePartialUpdateCheckedException (org.apache.ignite.internal.processors.cache.CachePartialUpdateCheckedException)3 Collection (java.util.Collection)2 LinkedHashMap (java.util.LinkedHashMap)2 UUID (java.util.UUID)2 CacheException (javax.cache.CacheException)2 CacheWriterException (javax.cache.integration.CacheWriterException)2 IgniteException (org.apache.ignite.IgniteException)2 CacheAtomicUpdateTimeoutException (org.apache.ignite.cache.CacheAtomicUpdateTimeoutException)2 CachePartialUpdateException (org.apache.ignite.cache.CachePartialUpdateException)2 CacheServerNotFoundException (org.apache.ignite.cache.CacheServerNotFoundException)2