Search in sources :

Example 6 with StopNodeFailureHandler

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

the class TxRecoveryStoreEnabledTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setCommunicationSpi(new TestCommunicationSpi());
    CacheConfiguration ccfg = defaultCacheConfiguration();
    ccfg.setName(CACHE_NAME);
    ccfg.setNearConfiguration(null);
    ccfg.setCacheMode(CacheMode.PARTITIONED);
    ccfg.setBackups(1);
    ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    ccfg.setCacheStoreFactory(new TestCacheStoreFactory());
    ccfg.setReadThrough(true);
    ccfg.setWriteThrough(true);
    ccfg.setWriteBehindEnabled(false);
    cfg.setCacheConfiguration(ccfg);
    cfg.setFailureHandler(new StopNodeFailureHandler());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 7 with StopNodeFailureHandler

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

the class CheckpointBufferDeadlockTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setFileIOFactory(new SlowCheckpointFileIOFactory(slowCheckpointEnabled, CHECKPOINT_PARK_NANOS)).setCheckpointThreads(checkpointThreads).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(MAX_SIZE).setCheckpointPageBufferSize(CP_BUF_SIZE)));
    cfg.setFailureHandler(new StopNodeFailureHandler());
    cfg.setGridLogger(log);
    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 8 with StopNodeFailureHandler

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

the class IgniteLogicalRecoveryWithParamsTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setConsistentId(igniteInstanceName);
    cfg.setFailureHandler(new StopNodeFailureHandler());
    DataStorageConfiguration dsCfg = new DataStorageConfiguration().setWalMode(WALMode.LOG_ONLY).setCheckpointFrequency(// Disable automatic checkpoints.
    1024 * 1024 * 1024).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setName("dflt").setInitialSize(256 * 1024 * 1024).setMaxSize(256 * 1024 * 1024).setPersistenceEnabled(true));
    cfg.setDataStorageConfiguration(dsCfg);
    TestRecordingCommunicationSpi spi = new TestRecordingCommunicationSpi();
    cfg.setCommunicationSpi(spi);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) TestRecordingCommunicationSpi(org.apache.ignite.internal.TestRecordingCommunicationSpi) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler)

Example 9 with StopNodeFailureHandler

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

the class SlowHistoricalRebalanceSmallHistoryTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String name) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(name);
    cfg.setConsistentId(name);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setWalHistorySize(WAL_HISTORY_SIZE).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_INITIAL_SIZE).setPersistenceEnabled(true)).setWalSegmentSize(512 * 1024));
    cfg.setFailureHandler(new StopNodeFailureHandler());
    cfg.setCommunicationSpi(new RebalanceBlockingSPI());
    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 10 with StopNodeFailureHandler

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

the class IgniteWalRebalanceTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    // to make all rebalance wal-based
    System.setProperty(IGNITE_PDS_WAL_REBALANCE_THRESHOLD, "0");
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setConsistentId(gridName);
    CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(CACHE_NAME).setAtomicityMode(CacheAtomicityMode.ATOMIC).setRebalanceMode(CacheRebalanceMode.ASYNC).setCacheMode(CacheMode.PARTITIONED).setBackups(backups).setAffinity(new RendezvousAffinityFunction(false, PARTS_CNT));
    cfg.setCacheConfiguration(ccfg);
    DataStorageConfiguration dbCfg = new DataStorageConfiguration().setWalSegmentSize(4 * 1024 * 1024).setWalHistorySize(Integer.MAX_VALUE).setWalMode(WALMode.LOG_ONLY).setCheckpointFrequency(15 * 60 * 1000).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_INITIAL_SIZE));
    cfg.setDataStorageConfiguration(dbCfg);
    cfg.setCommunicationSpi(new WalRebalanceCheckingCommunicationSpi());
    if (blockMsgPred != null)
        ((TestRecordingCommunicationSpi) cfg.getCommunicationSpi()).blockMessages(blockMsgPred);
    if (recordMsgPred != null)
        ((TestRecordingCommunicationSpi) cfg.getCommunicationSpi()).record(recordMsgPred);
    cfg.setFailureHandler(new StopNodeFailureHandler());
    cfg.setConsistentId(gridName);
    cfg.setUserAttributes(userAttrs);
    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)

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