Search in sources :

Example 1 with StopNodeFailureHandler

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

the class FailureHandler method failureTypes.

void failureTypes() {
    // tag::failure-types[]
    StopNodeFailureHandler failureHandler = new StopNodeFailureHandler();
    failureHandler.setIgnoredFailureTypes(Collections.EMPTY_SET);
    IgniteConfiguration cfg = new IgniteConfiguration().setFailureHandler(failureHandler);
    Ignite ignite = Ignition.start(cfg);
    // end::failure-types[]
    ignite.close();
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler) Ignite(org.apache.ignite.Ignite)

Example 2 with StopNodeFailureHandler

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

the class IgniteRebalanceOnCachesStoppingOrDestroyingTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCommunicationSpi(new RebalanceBlockingSPI());
    cfg.setFailureHandler(new StopNodeFailureHandler());
    cfg.setRebalanceThreadPoolSize(4);
    cfg.setTransactionConfiguration(new TransactionConfiguration().setDefaultTxTimeout(1000));
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setWalMode(WALMode.LOG_ONLY).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(100L * 1024 * 1024)));
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) TransactionConfiguration(org.apache.ignite.configuration.TransactionConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler)

Example 3 with StopNodeFailureHandler

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

the class CacheMvccAbstractTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setFailureHandler(new StopNodeFailureHandler());
    if (disableScheduledVacuum)
        cfg.setMvccVacuumFrequency(Integer.MAX_VALUE);
    if (testSpi)
        cfg.setCommunicationSpi(new TestRecordingCommunicationSpi());
    ((TcpCommunicationSpi) cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    cfg.setClientMode(client);
    assert (ccfg == null) || (ccfgs == null);
    if (ccfg != null)
        cfg.setCacheConfiguration(ccfg);
    if (ccfgs != null)
        cfg.setCacheConfiguration(ccfgs);
    if (nodeAttr != null)
        cfg.setUserAttributes(F.asMap(nodeAttr, true));
    DataStorageConfiguration storageCfg = new DataStorageConfiguration();
    storageCfg.setWalMode(WALMode.LOG_ONLY);
    storageCfg.setPageSize(PAGE_SIZE);
    DataRegionConfiguration regionCfg = new DataRegionConfiguration();
    regionCfg.setPersistenceEnabled(persistence);
    regionCfg.setMaxSize(64L * 1024 * 1024);
    storageCfg.setDefaultDataRegionConfiguration(regionCfg);
    cfg.setDataStorageConfiguration(storageCfg);
    cfg.setConsistentId(gridName);
    cfg.setTransactionConfiguration(new TransactionConfiguration().setDefaultTxConcurrency(TransactionConcurrency.PESSIMISTIC).setDefaultTxIsolation(TransactionIsolation.REPEATABLE_READ));
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) TestRecordingCommunicationSpi(org.apache.ignite.internal.TestRecordingCommunicationSpi) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) TransactionConfiguration(org.apache.ignite.configuration.TransactionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)

Example 4 with StopNodeFailureHandler

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

the class TxRecoveryWithConcurrentRollbackTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String name) throws Exception {
    final IgniteConfiguration cfg = super.getConfiguration(name);
    cfg.setConsistentId(name);
    if (persistence) {
        cfg.setDataStorageConfiguration(new DataStorageConfiguration().setWalSegmentSize(4 * 1024 * 1024).setWalHistorySize(1000).setCheckpointFrequency(Integer.MAX_VALUE).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(50 * 1024 * 1024)));
    }
    cfg.setActiveOnStart(false);
    cfg.setClientMode(name.startsWith("client"));
    cfg.setCommunicationSpi(new TestRecordingCommunicationSpi());
    cfg.setFailureHandler(new StopNodeFailureHandler());
    cfg.setCacheConfiguration(new CacheConfiguration(DEFAULT_CACHE_NAME).setCacheMode(PARTITIONED).setBackups(backups).setAtomicityMode(TRANSACTIONAL).setWriteSynchronizationMode(syncMode));
    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) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 5 with StopNodeFailureHandler

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

the class IgniteShutdownOnSupplyMessageFailureTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String name) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(name);
    cfg.setConsistentId(name);
    DataStorageConfiguration conf = new DataStorageConfiguration().setWalHistorySize(WAL_HISTORY_SIZE).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_INITIAL_SIZE).setPersistenceEnabled(true)).setWalMode(WALMode.FSYNC).setCheckpointFrequency(500);
    if (name.equals(getTestIgniteInstanceName(NODE_NAME_WITH_TEST_FILE_FACTORY))) {
        conf.setFileIOFactory(new FailingFileIOFactory(canFailFirstNode));
        cfg.setIncludeEventTypes(EVT_CACHE_REBALANCE_PART_SUPPLIED);
        cfg.setFailureHandler(new TestFailureHandler());
    } else
        cfg.setFailureHandler(new StopNodeFailureHandler());
    cfg.setDataStorageConfiguration(conf);
    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)

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