use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class HibernateL2CacheSelfTest method generalRegionConfiguration.
/**
* @param regionName Region name.
* @return Cache configuration for {@link GeneralDataRegion}.
*/
private CacheConfiguration generalRegionConfiguration(String regionName) {
CacheConfiguration cfg = new CacheConfiguration();
cfg.setName(regionName);
cfg.setCacheMode(PARTITIONED);
cfg.setAtomicityMode(ATOMIC);
cfg.setWriteSynchronizationMode(FULL_SYNC);
cfg.setBackups(1);
cfg.setAffinity(new RendezvousAffinityFunction(false, 10));
return cfg;
}
use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class PagesWriteThrottleSandboxTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
TcpDiscoverySpi discoverySpi = (TcpDiscoverySpi) cfg.getDiscoverySpi();
discoverySpi.setIpFinder(ipFinder);
DataStorageConfiguration dbCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(4000L * 1024 * 1024).setCheckpointPageBufferSize(1000L * 1000 * 1000).setName("dfltDataRegion").setMetricsEnabled(true).setPersistenceEnabled(true)).setWalMode(WALMode.BACKGROUND).setCheckpointFrequency(20_000).setWriteThrottlingEnabled(true);
cfg.setDataStorageConfiguration(dbCfg);
CacheConfiguration ccfg1 = new CacheConfiguration();
ccfg1.setName(CACHE_NAME);
ccfg1.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
ccfg1.setAffinity(new RendezvousAffinityFunction(false, 64));
cfg.setCacheConfiguration(ccfg1);
cfg.setConsistentId(gridName);
return cfg;
}
use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class GridCacheAffinityBackupsSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setCacheMode(CacheMode.PARTITIONED);
ccfg.setBackups(backups);
ccfg.setAffinity(new RendezvousAffinityFunction());
cfg.setCacheConfiguration(ccfg);
return cfg;
}
use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class IgniteCacheAffinitySelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
CacheConfiguration cache0 = cacheConfiguration(null);
CacheConfiguration cache2 = cacheConfiguration(null);
cache2.setName(CACHE2);
cache2.setAffinity(new RendezvousAffinityFunction());
if (igniteInstanceName.contains("0"))
cfg.setCacheConfiguration(cache0);
else
cfg.setCacheConfiguration(cache0, cache2);
return cfg;
}
use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class AffinityHistoryCleanupTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
CacheConfiguration[] ccfgs = new CacheConfiguration[4];
for (int i = 0; i < ccfgs.length; i++) {
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setName("static-cache-" + i);
ccfg.setAffinity(new RendezvousAffinityFunction());
ccfgs[i] = ccfg;
}
cfg.setCacheConfiguration(ccfgs);
cfg.setClientMode(client);
return cfg;
}
Aggregations