ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [10/16] ignite git commit: ignite-5075
Date Sun, 04 Jun 2017 07:50:12 GMT
ignite-5075


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

Branch: refs/heads/ignite-5075-pds
Commit: 0947b964d35e15578b2cc80d2c5c1d5f1ebfd54a
Parents: df5d49f
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Jun 2 14:09:05 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Jun 2 14:09:05 2017 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtCacheAdapter.java    |  6 ++---
 .../processors/cache/IgniteCacheGroupsTest.java | 27 ++++++++++++++++++--
 2 files changed, 28 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0947b964/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 4afa257..2ac1ba6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -942,9 +942,9 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
                             res.setContainsValue();
                     }
                     else {
-                        AffinityTopologyVersion topVer = ctx.shared().exchange().readyAffinityVersion();
+                        AffinityTopologyVersion topVer = ctx.shared().exchange().lastTopologyFuture().topologyVersion();
 
-                        assert topVer.compareTo(req.topologyVersion()) >= 0 : "Wrong ready
topology version for " +
+                        assert topVer.compareTo(req.topologyVersion()) > 0 : "Wrong ready
topology version for " +
                             "invalid partitions response [topVer=" + topVer + ", req=" +
req + ']';
 
                         res = new GridNearSingleGetResponse(ctx.cacheId(),
@@ -1032,7 +1032,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
                 }
 
                 if (!F.isEmpty(fut.invalidPartitions()))
-                    res.invalidPartitions(fut.invalidPartitions(), ctx.shared().exchange().readyAffinityVersion());
+                    res.invalidPartitions(fut.invalidPartitions(), ctx.shared().exchange().lastTopologyFuture().topologyVersion());
 
                 try {
                     ctx.io().send(nodeId, res, ctx.ioPolicy());

http://git-wip-us.apache.org/repos/asf/ignite/blob/0947b964/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
index fd28da0..09f029e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
@@ -28,6 +28,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Random;
 import java.util.Set;
+import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
@@ -3522,9 +3523,11 @@ public class IgniteCacheGroupsTest extends GridCommonAbstractTest {
      * @param cache Cache.
      */
     private void cacheOperation(ThreadLocalRandom rnd, IgniteCache cache) {
-        Object key = rnd.nextInt(1000);
+        final int KEYS = 10_000;
 
-        switch (rnd.nextInt(4)) {
+        Integer key = rnd.nextInt(KEYS);
+
+        switch (rnd.nextInt(6)) {
             case 0:
                 cache.put(key, 1);
 
@@ -3544,6 +3547,26 @@ public class IgniteCacheGroupsTest extends GridCommonAbstractTest {
                 cache.localPeek(key);
 
                 break;
+
+            case 4:
+                Set<Integer> keys = new HashSet<>();
+
+                for (int i = 0; i < 5; i++)
+                    keys.add(rnd.nextInt(KEYS));
+
+                cache.getAll(keys);
+
+                break;
+
+            case 5:
+                Map<Integer, Integer> map = new TreeMap<>();
+
+                for (int i = 0; i < 5; i++)
+                    map.put(rnd.nextInt(KEYS), i);
+
+                cache.putAll(map);
+
+                break;
         }
     }
 


Mime
View raw message