Search in sources :

Example 1 with StopRoutineDiscoveryMessage

use of org.apache.ignite.internal.processors.continuous.StopRoutineDiscoveryMessage in project ignite by apache.

the class CacheContinuousQueryFilterDeploymentFailedTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    // Failure detection timeout > P2P class loading timeout which is set as network timeout.
    cfg.setFailureDetectionTimeout(cfg.getNetworkTimeout() * 2);
    ((TestTcpDiscoverySpi) cfg.getDiscoverySpi()).discoveryHook(new DiscoveryHook() {

        @Override
        public void afterDiscovery(DiscoveryCustomMessage customMsg) {
            if (customMsg instanceof StopRoutineDiscoveryMessage)
                stopRoutineLatch.countDown();
        }
    });
    cfg.setCommunicationSpi(new TestRecordingCommunicationSpi());
    return cfg;
}
Also used : TestRecordingCommunicationSpi(org.apache.ignite.internal.TestRecordingCommunicationSpi) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TestTcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TestTcpDiscoverySpi) DiscoveryCustomMessage(org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage) StopRoutineDiscoveryMessage(org.apache.ignite.internal.processors.continuous.StopRoutineDiscoveryMessage) DiscoveryHook(org.apache.ignite.testframework.GridTestUtils.DiscoveryHook)

Aggregations

IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)1 TestRecordingCommunicationSpi (org.apache.ignite.internal.TestRecordingCommunicationSpi)1 DiscoveryCustomMessage (org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage)1 StopRoutineDiscoveryMessage (org.apache.ignite.internal.processors.continuous.StopRoutineDiscoveryMessage)1 TestTcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TestTcpDiscoverySpi)1 DiscoveryHook (org.apache.ignite.testframework.GridTestUtils.DiscoveryHook)1