use of org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy in project ignite by apache.
the class GridCacheObjectToStringSelfTest method testReplicatedCacheFifoEvictionPolicy.
/** @throws Exception If failed. */
public void testReplicatedCacheFifoEvictionPolicy() throws Exception {
cacheMode = REPLICATED;
evictionPlc = new FifoEvictionPolicy();
checkToString();
}
use of org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy in project ignite by apache.
the class GridCachePartitionedEvictionSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
c.getTransactionConfiguration().setTxSerializableEnabled(true);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(ipFinder);
c.setDiscoverySpi(spi);
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
cc.setWriteSynchronizationMode(FULL_SYNC);
FifoEvictionPolicy plc = new FifoEvictionPolicy();
plc.setMaxSize(EVICT_CACHE_SIZE);
cc.setEvictionPolicy(plc);
cc.setOnheapCacheEnabled(true);
FifoEvictionPolicy nearPlc = new FifoEvictionPolicy();
nearPlc.setMaxSize(EVICT_CACHE_SIZE);
cc.getNearConfiguration().setNearEvictionPolicy(nearPlc);
// We set 1 backup explicitly.
cc.setBackups(1);
c.setCacheConfiguration(cc);
return c;
}
use of org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy in project ignite by apache.
the class ClusterNodeMetricsSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(spi);
cfg.setCacheConfiguration();
cfg.setMetricsUpdateFrequency(500);
CacheConfiguration<Integer, Object> ccfg = defaultCacheConfiguration();
ccfg.setName(CACHE_NAME);
ccfg.setStatisticsEnabled(true);
FifoEvictionPolicy plc = new FifoEvictionPolicy();
plc.setMaxMemorySize(MAX_VALS_AMOUNT * VAL_SIZE);
plc.setMaxSize(0);
ccfg.setEvictionPolicy(plc);
ccfg.setOnheapCacheEnabled(true);
return cfg.setCacheConfiguration(ccfg);
}
use of org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy in project ignite by apache.
the class GridCachePartitionedMultiThreadedPutGetSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
c.getTransactionConfiguration().setTxSerializableEnabled(true);
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
cc.setBackups(1);
cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
FifoEvictionPolicy plc = new FifoEvictionPolicy();
plc.setMaxMemorySize(1000);
cc.setEvictionPolicy(plc);
cc.setOnheapCacheEnabled(true);
cc.setAtomicityMode(TRANSACTIONAL);
NearCacheConfiguration nearCfg = new NearCacheConfiguration();
nearCfg.setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy());
cc.setNearConfiguration(nearCfg);
c.setCacheConfiguration(cc);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(ipFinder);
c.setDiscoverySpi(spi);
return c;
}
use of org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy in project ignite by apache.
the class GridCacheEmptyEntriesAbstractSelfTest method testFifo.
/**
* Tests FIFO eviction policy.
*
* @throws Exception If failed.
*/
public void testFifo() throws Exception {
FifoEvictionPolicy plc = new FifoEvictionPolicy();
plc.setMaxSize(50);
this.plc = plc;
FifoEvictionPolicy nearPlc = new FifoEvictionPolicy();
nearPlc.setMaxSize(50);
this.nearPlc = nearPlc;
checkPolicy();
}
Aggregations