use of org.apache.ignite.configuration.NearCacheConfiguration in project ignite by apache.
the class GridCacheJdbcBlobStoreMultithreadedSelfTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
startGridsMultiThreaded(GRID_CNT - 2);
client = true;
Ignite grid = startGrid(GRID_CNT - 2);
grid.createNearCache(DEFAULT_CACHE_NAME, new NearCacheConfiguration());
grid = startGrid(GRID_CNT - 1);
grid.cache(DEFAULT_CACHE_NAME);
}
use of org.apache.ignite.configuration.NearCacheConfiguration in project ignite by apache.
the class CacheStoreReadFromBackupTest method cacheConfig.
/**
*/
@SuppressWarnings("unchecked")
private CacheConfiguration cacheConfig(String cacheName) {
CacheConfiguration ccfg = new CacheConfiguration<>(cacheName);
ccfg.setCacheMode(cacheMode);
ccfg.setBackups(backups);
ccfg.setAtomicityMode(atomicityMode());
ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
ccfg.setAffinity(new RendezvousAffinityFunction(false, 1));
ccfg.setReadThrough(true);
ccfg.setReadFromBackup(true);
ccfg.setCacheStoreFactory(FactoryBuilder.factoryOf(TestStore.class));
if (near)
ccfg.setNearConfiguration(new NearCacheConfiguration());
return ccfg;
}
use of org.apache.ignite.configuration.NearCacheConfiguration in project ignite by apache.
the class GridProjectionForCachesSelfTest method cacheConfiguration.
/**
* @param cacheName Cache name.
* @return Cache configuration.
*/
private CacheConfiguration cacheConfiguration(@NotNull String cacheName, IgnitePredicate<ClusterNode> nodeFilter, boolean nearEnabled) {
CacheConfiguration cfg = defaultCacheConfiguration();
cfg.setName(cacheName);
cfg.setCacheMode(PARTITIONED);
if (nearEnabled)
cfg.setNearConfiguration(new NearCacheConfiguration());
cfg.setNodeFilter(nodeFilter);
cfg.setBackups(1);
return cfg;
}
use of org.apache.ignite.configuration.NearCacheConfiguration in project ignite by apache.
the class GridCacheGetStoreErrorSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
c.setDiscoverySpi(disco);
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(cacheMode);
if (nearEnabled)
cc.setNearConfiguration(new NearCacheConfiguration());
cc.setAtomicityMode(TRANSACTIONAL);
cc.setCacheStoreFactory(new IgniteReflectionFactory<CacheStore>(TestStore.class));
cc.setReadThrough(true);
cc.setWriteThrough(true);
cc.setLoadPreviousValue(true);
c.setCacheConfiguration(cc);
c.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
return c;
}
use of org.apache.ignite.configuration.NearCacheConfiguration in project ignite by apache.
the class GridCacheNearEvictionSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
cc.setWriteSynchronizationMode(FULL_SYNC);
cc.setBackups(1);
cc.setRebalanceMode(SYNC);
cc.setAtomicityMode(atomicityMode());
NearCacheConfiguration nearCfg = new NearCacheConfiguration();
cc.setNearConfiguration(nearCfg);
c.setCacheConfiguration(cc);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
c.setDiscoverySpi(disco);
return c;
}
Aggregations