use of org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy in project ignite by apache.
the class GridIndexingWithNoopSwapSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
c.setDiscoverySpi(disco);
CacheConfiguration<?, ?> cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cc.setRebalanceMode(SYNC);
cc.setNearConfiguration(new NearCacheConfiguration());
FifoEvictionPolicy plc = new FifoEvictionPolicy();
plc.setMaxSize(1000);
cc.setEvictionPolicy(plc);
cc.setOnheapCacheEnabled(true);
cc.setBackups(1);
cc.setAtomicityMode(TRANSACTIONAL);
cc.setIndexedTypes(Integer.class, ObjectValue.class);
c.setCacheConfiguration(cc);
return c;
}
use of org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy in project ignite by apache.
the class IgniteCacheP2pUnmarshallingNearErrorTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
if (cfg.isClientMode() == null || !cfg.isClientMode()) {
cfg.getCacheConfiguration()[0].setEvictionPolicy(new FifoEvictionPolicy(1));
cfg.getCacheConfiguration()[0].setOnheapCacheEnabled(true);
}
return cfg;
}
use of org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy in project ignite by apache.
the class GridCacheEvictionEventAbstractTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration c = super.getConfiguration();
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
c.setDiscoverySpi(disco);
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(cacheMode());
cc.setAtomicityMode(atomicityMode());
cc.setEvictionPolicy(new FifoEvictionPolicy());
cc.setOnheapCacheEnabled(true);
c.setCacheConfiguration(cc);
c.setIncludeEventTypes(EVT_CACHE_ENTRY_EVICTED, EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
return c;
}
use of org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy in project ignite by apache.
the class GridCacheConfigurationConsistencySelfTest method testPartitionedOnlyAttributesIgnoredForReplicated.
/**
* @throws Exception If failed.
*/
public void testPartitionedOnlyAttributesIgnoredForReplicated() throws Exception {
cacheEnabled = true;
cacheMode = REPLICATED;
initCache = new C1<CacheConfiguration, Void>() {
@Override
public Void apply(CacheConfiguration cfg) {
NearCacheConfiguration nearCfg = new NearCacheConfiguration();
nearCfg.setNearEvictionPolicy(new LruEvictionPolicy());
cfg.setNearConfiguration(nearCfg);
return null;
}
};
startGrid(1);
initCache = new C1<CacheConfiguration, Void>() {
@Override
public Void apply(CacheConfiguration cfg) {
NearCacheConfiguration nearCfg = new NearCacheConfiguration();
nearCfg.setNearEvictionPolicy(new FifoEvictionPolicy());
cfg.setNearConfiguration(nearCfg);
return null;
}
};
startGrid(2);
}
use of org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy in project ignite by apache.
the class GridCacheDhtEvictionNearReadersSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
cfg.setDiscoverySpi(disco);
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setRebalanceMode(SYNC);
cacheCfg.setAtomicityMode(atomicityMode());
cacheCfg.setBackups(1);
FifoEvictionPolicy plc = new FifoEvictionPolicy();
plc.setMaxSize(10);
cacheCfg.setEvictionPolicy(plc);
cacheCfg.setOnheapCacheEnabled(true);
NearCacheConfiguration nearCfg = new NearCacheConfiguration();
FifoEvictionPolicy nearPlc = new FifoEvictionPolicy();
nearPlc.setMaxSize(10);
nearCfg.setNearEvictionPolicy(nearPlc);
cacheCfg.setNearConfiguration(nearCfg);
cfg.setCacheConfiguration(cacheCfg);
return cfg;
}
Aggregations