use of org.apache.ignite.cache.eviction.lru.LruEvictionPolicy in project ignite by apache.
the class GridCacheObjectToStringSelfTest method testLocalCacheLruEvictionPolicy.
/** @throws Exception If failed. */
public void testLocalCacheLruEvictionPolicy() throws Exception {
cacheMode = LOCAL;
evictionPlc = new LruEvictionPolicy();
checkToString();
}
use of org.apache.ignite.cache.eviction.lru.LruEvictionPolicy in project ignite by apache.
the class GridCacheObjectToStringSelfTest method testReplicatedCacheLruEvictionPolicy.
/** @throws Exception If failed. */
public void testReplicatedCacheLruEvictionPolicy() throws Exception {
cacheMode = REPLICATED;
evictionPlc = new LruEvictionPolicy();
checkToString();
}
use of org.apache.ignite.cache.eviction.lru.LruEvictionPolicy in project ignite by apache.
the class GridCacheObjectToStringSelfTest method testColocatedCacheLruEvictionPolicy.
/** @throws Exception If failed. */
public void testColocatedCacheLruEvictionPolicy() throws Exception {
cacheMode = PARTITIONED;
nearEnabled = false;
evictionPlc = new LruEvictionPolicy();
checkToString();
}
use of org.apache.ignite.cache.eviction.lru.LruEvictionPolicy in project ignite by apache.
the class GridCacheAbstractNodeRestartSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
((TcpCommunicationSpi) c.getCommunicationSpi()).setSharedMemoryPort(-1);
// Discovery.
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
disco.setSocketTimeout(30_000);
disco.setAckTimeout(30_000);
disco.setNetworkTimeout(30_000);
c.setDiscoverySpi(disco);
CacheConfiguration ccfg = cacheConfiguration();
if (evict) {
LruEvictionPolicy plc = new LruEvictionPolicy();
plc.setMaxSize(100);
ccfg.setEvictionPolicy(plc);
ccfg.setOnheapCacheEnabled(true);
}
c.setCacheConfiguration(ccfg);
return c;
}
use of org.apache.ignite.cache.eviction.lru.LruEvictionPolicy in project ignite by apache.
the class IgniteCachePutRetryAbstractSelfTest method cacheConfiguration.
/**
* @param evict If {@code true} adds eviction policy.
* @param store If {@code true} adds cache store.
* @return Cache configuration.
* @throws Exception If failed.
*/
@SuppressWarnings("unchecked")
protected CacheConfiguration cacheConfiguration(boolean evict, boolean store) throws Exception {
CacheConfiguration cfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
cfg.setAtomicityMode(atomicityMode());
cfg.setWriteSynchronizationMode(FULL_SYNC);
cfg.setBackups(1);
cfg.setRebalanceMode(SYNC);
if (evict) {
LruEvictionPolicy plc = new LruEvictionPolicy();
plc.setMaxSize(100);
cfg.setEvictionPolicy(plc);
cfg.setOnheapCacheEnabled(true);
}
if (store) {
cfg.setCacheStoreFactory(new TestStoreFactory());
cfg.setWriteThrough(true);
}
return cfg;
}
Aggregations