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-648: add debug info
Date Thu, 09 Jul 2015 18:04:13 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-648-putAll [created] 71ce030fe


# ignite-648: add debug info


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

Branch: refs/heads/ignite-648-putAll
Commit: 71ce030fe420ded0c9ccba78be3483f07a0c885f
Parents: 9fa7acf
Author: ashutak <ashutak@gridgain.com>
Authored: Thu Jul 9 21:04:11 2015 +0300
Committer: ashutak <ashutak@gridgain.com>
Committed: Thu Jul 9 21:04:11 2015 +0300

----------------------------------------------------------------------
 ...achePartitionedMultiNodeFullApiSelfTest.java | 43 +++++++++++++++++---
 .../multijvm/IgniteCacheProcessProxy.java       |  2 +
 2 files changed, 40 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/71ce030f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
index a5e7a31..6f6b7cb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
 
+import javax.cache.*;
 import java.util.*;
 
 import static org.apache.ignite.cache.CacheMode.*;
@@ -97,13 +98,13 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
 
         Map<Integer, Integer> putMap = new LinkedHashMap<>();
 
-        int size = 100;
+        final int size = 100;
 
         for (int i = 0; i < size; i++)
             putMap.put(i, i);
 
-        IgniteCache<Object, Object> prj0 = grid(0).cache(null);
-        IgniteCache<Object, Object> prj1 = grid(1).cache(null);
+        final IgniteCache<Object, Object> prj0 = grid(1).cache(null);
+        final IgniteCache<Object, Object> prj1 = grid(2).cache(null);
 
         prj0.putAll(putMap);
 
@@ -121,9 +122,41 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
 
         info(">>> After second put.");
 
+        Thread.sleep(10_000);
+
+        Affinity<Object> affinity = grid(0).affinity(null);
+
         for (int i = 0; i < size; i++) {
-            assertEquals(i * i, prj0.get(i));
-            assertEquals(i * i, prj1.get(i));
+            Collection<ClusterNode> nodes = affinity.mapKeyToPrimaryAndBackups(i);
+            System.out.print(">>>>>> Affinity for i=" + i + " ");
+
+            for (ClusterNode node : nodes)
+                System.out.print(node.id() + " ");
+
+            System.out.println();
+        }
+
+        for (int i = 0; i < gridCount(); i++) {
+            System.out.println("*********** Grid " + i + " ***************");
+
+            executeOnLocalOrRemoteJvm(grid(i).cache(null), new TestCacheRunnable<Object,
Object>() {
+                @Override public void run(Ignite ignite, IgniteCache<Object, Object>
cache) throws Exception {
+                    for (int i = 0; i < size; i++) {
+                        if (i==12)
+                            cache.get(i);
+
+                        System.out.println(">>>>> i=" + i + " v=" + cache.get(i));
+                    }
+
+                    for (Cache.Entry<Object, Object> entry : cache)
+                        System.out.println(">>>>> Entry=" + entry);
+                }
+            });
+        }
+
+        for (int g = 0; g < gridCount(); g++) {
+            for (int i = 0; i < size; i++)
+                assertEquals("Grid " + g, i * i, grid(g).cache(null).get(i));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/71ce030f/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
index b9b2d6a..74f785b 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
@@ -323,6 +323,8 @@ public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K,
V> {
     @Override public void putAll(final Map<? extends K, ? extends V> map) {
         compute.run(new IgniteRunnable() {
             @Override public void run() {
+                System.out.println(">>>>> map=" + map);
+
                 cache().putAll(map);
             }
         });


Mime
View raw message