use of org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy in project ignite by apache.
the class GridCacheConcurrentEvictionsSelfTest method testConcurrentPutsSortedLocal.
/**
* @throws Exception If failed.
*/
@Test
public void testConcurrentPutsSortedLocal() throws Exception {
mode = LOCAL;
SortedEvictionPolicy plc = new SortedEvictionPolicy();
plc.setMaxSize(1000);
this.plc = plc;
warmUpPutsCnt = SF.applyLB(100_000, 10_000);
iterCnt = SF.applyLB(100_000, 10_000);
checkConcurrentPuts();
}
use of org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy in project ignite by apache.
the class EvictionPolicies method sorted.
public static void sorted() {
// tag::sorted[]
CacheConfiguration cacheCfg = new CacheConfiguration();
cacheCfg.setName("cacheName");
// Enabling on-heap caching for this distributed cache.
cacheCfg.setOnheapCacheEnabled(true);
// Set the maximum cache size to 1 million (default is 100,000).
cacheCfg.setEvictionPolicyFactory(() -> new SortedEvictionPolicy(1000000));
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setCacheConfiguration(cacheCfg);
// end::sorted[]
}
use of org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy in project ignite by apache.
the class SortedEvictionPolicyPerformanceTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
CacheConfiguration ccfg = defaultCacheConfiguration();
ccfg.setCacheMode(CacheMode.PARTITIONED);
ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
ccfg.setNearConfiguration(null);
SortedEvictionPolicy plc = new SortedEvictionPolicy();
plc.setMaxSize(MAX_SIZE);
ccfg.setEvictionPolicy(plc);
ccfg.setOnheapCacheEnabled(true);
cfg.setPeerClassLoadingEnabled(false);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
Aggregations