Search in sources :

Example 71 with RendezvousAffinityFunction

use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.

the class CacheReplicatedRendezvousAffinityExcludeNeighborsMultiNodeFullApiSelfTest method cacheConfiguration.

/** {@inheritDoc} */
@Override
protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception {
    CacheConfiguration cfg = super.cacheConfiguration(igniteInstanceName);
    cfg.setAffinity(new RendezvousAffinityFunction(true));
    return cfg;
}
Also used : RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 72 with RendezvousAffinityFunction

use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.

the class CacheReplicatedRendezvousAffinityMultiNodeFullApiSelfTest method cacheConfiguration.

/** {@inheritDoc} */
@Override
protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception {
    CacheConfiguration cfg = super.cacheConfiguration(igniteInstanceName);
    cfg.setAffinity(new RendezvousAffinityFunction());
    return cfg;
}
Also used : RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 73 with RendezvousAffinityFunction

use of org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction in project ignite by apache.

the class DemoCachesLoadService method cacheConfiguration.

/**
     * Create base cache configuration.
     *
     * @param name cache name.
     * @return Cache configuration with basic properties set.
     */
private static CacheConfiguration cacheConfiguration(String name) {
    CacheConfiguration ccfg = new CacheConfiguration<>(name);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    ccfg.setQueryDetailMetricsSize(10);
    ccfg.setStatisticsEnabled(true);
    ccfg.setSqlFunctionClasses(SQLFunctions.class);
    return ccfg;
}
Also used : RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Aggregations

RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)73 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)64 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)35 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)34 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)8 AffinityFunction (org.apache.ignite.cache.affinity.AffinityFunction)7 ArrayList (java.util.ArrayList)3 Random (java.util.Random)3 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)3 Ignite (org.apache.ignite.Ignite)2 IgniteCache (org.apache.ignite.IgniteCache)2 QueryEntity (org.apache.ignite.cache.QueryEntity)2 ClusterNode (org.apache.ignite.cluster.ClusterNode)2 MemoryConfiguration (org.apache.ignite.configuration.MemoryConfiguration)2 TestRecordingCommunicationSpi (org.apache.ignite.internal.TestRecordingCommunicationSpi)2 PlatformAffinityFunction (org.apache.ignite.internal.processors.platform.cache.affinity.PlatformAffinityFunction)2 PlatformDotNetAffinityFunction (org.apache.ignite.platform.dotnet.PlatformDotNetAffinityFunction)2 TestTcpCommunicationSpi (org.apache.ignite.util.TestTcpCommunicationSpi)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 CacheLoader (javax.cache.integration.CacheLoader)1