Search in sources :

Example 1 with DefaultCommunicationFailureResolver

use of org.apache.ignite.configuration.DefaultCommunicationFailureResolver in project ignite by apache.

the class GridDiscoveryManager method initCommunicationErrorResolveConfiguration.

/**
 * @param cfg Configuration.
 * @throws IgniteCheckedException If configuration is not valid.
 */
public static void initCommunicationErrorResolveConfiguration(IgniteConfiguration cfg) throws IgniteCheckedException {
    CommunicationFailureResolver rslvr = cfg.getCommunicationFailureResolver();
    CommunicationSpi commSpi = cfg.getCommunicationSpi();
    DiscoverySpi discoverySpi = cfg.getDiscoverySpi();
    if (rslvr != null) {
        if (!supportsCommunicationErrorResolve(commSpi)) {
            throw new IgniteCheckedException("CommunicationFailureResolver is configured, but CommunicationSpi does not support communication" + "problem resolve: " + commSpi.getClass().getName());
        }
        if (!supportsCommunicationErrorResolve(discoverySpi)) {
            throw new IgniteCheckedException("CommunicationFailureResolver is configured, but DiscoverySpi does not support communication" + "problem resolve: " + discoverySpi.getClass().getName());
        }
    } else {
        if (supportsCommunicationErrorResolve(commSpi) && supportsCommunicationErrorResolve(discoverySpi))
            cfg.setCommunicationFailureResolver(new DefaultCommunicationFailureResolver());
    }
}
Also used : TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) CommunicationSpi(org.apache.ignite.spi.communication.CommunicationSpi) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) DefaultCommunicationFailureResolver(org.apache.ignite.configuration.DefaultCommunicationFailureResolver) CommunicationFailureResolver(org.apache.ignite.configuration.CommunicationFailureResolver) DiscoverySpi(org.apache.ignite.spi.discovery.DiscoverySpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi) DefaultCommunicationFailureResolver(org.apache.ignite.configuration.DefaultCommunicationFailureResolver)

Aggregations

IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 CommunicationFailureResolver (org.apache.ignite.configuration.CommunicationFailureResolver)1 DefaultCommunicationFailureResolver (org.apache.ignite.configuration.DefaultCommunicationFailureResolver)1 CommunicationSpi (org.apache.ignite.spi.communication.CommunicationSpi)1 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)1 DiscoverySpi (org.apache.ignite.spi.discovery.DiscoverySpi)1 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)1