use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class GridCacheMvccFlagsTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration cfg = super.getConfiguration();
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(REPLICATED);
cfg.setCacheConfiguration(cacheCfg);
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 GridCacheLeakTest method cacheConfiguration.
/**
* Gets cache configuration.
*
* @return Data cache configuration.
*/
protected CacheConfiguration cacheConfiguration() {
CacheConfiguration cfg = defaultCacheConfiguration();
cfg.setName(CACHE_NAME);
cfg.setAffinity(new RendezvousAffinityFunction(false, 128));
cfg.setCacheMode(PARTITIONED);
cfg.setBackups(1);
cfg.setNearConfiguration(null);
cfg.setWriteSynchronizationMode(FULL_SYNC);
cfg.setAtomicityMode(atomicityMode);
return cfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class IgniteCacheReadThroughStoreCallTest method cacheConfiguration.
/**
* @param cacheMode Cache mode.
* @param atomicityMode Atomicity mode.
* @param backups Number of backups.
* @return Cache configuration.
*/
@SuppressWarnings("unchecked")
protected CacheConfiguration<Object, Object> cacheConfiguration(CacheMode cacheMode, CacheAtomicityMode atomicityMode, int backups) {
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setReadThrough(true);
ccfg.setWriteThrough(true);
ccfg.setCacheStoreFactory(new TestStoreFactory());
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setAtomicityMode(atomicityMode);
ccfg.setCacheMode(cacheMode);
ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
if (cacheMode == PARTITIONED)
ccfg.setBackups(backups);
return ccfg;
}
use of org.apache.ignite.configuration.CacheConfiguration in project ignite by apache.
the class IgniteCacheStoreValueAbstractTest method cacheConfiguration.
/** {@inheritDoc} */
@Override
protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception {
CacheConfiguration ccfg = super.cacheConfiguration(igniteInstanceName);
if (ccfg.getCacheMode() != CacheMode.LOCAL)
assertEquals(1, ccfg.getBackups());
assertTrue(ccfg.isCopyOnRead());
ccfg.setCopyOnRead(cpyOnRead);
assertEquals(FULL_SYNC, ccfg.getWriteSynchronizationMode());
ccfg.setCacheStoreFactory(singletonFactory(new CacheStoreAdapter() {
@Override
public void loadCache(IgniteBiInClosure clo, Object... args) {
clo.apply(new TestKey(100_000), new TestValue(30_000));
}
@Override
public Object load(Object key) throws CacheLoaderException {
return null;
}
@Override
public void write(Cache.Entry entry) throws CacheWriterException {
// No-op.
}
@Override
public void delete(Object key) throws CacheWriterException {
// No-op.
}
}));
ccfg.setInterceptor(new TestInterceptor());
return ccfg;
}
Aggregations