use of org.apache.ignite.cache.affinity.AffinityFunction in project ignite by apache.
the class GridCachePartitionedAffinityExcludeNeighborsPerformanceTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(ipFinder);
c.setDiscoverySpi(spi);
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
cc.setBackups(2);
AffinityFunction aff = new RendezvousAffinityFunction(excNeighbores);
cc.setAffinity(aff);
cc.setRebalanceMode(NONE);
c.setCacheConfiguration(cc);
return c;
}
use of org.apache.ignite.cache.affinity.AffinityFunction in project ignite by apache.
the class IgnitePdsSingleNodeWithIndexingAndGroupPutGetPersistenceSelfTest method configure.
/**
* {@inheritDoc}
*/
@Override
protected void configure(IgniteConfiguration cfg) {
super.configure(cfg);
for (CacheConfiguration ccfg : cfg.getCacheConfiguration()) {
AffinityFunction aff = ccfg.getAffinity();
int parts = aff != null ? aff.partitions() : RendezvousAffinityFunction.DFLT_PARTITION_COUNT;
ccfg.setGroupName("testGroup-parts" + parts);
}
}
Aggregations