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();
}
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;
}
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;
}
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;
}
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;
}
Aggregations