use of org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicyFactory in project ignite by apache.
the class EvictionPolicyFailureHandlerTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setFailureHandler((ignite, failureCtx) -> {
nodeFailure.set(true);
return false;
});
SortedEvictionPolicyFactory plcFactory = new SortedEvictionPolicyFactory();
plcFactory.setMaxSize(3);
plcFactory.setBatchSize(10);
plcFactory.setMaxMemorySize(10);
cfg.setGridLogger(log);
cfg.setCacheConfiguration(new CacheConfiguration<Integer, Integer>(DEFAULT_CACHE_NAME).setEvictionPolicyFactory(oom ? (Factory<ThrowableEvictionPolicy>) ThrowableEvictionPolicy::new : plcFactory).setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL).setOnheapCacheEnabled(true));
return cfg;
}
Aggregations