You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/05/22 15:13:00 UTC

[32/50] [abbrv] ignite git commit: Ignite-5075 pending

Ignite-5075 pending


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

Branch: refs/heads/ignite-5075-pds
Commit: cc3e63d6a3a7e87a89bd8a8720ab24c4f11ac655
Parents: 4bbf3af
Author: Igor Seliverstov <gv...@gmail.com>
Authored: Fri May 19 12:33:44 2017 +0300
Committer: Igor Seliverstov <gv...@gmail.com>
Committed: Fri May 19 12:34:20 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheGroupsTest.java | 43 +++++++++++++++++---
 1 file changed, 38 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cc3e63d6/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 3e3d3be..674971f 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
@@ -731,13 +731,17 @@ public class IgniteCacheGroupsTest extends GridCommonAbstractTest {
             }
         }
         else {
-            IgniteCache cache1 = ignite(1).cache(CACHE1);
-            IgniteCache cache2 = ignite(2).cache(CACHE2);
+            // async put ops
+            int ldrs = 4;
 
-            for (int i = 0; i < keys ; i++) {
-                cache1.put(i, data1[i]);
-                cache2.put(i, data2[i]);
+            List<Callable<?>> cls = new ArrayList<>(ldrs * 2);
+
+            for (int i = 0; i < ldrs ; i++) {
+                cls.add(putOperation(1, ldrs, i, CACHE1, data1));
+                cls.add(putOperation(2, ldrs, i, CACHE2, data2));
             }
+
+            GridTestUtils.runMultiThreaded(cls, "loaders");
         }
 
         checkLocalData(3, CACHE1, data1);
@@ -761,6 +765,35 @@ public class IgniteCacheGroupsTest extends GridCommonAbstractTest {
     }
 
     /**
+     * @param idx Node index.
+     * @param ldrs Loaders count.
+     * @param ldrIdx Loader index.
+     * @param cacheName Cache name.
+     * @param data Data.
+     * @return Callable for put operation.
+     */
+    private Callable<Void> putOperation(
+            final int idx,
+            final int ldrs,
+            final int ldrIdx,
+            final String cacheName,
+            final Integer[] data) {
+        return new Callable<Void>() {
+            @Override
+            public Void call() throws Exception {
+                IgniteCache cache = ignite(idx).cache(cacheName);
+
+                for (int j = 0, size = data.length; j < size ; j++) {
+                    if (j % ldrs == ldrIdx) {
+                        cache.put(j, data[j]);
+                    }
+                }
+                return null;
+            }
+        };
+    }
+
+    /**
      * Creates an array of random integers.
      *
      * @param cnt Array length.