use of org.apache.ignite.failure.StopNodeFailureHandler in project ignite by apache.
the class BasicIndexTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
assertNotNull(inlineSize);
for (QueryIndex index : indexes) index.setInlineSize(inlineSize);
IgniteConfiguration igniteCfg = super.getConfiguration(igniteInstanceName);
igniteCfg.setConsistentId(igniteInstanceName);
if (igniteInstanceName.startsWith(CLIENT_NAME) && clientLog != null)
igniteCfg.setGridLogger(clientLog);
else if (srvLog != null)
igniteCfg.setGridLogger(srvLog);
LinkedHashMap<String, String> fields = new LinkedHashMap<>();
fields.put("keyStr", String.class.getName());
fields.put("keyLong", Long.class.getName());
fields.put("keyPojo", Pojo.class.getName());
fields.put("valStr", String.class.getName());
fields.put("valLong", Long.class.getName());
fields.put("valPojo", Pojo.class.getName());
if (!createIdx)
indexes = Collections.emptyList();
CacheConfiguration<Key, Val> ccfg = new CacheConfiguration<Key, Val>(DEFAULT_CACHE_NAME).setAffinity(new RendezvousAffinityFunction(false, 32)).setQueryEntities(Collections.singleton(new QueryEntity().setKeyType(Key.class.getName()).setValueType(Val.class.getName()).setFields(fields).setKeyFields(new HashSet<>(Arrays.asList("keyStr", "keyLong", "keyPojo"))).setIndexes(indexes).setAliases(Collections.singletonMap(QueryUtils.KEY_FIELD_NAME, "pk_id")))).setSqlIndexMaxInlineSize(inlineSize);
if (createStaticCache)
igniteCfg.setCacheConfiguration(ccfg);
if (srvLog != null)
igniteCfg.setGridLogger(srvLog);
if (isPersistenceEnabled) {
igniteCfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(10 * 1024 * 1024)));
}
return igniteCfg.setFailureHandler(new StopNodeFailureHandler());
}
use of org.apache.ignite.failure.StopNodeFailureHandler in project ignite by apache.
the class DynamicIndexAbstractSelfTest method commonConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration commonConfiguration(int idx) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(getTestIgniteInstanceName(idx));
cfg.setFailureHandler(new StopNodeFailureHandler());
cfg.setMarshaller(new BinaryMarshaller());
DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(128L * 1024 * 1024));
cfg.setDataStorageConfiguration(memCfg);
return optimize(cfg);
}
Aggregations