Search in sources :

Example 1 with DynamicCacheChangeFailureMessage

use of org.apache.ignite.internal.processors.cache.DynamicCacheChangeFailureMessage in project ignite by apache.

the class GridDhtPartitionsExchangeFuture method sendExchangeFailureMessage.

/**
 * Sends {@link DynamicCacheChangeFailureMessage} to all participated nodes that represents a cause of exchange
 * failure.
 */
private void sendExchangeFailureMessage() {
    assert crd != null && crd.isLocal();
    try {
        IgniteCheckedException err = createExchangeException(exchangeGlobalExceptions);
        List<String> cacheNames = new ArrayList<>(exchActions.cacheStartRequests().size());
        for (ExchangeActions.CacheActionData actionData : exchActions.cacheStartRequests()) cacheNames.add(actionData.request().cacheName());
        DynamicCacheChangeFailureMessage msg = new DynamicCacheChangeFailureMessage(cctx.localNode(), exchId, err, cacheNames);
        if (log.isDebugEnabled())
            log.debug("Dynamic cache change failed (send message to all participating nodes): " + msg);
        cacheChangeFailureMsgSent = true;
        cctx.discovery().sendCustomEvent(msg);
        return;
    } catch (IgniteCheckedException e) {
        if (reconnectOnError(e))
            onDone(new IgniteNeedReconnectException(cctx.localNode(), e));
        else
            onDone(e);
    }
}
Also used : IgniteCheckedException(org.apache.ignite.IgniteCheckedException) ExchangeActions(org.apache.ignite.internal.processors.cache.ExchangeActions) ArrayList(java.util.ArrayList) IgniteNeedReconnectException(org.apache.ignite.internal.IgniteNeedReconnectException) DynamicCacheChangeFailureMessage(org.apache.ignite.internal.processors.cache.DynamicCacheChangeFailureMessage)

Aggregations

ArrayList (java.util.ArrayList)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteNeedReconnectException (org.apache.ignite.internal.IgniteNeedReconnectException)1 DynamicCacheChangeFailureMessage (org.apache.ignite.internal.processors.cache.DynamicCacheChangeFailureMessage)1 ExchangeActions (org.apache.ignite.internal.processors.cache.ExchangeActions)1