ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: #ignite-237: Fix GridCacheDhtEvictionNearReadersSelfTest.
Date Wed, 25 Feb 2015 13:01:41 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-237 07cc9212c -> 3db5faca6


#ignite-237: Fix GridCacheDhtEvictionNearReadersSelfTest.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3db5faca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3db5faca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3db5faca

Branch: refs/heads/ignite-237
Commit: 3db5faca60709319ca82eb92603a540b32ce6e94
Parents: 07cc921
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Wed Feb 25 16:01:35 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Wed Feb 25 16:01:35 2015 +0300

----------------------------------------------------------------------
 .../dht/GridCacheDhtEvictionNearReadersSelfTest.java | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3db5faca/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
index 5a6cd22..d8cc525 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java
@@ -19,7 +19,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.cache.eviction.fifo.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
@@ -164,21 +164,14 @@ public class GridCacheDhtEvictionNearReadersSelfTest extends GridCommonAbstractT
     }
 
     /**
-     * @param idx Index.
-     * @return Affinity.
-     */
-    private CacheConsistentHashAffinityFunction affinity(int idx) {
-        return (CacheConsistentHashAffinityFunction)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 = (CacheRendezvousAffinityFunction) grid(0).jcache(null).
+            getConfiguration(CacheConfiguration.class).getAffinity();
 
-        return aff.nodes(aff.partition(key), grid(0).cluster().nodes(), 1);
+        return aff.assignPartition(aff.partition(key), new ArrayList<ClusterNode>(grid(0).cluster().nodes()),
1, null);
     }
 
     /**


Mime
View raw message