use of org.apache.ignite.failure.AbstractFailureHandler in project ignite by apache.
the class IgnitePdsTaskCancelingTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
cfg.setFailureHandler(new AbstractFailureHandler() {
@Override
protected boolean handle(Ignite ignite, FailureContext failureCtx) {
failure.set(true);
return true;
}
});
cfg.setCacheConfiguration(new CacheConfiguration().setName(DEFAULT_CACHE_NAME).setAffinity(new RendezvousAffinityFunction(false, NUM_TASKS / 2)));
cfg.setDataStorageConfiguration(getDataStorageConfiguration());
// Set the thread pool size according to the NUM_TASKS.
cfg.setPublicThreadPoolSize(16);
return cfg;
}
use of org.apache.ignite.failure.AbstractFailureHandler in project ignite by apache.
the class CacheGetReadFromBackupFailoverTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setFailureHandler(new AbstractFailureHandler() {
@Override
protected boolean handle(Ignite ignite, FailureContext failureCtx) {
err.compareAndSet(null, failureCtx.error());
stop.set(true);
return false;
}
});
cfg.setConsistentId(igniteInstanceName);
CacheConfiguration<Long, Long> txCcfg = new CacheConfiguration<Long, Long>(TX_CACHE).setAtomicityMode(TRANSACTIONAL).setCacheMode(PARTITIONED).setBackups(1).setWriteSynchronizationMode(FULL_SYNC).setReadFromBackup(true);
CacheConfiguration<Long, Long> atomicCcfg = new CacheConfiguration<Long, Long>(ATOMIC_CACHE).setAtomicityMode(ATOMIC).setCacheMode(PARTITIONED).setBackups(1).setWriteSynchronizationMode(FULL_SYNC).setReadFromBackup(true);
cfg.setCacheConfiguration(txCcfg, atomicCcfg);
// Enforce different mac adresses to emulate distributed environment by default.
cfg.setUserAttributes(Collections.singletonMap(IgniteNodeAttributes.ATTR_MACS_OVERRIDE, UUID.randomUUID().toString()));
return cfg;
}
use of org.apache.ignite.failure.AbstractFailureHandler in project ignite by apache.
the class IgniteCacheContinuousQueryClientTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setFailureHandler(new AbstractFailureHandler() {
@Override
protected boolean handle(Ignite ignite, FailureContext failureCtx) {
failure.set(true);
return true;
}
});
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setCacheMode(PARTITIONED);
ccfg.setAtomicityMode(atomicityMode());
ccfg.setWriteSynchronizationMode(FULL_SYNC);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
use of org.apache.ignite.failure.AbstractFailureHandler in project ignite by apache.
the class GridP2PContinuousDeploymentClientDisconnectTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setCacheConfiguration(defaultCacheConfiguration());
cfg.setGridLogger(testLog);
cfg.setFailureHandler(new AbstractFailureHandler() {
/**
* {@inheritDoc}
*/
@Override
protected boolean handle(Ignite ignite, FailureContext failureCtx) {
failure.set(true);
return false;
}
});
return cfg;
}
Aggregations