use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class SVMMultiClassClassificationExample method getTestCache.
/**
* Fills cache with data and returns it.
*
* @param ignite Ignite instance.
* @return Filled Ignite Cache.
*/
private static IgniteCache<Integer, double[]> getTestCache(Ignite ignite) {
CacheConfiguration<Integer, double[]> cacheConfiguration = new CacheConfiguration<>();
cacheConfiguration.setName("TEST_" + UUID.randomUUID());
cacheConfiguration.setAffinity(new RendezvousAffinityFunction(false, 10));
IgniteCache<Integer, double[]> cache = ignite.createCache(cacheConfiguration);
for (int i = 0; i < data.length; i++) cache.put(i, data[i]);
return cache;
}
use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class DistributedLinearRegressionWithLSQRTrainerAndNormalizationExample method getTestCache.
/**
* Fills cache with data and returns it.
*
* @param ignite Ignite instance.
* @return Filled Ignite Cache.
*/
private static IgniteCache<Integer, double[]> getTestCache(Ignite ignite) {
CacheConfiguration<Integer, double[]> cacheConfiguration = new CacheConfiguration<>();
cacheConfiguration.setName("TEST_" + UUID.randomUUID());
cacheConfiguration.setAffinity(new RendezvousAffinityFunction(false, 10));
IgniteCache<Integer, double[]> cache = ignite.createCache(cacheConfiguration);
for (int i = 0; i < data.length; i++) cache.put(i, data[i]);
return cache;
}
use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class SVMBinaryClassificationExample method getTestCache.
/**
* Fills cache with data and returns it.
*
* @param ignite Ignite instance.
* @return Filled Ignite Cache.
*/
private static IgniteCache<Integer, double[]> getTestCache(Ignite ignite) {
CacheConfiguration<Integer, double[]> cacheConfiguration = new CacheConfiguration<>();
cacheConfiguration.setName("TEST_" + UUID.randomUUID());
cacheConfiguration.setAffinity(new RendezvousAffinityFunction(false, 10));
IgniteCache<Integer, double[]> cache = ignite.createCache(cacheConfiguration);
for (int i = 0; i < data.length; i++) cache.put(i, data[i]);
return cache;
}
use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction 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.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.
the class IgniteCacheGroupsPartitionLossPolicySelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
cfg.setClientMode(client);
CacheConfiguration ccfg1 = new CacheConfiguration(CACHE_1).setGroupName(GROUP_NAME).setCacheMode(PARTITIONED).setBackups(0).setWriteSynchronizationMode(FULL_SYNC).setPartitionLossPolicy(partLossPlc).setAffinity(new RendezvousAffinityFunction(false, 32));
CacheConfiguration ccfg2 = new CacheConfiguration(ccfg1).setName(CACHE_2);
cfg.setCacheConfiguration(ccfg1, ccfg2);
return cfg;
}
Aggregations