anton-vinogradov commented on a change in pull request #8294:
URL: https://github.com/apache/ignite/pull/8294#discussion_r531116946



##########
File path: 
modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/load/UuidDataLoaderApplication.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.ducktest.tests.load;
+
+import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+/**
+ * Loading random uuids to cache.
+ */
+public class UuidDataLoaderApplication extends IgniteAwareApplication {
+    /** {@inheritDoc} */
+    @Override public void run(JsonNode jNode) throws InterruptedException {
+        String cacheName = jNode.get("cacheName").asText();
+
+        long size = jNode.get("size").asLong();
+
+        int dataSize = jNode.get("dataSize").asInt();
+
+        markInitialized();
+
+        int threads = Runtime.getRuntime().availableProcessors() / 2;
+
+        long iterThread = size / threads;
+
+        CountDownLatch latch = new CountDownLatch(threads);
+
+        for (int i = 0; i < threads; i++)
+            new Thread(() -> {
+                try (IgniteDataStreamer<UUID, byte[]> dataStreamer = 
ignite.dataStreamer(cacheName)) {

Review comment:
       Do we have proof that many data streamers are faster than a single?

##########
File path: 
modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/load/UuidDataLoaderApplication.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.ducktest.tests.load;
+
+import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+/**
+ * Loading random uuids to cache.
+ */
+public class UuidDataLoaderApplication extends IgniteAwareApplication {
+    /** {@inheritDoc} */
+    @Override public void run(JsonNode jNode) throws InterruptedException {
+        String cacheName = jNode.get("cacheName").asText();
+
+        long size = jNode.get("size").asLong();
+
+        int dataSize = jNode.get("dataSize").asInt();
+
+        markInitialized();
+
+        int threads = Runtime.getRuntime().availableProcessors() / 2;
+
+        long iterThread = size / threads;
+
+        CountDownLatch latch = new CountDownLatch(threads);
+
+        for (int i = 0; i < threads; i++)
+            new Thread(() -> {
+                try (IgniteDataStreamer<UUID, byte[]> dataStreamer = 
ignite.dataStreamer(cacheName)) {
+                    for (long j = 0L; j <= iterThread; j++)
+                        dataStreamer.addData(UUID.randomUUID(), new 
byte[dataSize]);

Review comment:
       What the reason to have data differ from the key?

##########
File path: modules/ducktests/tests/ignitetest/services/utils/ignite_aware.py
##########
@@ -277,3 +277,28 @@ def __dump_netfilter_settings(node):
         Reads current netfilter settings on the node for debugging purposes.
         """
         return str(node.account.ssh_client.exec_command("sudo iptables -L 
-n")[1].read(), sys.getdefaultencoding())
+
+    def restart(self, timeout_sec=180):
+        """
+        Restart ignite cluster without cleaning.
+        """
+        self.stop()
+
+        for node in self.nodes:
+            super().start_node(node)
+
+        self.logger.info("Waiting for Ignite(s) to start...")
+
+        for node in self.nodes:
+            self.await_node_started(node, timeout_sec)

Review comment:
       sync start already provides such guarantee

##########
File path: modules/ducktests/tests/ignitetest/services/utils/ignite_aware.py
##########
@@ -277,3 +277,28 @@ def __dump_netfilter_settings(node):
         Reads current netfilter settings on the node for debugging purposes.
         """
         return str(node.account.ssh_client.exec_command("sudo iptables -L 
-n")[1].read(), sys.getdefaultencoding())
+
+    def restart(self, timeout_sec=180):
+        """
+        Restart ignite cluster without cleaning.
+        """
+        self.stop()
+
+        for node in self.nodes:
+            super().start_node(node)

Review comment:
       why super()?

##########
File path: 
modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/load/UuidDataLoaderApplication.java
##########
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.ducktest.tests.load;
+
+import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+/**
+ * Loading random uuids to cache.
+ */
+public class UuidDataLoaderApplication extends IgniteAwareApplication {
+    /** {@inheritDoc} */
+    @Override public void run(JsonNode jNode) throws InterruptedException {
+        String cacheName = jNode.get("cacheName").asText();
+
+        long size = jNode.get("size").asLong();
+
+        int dataSize = jNode.get("dataSize").asInt();
+
+        markInitialized();
+
+        long start = System.currentTimeMillis();
+
+        loadParallel(ignite, cacheName, size, dataSize);
+
+        recordResult("DURATION", System.currentTimeMillis() - start);
+
+        markFinished();
+    }
+
+    /** */
+    private void loadParallel(Ignite ignite, String cacheName, long size, int 
dataSize)
+            throws InterruptedException {
+        int threads = Runtime.getRuntime().availableProcessors() / 2;

Review comment:
       I still can't understand the formula. 
   Do we have a benchmark here? 

##########
File path: modules/ducktests/tests/ignitetest/services/ignite_app.py
##########
@@ -53,6 +53,9 @@ def start(self):
 
         self.__check_status("IGNITE_APPLICATION_INITIALIZED", 
timeout=self.timeout_sec)
 
+    def wait(self, timeout_sec=600):

Review comment:
       this answer is not clear to me.
   run consist of start, then wait, the stop.
   "wait" means worker thread join and "stop" gives you await_stopped guarantee.

##########
File path: modules/ducktests/tests/ignitetest/tests/snapshot_test.py
##########
@@ -0,0 +1,116 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Module contains snapshot test.
+"""
+from ducktape.mark.resource import cluster
+
+from ignitetest.services.ignite import IgniteService
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.utils.control_utility import ControlUtility
+from ignitetest.services.utils.ignite_configuration import 
IgniteConfiguration, DataStorageConfiguration
+from ignitetest.services.utils.ignite_configuration.cache import 
CacheConfiguration
+from ignitetest.services.utils.ignite_configuration.data_storage import 
DataRegionConfiguration
+from ignitetest.services.utils.ignite_configuration.discovery import 
from_ignite_cluster
+from ignitetest.utils import ignite_versions
+from ignitetest.utils.ignite_test import IgniteTest
+from ignitetest.utils.version import DEV_BRANCH, IgniteVersion
+
+
+# pylint: disable=W0223
+class SnapshotTest(IgniteTest):
+    """
+    Test Snapshot.
+    """
+    NUM_NODES = 4
+
+    SNAPSHOT_NAME = "test_snapshot"
+
+    CACHE_NAME = "TEST_CACHE"
+
+    @cluster(num_nodes=NUM_NODES)
+    @ignite_versions(str(DEV_BRANCH))
+    def snapshot_test(self, ignite_version):
+        """
+        Basic snapshot test.
+        """
+        data_storage = 
DataStorageConfiguration(default=DataRegionConfiguration(persistent=True))
+
+        ignite_config = IgniteConfiguration(
+            version=IgniteVersion(ignite_version),
+            data_storage=data_storage,
+            caches=[CacheConfiguration(name=self.CACHE_NAME, 
cache_mode='REPLICATED',

Review comment:
       replicated is not a default?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to