Search in sources :

Example 11 with StopNodeFailureHandler

use of org.apache.ignite.failure.StopNodeFailureHandler in project ignite by apache.

the class IgnitePdsBinaryMetadataAsyncWritingTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    if (igniteInstanceName.contains("client")) {
        cfg.setClientMode(true);
        return cfg;
    }
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(50 * 1024 * 1024).setPersistenceEnabled(true)).setFileIOFactory(specialFileIOFactory != null ? specialFileIOFactory : new RandomAccessFileIOFactory()));
    cfg.setCacheConfiguration(new CacheConfiguration(DEFAULT_CACHE_NAME).setBackups(1).setAffinity(new RendezvousAffinityFunction(false, 16)));
    cfg.setFailureHandler(new StopNodeFailureHandler());
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) RandomAccessFileIOFactory(org.apache.ignite.internal.processors.cache.persistence.file.RandomAccessFileIOFactory)

Example 12 with StopNodeFailureHandler

use of org.apache.ignite.failure.StopNodeFailureHandler in project ignite by apache.

the class IgnitePdsNoSpaceLeftOnDeviceTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    final DataStorageConfiguration dataStorageConfiguration = new DataStorageConfiguration();
    dataStorageConfiguration.getDefaultDataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(1 << 24);
    dataStorageConfiguration.setFileIOFactory(new FailingFileIOFactory());
    cfg.setDataStorageConfiguration(dataStorageConfiguration);
    CacheConfiguration ccfg = new CacheConfiguration();
    ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    ccfg.setName(DEFAULT_CACHE_NAME);
    ccfg.setBackups(1);
    cfg.setCacheConfiguration(ccfg);
    cfg.setFailureHandler(new StopNodeFailureHandler());
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 13 with StopNodeFailureHandler

use of org.apache.ignite.failure.StopNodeFailureHandler in project ignite by apache.

the class TcpCommunicationHandshakeTimeoutTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setFailureDetectionTimeout(1000);
    cfg.setSystemWorkerBlockedTimeout(3000);
    TcpCommunicationSpi spi = new TcpCommunicationSpi();
    spi.setIdleConnectionTimeout(100);
    cfg.setCommunicationSpi(spi);
    StopNodeFailureHandler hnd = new StopNodeFailureHandler();
    hnd.setIgnoredFailureTypes(new HashSet<>());
    cfg.setFailureHandler(hnd);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler)

Example 14 with StopNodeFailureHandler

use of org.apache.ignite.failure.StopNodeFailureHandler in project ignite by apache.

the class FailureHandler method configure.

void configure() {
    // tag::configure-handler[]
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setFailureHandler(new StopNodeFailureHandler());
    Ignite ignite = Ignition.start(cfg);
    // end::configure-handler[]
    ignite.close();
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler) Ignite(org.apache.ignite.Ignite)

Example 15 with StopNodeFailureHandler

use of org.apache.ignite.failure.StopNodeFailureHandler in project ignite by apache.

the class PageMemoryLazyAllocationWithPDSTest method testCreateCacheFailsInHugeMemoryRegion.

/**
 */
@Test
public void testCreateCacheFailsInHugeMemoryRegion() throws Exception {
    lazyAllocation = true;
    IgniteEx srv = startGrid(cfgWithHugeRegion("test-server").setFailureHandler(new StopNodeFailureHandler()));
    srv.cluster().active(true);
    awaitPartitionMapExchange();
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler) Test(org.junit.Test)

Aggregations

StopNodeFailureHandler (org.apache.ignite.failure.StopNodeFailureHandler)27 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)23 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)18 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)16 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)8 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)6 TransactionConfiguration (org.apache.ignite.configuration.TransactionConfiguration)4 TestRecordingCommunicationSpi (org.apache.ignite.internal.TestRecordingCommunicationSpi)4 LinkedHashMap (java.util.LinkedHashMap)3 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)3 HashMap (java.util.HashMap)2 Ignite (org.apache.ignite.Ignite)2 BinaryBasicNameMapper (org.apache.ignite.binary.BinaryBasicNameMapper)2 AtomicConfiguration (org.apache.ignite.configuration.AtomicConfiguration)2 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)2 ExecutorConfiguration (org.apache.ignite.configuration.ExecutorConfiguration)2 NoOpFailureHandler (org.apache.ignite.failure.NoOpFailureHandler)2 StopNodeOrHaltFailureHandler (org.apache.ignite.failure.StopNodeOrHaltFailureHandler)2 IgniteEx (org.apache.ignite.internal.IgniteEx)2 PlatformDotNetBinaryConfiguration (org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration)2