Skip to content

Commit

Permalink
#ignite-237: fix GridCacheDhtEvictionSelfTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivasilinets committed Feb 26, 2015
1 parent 4a356f8 commit f27e9d2
Showing 1 changed file with 6 additions and 5 deletions.
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.CacheRendezvousAffinityFunction;
import org.apache.ignite.cache.eviction.fifo.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
Expand Down Expand Up @@ -161,18 +161,19 @@ private GridDhtCacheAdapter<Integer, String> dht(Ignite g) {
* @param idx Index.
* @return Affinity.
*/
private CacheConsistentHashAffinityFunction affinity(int idx) {
return (CacheConsistentHashAffinityFunction)grid(idx).jcache(null).getConfiguration(CacheConfiguration.class).getAffinity();
private CacheRendezvousAffinityFunction affinity(int idx) {
return (CacheRendezvousAffinityFunction)grid(idx).jcache(null).
getConfiguration(CacheConfiguration.class).getAffinity();
}

/**
* @param key Key.
* @return Primary node for the given key.
*/
private Collection<ClusterNode> keyNodes(Object key) {
CacheConsistentHashAffinityFunction aff = affinity(0);
CacheRendezvousAffinityFunction aff = affinity(0);

return aff.nodes(aff.partition(key), grid(0).cluster().nodes(), 1);
return aff.assignPartition(aff.partition(key), new ArrayList(grid(0).cluster().nodes()), 1, null);
}

/**
Expand Down

0 comments on commit f27e9d2

Please sign in to comment.