This is an automated email from the ASF dual-hosted git repository.

ptupitsyn pushed a commit to branch ignite-14067
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 973fc801c4017e618ab978cd9a4233fd61cf4386
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Thu Jan 28 11:29:03 2021 +0300

    Add PutAllTxTest (remove later)
---
 .../java/org/apache/ignite/cache/PutAllTxTest.java | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git 
a/modules/core/src/test/java/org/apache/ignite/cache/PutAllTxTest.java 
b/modules/core/src/test/java/org/apache/ignite/cache/PutAllTxTest.java
new file mode 100644
index 0000000..ccebf8c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/cache/PutAllTxTest.java
@@ -0,0 +1,39 @@
+package org.apache.ignite.cache;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.UUID;
+
+public class PutAllTxTest extends GridCommonAbstractTest {
+    @Test
+    public void testPutAll() throws Exception {
+        Ignition.start(getConfiguration("server1"));
+        Ignition.start(getConfiguration("server2"));
+        Ignite ignite = 
Ignition.start(getConfiguration("client").setClientMode(true));
+
+        IgniteCache<Integer, String> cache = ignite.createCache(
+                new CacheConfiguration<Integer, String>("c")
+                        .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL));
+
+        int count = 40000;
+        int valSize = 1000;
+
+        Map<Integer, String> data = new TreeMap<>();
+        for (int i = 0; i < count; i++)
+            data.put(i, new String(new char[valSize]) + UUID.randomUUID());
+
+        long begin = System.nanoTime();
+
+        cache.putAll(data);
+
+        long dur = System.nanoTime() - begin;
+        System.out.println(">>>>> " + dur / 1000000);
+    }
+}

Reply via email to