Search in sources :

Example 21 with StopNodeFailureHandler

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

the class IgniteWalFlushMultiNodeFailoverAbstractSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setConsistentId(gridName);
    cfg.setCacheConfiguration(new CacheConfiguration(DEFAULT_CACHE_NAME).setAtomicityMode(TRANSACTIONAL).setBackups(1).setRebalanceMode(SYNC).setAffinity(new RendezvousAffinityFunction(false, 32)));
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(2048L * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(walMode()).setWalSegmentSize(512 * 1024).setWalBufferSize(512 * 1024));
    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)

Example 22 with StopNodeFailureHandler

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

the class IgniteWalHistoryReservationsTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setCommunicationSpi(new TestRecordingCommunicationSpi());
    cfg.setClientMode(client);
    cfg.setConsistentId("NODE$" + gridName.charAt(gridName.length() - 1));
    cfg.setFailureHandler(new StopNodeFailureHandler());
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(200L * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(walMode).setWalSegmentSize(512 * 1024);
    cfg.setDataStorageConfiguration(memCfg);
    CacheConfiguration ccfg1 = new CacheConfiguration();
    ccfg1.setName("cache1");
    ccfg1.setBackups(1);
    ccfg1.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    ccfg1.setAffinity(new RendezvousAffinityFunction(false, 32));
    cfg.setCacheConfiguration(ccfg1);
    cfg.setFailureDetectionTimeout(20_000);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) TestRecordingCommunicationSpi(org.apache.ignite.internal.TestRecordingCommunicationSpi) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 23 with StopNodeFailureHandler

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

the class TxPartitionCounterStateAbstractTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setActiveOnStart(false);
    cfg.setAutoActivationEnabled(false);
    cfg.setConsistentId("node" + igniteInstanceName);
    cfg.setFailureHandler(new StopNodeFailureHandler());
    // Necessary to reproduce some issues.
    cfg.setRebalanceThreadPoolSize(4);
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
    // TODO set this only for historical rebalance tests.
    cfg.setCommunicationSpi(new IgniteWalRebalanceTest.WalRebalanceCheckingCommunicationSpi());
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setWalHistorySize(1000).setWalSegmentSize(8 * MB).setWalMode(LOG_ONLY).setPageSize(1024).setCheckpointFrequency(MILLISECONDS.convert(365, DAYS)).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(persistenceEnabled()).setInitialSize(100 * MB).setMaxSize(100 * MB)));
    if (!igniteInstanceName.startsWith(CLIENT_GRID_NAME))
        cfg.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME));
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) IgniteWalRebalanceTest(org.apache.ignite.internal.processors.cache.persistence.db.wal.IgniteWalRebalanceTest) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 24 with StopNodeFailureHandler

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

the class WalRolloverRecordLoggingTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String name) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(name);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(128 * 1024 * 1024)).setWalMode(walMode()).setWalSegmentSize(4 * 1024 * 1024));
    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) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler)

Example 25 with StopNodeFailureHandler

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

the class StopNodeOnRebuildIndexFailureTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
    cfg.setCacheConfiguration(new CacheConfiguration<>().setName(CACHE_NAME).setIndexedTypes(Integer.class, Person.class));
    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) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler) Person(org.apache.ignite.client.Person)

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