use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction 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.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class GridCachePartitionedOptimisticTxNodeRestartTest method cacheConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected CacheConfiguration cacheConfiguration() {
CacheConfiguration cc = defaultCacheConfiguration();
cc.setName(CACHE_NAME);
cc.setCacheMode(PARTITIONED);
cc.setWriteSynchronizationMode(FULL_SYNC);
cc.setRebalanceMode(rebalancMode);
cc.setRebalanceBatchSize(rebalancBatchSize);
cc.setAffinity(new RendezvousAffinityFunction(false, partitions));
cc.setBackups(backups);
cc.setNearConfiguration(nearEnabled() ? new NearCacheConfiguration() : null);
return cc;
}
use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class GridCachePartitionedTxSalvageSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
// Discovery.
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
c.setDiscoverySpi(disco);
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
cc.setAffinity(new RendezvousAffinityFunction(false, 18));
cc.setBackups(1);
cc.setRebalanceMode(SYNC);
c.setCacheConfiguration(cc);
return c;
}
use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class GridCacheRendezvousAffinityClientSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setForceServerMode(true);
CacheConfiguration ccfg = defaultCacheConfiguration();
ccfg.setCacheMode(CacheMode.PARTITIONED);
ccfg.setBackups(1);
ccfg.setAffinity(new RendezvousAffinityFunction());
if (client)
cfg.setClientMode(true);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class GridCacheDhtPreloadMultiThreadedSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = loadConfiguration("modules/core/src/test/config/spring-multicache.xml");
cfg.setIgniteInstanceName(igniteInstanceName);
for (CacheConfiguration cCfg : cfg.getCacheConfiguration()) {
if (cCfg.getCacheMode() == CacheMode.PARTITIONED) {
cCfg.setAffinity(new RendezvousAffinityFunction(2048, null));
cCfg.setBackups(1);
}
}
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
return cfg;
}
Aggregations