use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class GridCacheEntryVersionSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setCacheMode(PARTITIONED);
ccfg.setBackups(1);
ccfg.setAtomicityMode(atomicityMode);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
cfg.setCacheConfiguration(ccfg);
cfg.setDiscoverySpi(discoSpi);
return cfg;
}
use of org.apache.ignite.configuration.CacheConfiguration 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.configuration.CacheConfiguration in project ignite by apache.
the class GridCacheIncrementTransformTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
CacheConfiguration cache = new CacheConfiguration(DEFAULT_CACHE_NAME);
cache.setCacheMode(PARTITIONED);
cache.setAtomicityMode(ATOMIC);
cache.setWriteSynchronizationMode(FULL_SYNC);
cache.setBackups(1);
cache.setRebalanceMode(SYNC);
cfg.setCacheConfiguration(cache);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(disco);
return cfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class GridCacheIteratorPerformanceTest method cacheConfiguration.
/**
* @return Cache configuration.
*/
private CacheConfiguration cacheConfiguration() {
CacheConfiguration cfg = defaultCacheConfiguration();
cfg.setCacheMode(PARTITIONED);
cfg.setBackups(1);
return cfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class CacheConfigurationLeakTest method testCacheCreateLeak.
/**
* @throws Exception If failed.
*/
public void testCacheCreateLeak() throws Exception {
final Ignite ignite = grid();
GridTestUtils.runMultiThreaded(new IgniteInClosure<Integer>() {
@Override
public void apply(Integer idx) {
for (int i = 0; i < 100; i++) {
CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
ccfg.setName("cache-" + idx + "-" + i);
ccfg.setEvictionPolicy(new LruEvictionPolicy(1000));
ccfg.setOnheapCacheEnabled(true);
IgniteCache<Object, Object> cache = ignite.createCache(ccfg);
for (int k = 0; k < 5000; k++) cache.put(k, new byte[1024]);
ignite.destroyCache(cache.getName());
}
}
}, 5, "cache-thread");
}
Aggregations