Skip to content

Commit

Permalink
#ignite-237: change affinity function in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivasilinets committed Feb 26, 2015
1 parent 7d8b54f commit f358766
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 27 deletions.
Expand Up @@ -20,7 +20,7 @@
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.spi.discovery.tcp.*;
Expand Down Expand Up @@ -114,7 +114,7 @@ public abstract class GridCachePreloadRestartAbstractSelfTest extends GridCommon
cc.setStartSize(20);
cc.setPreloadMode(preloadMode);
cc.setPreloadBatchSize(preloadBatchSize);
cc.setAffinity(new CacheConsistentHashAffinityFunction(false, partitions));
cc.setAffinity(new CacheRendezvousAffinityFunction(false, partitions));
cc.setBackups(backups);
cc.setAtomicityMode(TRANSACTIONAL);

Expand Down
Expand Up @@ -19,7 +19,7 @@

import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
Expand Down Expand Up @@ -75,7 +75,7 @@ public class GridCachePartitionedTopologyChangeSelfTest extends GridCommonAbstra
CacheConfiguration cc = defaultCacheConfiguration();

cc.setCacheMode(PARTITIONED);
cc.setAffinity(new CacheConsistentHashAffinityFunction(false, 18));
cc.setAffinity(new CacheRendezvousAffinityFunction(false, 18));
cc.setBackups(1);
cc.setPreloadMode(SYNC);
cc.setDistributionMode(PARTITIONED_ONLY);
Expand Down Expand Up @@ -498,8 +498,7 @@ private void checkTxNodeLeft(int nodeType) throws Exception {
txFut.get(1000);

for (int i = 0; i < 3; i++) {
CacheConsistentHashAffinityFunction affinity = (CacheConsistentHashAffinityFunction)((IgniteKernal)grid(i))
.internalCache().context().config().getAffinity();
CacheAffinity affinity = grid(i).affinity(null);

ConcurrentMap addedNodes = U.field(affinity, "addedNodes");

Expand Down
Expand Up @@ -18,8 +18,7 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;

import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
Expand Down Expand Up @@ -62,7 +61,7 @@ protected CacheConfiguration cacheConfiguration() {
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setPreloadMode(SYNC);
cacheCfg.setAffinity(new CacheConsistentHashAffinityFunction(false, 10));
cacheCfg.setAffinity(new CacheRendezvousAffinityFunction(false, 10));
cacheCfg.setBackups(0);
return cacheCfg;
}
Expand Down
Expand Up @@ -17,7 +17,7 @@

package org.apache.ignite.internal.processors.cache.distributed.near;

import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.processors.cache.distributed.*;

Expand Down Expand Up @@ -45,7 +45,7 @@ public class GridCachePartitionedNodeRestartTest extends GridCacheAbstractNodeRe
cc.setStartSize(20);
cc.setPreloadMode(preloadMode);
cc.setPreloadBatchSize(preloadBatchSize);
cc.setAffinity(new CacheConsistentHashAffinityFunction(false, partitions));
cc.setAffinity(new CacheRendezvousAffinityFunction(false, partitions));
cc.setBackups(backups);

c.setCacheConfiguration(cc);
Expand Down
Expand Up @@ -17,7 +17,7 @@

package org.apache.ignite.internal.processors.cache.distributed.near;

import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
import org.apache.ignite.transactions.*;
Expand All @@ -44,7 +44,7 @@ public class GridCachePartitionedOptimisticTxNodeRestartTest extends GridCacheAb
cc.setStartSize(20);
cc.setPreloadMode(preloadMode);
cc.setPreloadBatchSize(preloadBatchSize);
cc.setAffinity(new CacheConsistentHashAffinityFunction(false, partitions));
cc.setAffinity(new CacheRendezvousAffinityFunction(false, partitions));
cc.setBackups(backups);

c.setCacheConfiguration(cc);
Expand Down
Expand Up @@ -19,7 +19,7 @@

import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
Expand Down Expand Up @@ -76,7 +76,7 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
CacheConfiguration cc = defaultCacheConfiguration();

cc.setCacheMode(CacheMode.PARTITIONED);
cc.setAffinity(new CacheConsistentHashAffinityFunction(false, 18));
cc.setAffinity(new CacheRendezvousAffinityFunction(false, 18));
cc.setBackups(1);
cc.setPreloadMode(CachePreloadMode.SYNC);

Expand Down
Expand Up @@ -20,7 +20,7 @@
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
Expand Down Expand Up @@ -64,7 +64,7 @@ public class GridCacheSynchronousEvictionsFailoverSelfTest extends GridCacheAbst

ccfg.setBackups(2);

ccfg.setAffinity(new CacheConsistentHashAffinityFunction(false, 500));
ccfg.setAffinity(new CacheRendezvousAffinityFunction(false, 500));

return ccfg;
}
Expand Down
Expand Up @@ -19,7 +19,7 @@

import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.lang.*;
Expand Down Expand Up @@ -245,7 +245,7 @@ public void testPointerAfterRehash() throws Exception {
public void testPutRandomKeys() throws Exception {
map = newMap();

CacheAffinityFunction aff = new CacheConsistentHashAffinityFunction(parts, null);
CacheAffinityFunction aff = new CacheRendezvousAffinityFunction(parts, null);

getTestResources().inject(aff);

Expand Down
Expand Up @@ -18,7 +18,7 @@
package org.apache.ignite.internal.util.offheap;

import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
Expand Down Expand Up @@ -76,7 +76,7 @@ protected GridOffHeapPartitionedMapPerformanceAbstractTest() {
keys = new T3[LOAD_CNT];
wrappers = new GridByteArrayWrapper[LOAD_CNT];

CacheAffinityFunction aff = new CacheConsistentHashAffinityFunction();
CacheAffinityFunction aff = new CacheRendezvousAffinityFunction();

Random rnd = new Random();

Expand Down
Expand Up @@ -19,7 +19,7 @@

import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.cache.eviction.lru.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.spi.discovery.tcp.*;
Expand Down Expand Up @@ -72,7 +72,7 @@ public class GridCachePartitionedAtomicLongLoadTest extends GridCommonAbstractTe
cc.setWriteSynchronizationMode(FULL_SYNC);
cc.setEvictionPolicy(new CacheLruEvictionPolicy<>(1000));
cc.setBackups(1);
cc.setAffinity(new CacheConsistentHashAffinityFunction(true));
cc.setAffinity(new CacheRendezvousAffinityFunction(true));
cc.setEvictSynchronized(true);
cc.setEvictNearSynchronized(true);

Expand Down
Expand Up @@ -18,7 +18,7 @@
package org.apache.ignite.loadtests.offheap;

import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.offheap.*;
import org.apache.ignite.internal.util.typedef.*;
Expand Down Expand Up @@ -77,7 +77,7 @@ protected GridOffHeapPartitionedMapPerformanceAbstractTest() {
keys = new T3[LOAD_CNT];
wrappers = new GridByteArrayWrapper[LOAD_CNT];

CacheAffinityFunction aff = new CacheConsistentHashAffinityFunction();
CacheAffinityFunction aff = new CacheRendezvousAffinityFunction();

Random rnd = new Random();

Expand Down
Expand Up @@ -17,7 +17,7 @@

package org.apache.ignite.loadtests.offheap.unsafe;

import org.apache.ignite.cache.affinity.consistenthash.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.internal.util.offheap.*;

/**
Expand All @@ -26,7 +26,7 @@
public class GridUnsafePartitionedMapPerformanceTest extends GridOffHeapPartitionedMapPerformanceAbstractTest {
/** {@inheritDoc} */
@Override protected GridOffHeapPartitionedMap newMap() {
return GridOffHeapMapFactory.unsafePartitionedMap(CacheConsistentHashAffinityFunction.DFLT_PARTITION_COUNT,
return GridOffHeapMapFactory.unsafePartitionedMap(CacheRendezvousAffinityFunction.DFLT_PARTITION_COUNT,
Runtime.getRuntime().availableProcessors(), load, LOAD_CNT, mem, lruStripes, null);
}
}

0 comments on commit f358766

Please sign in to comment.