You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/05/12 12:57:39 UTC

[GitHub] [ignite] nizhikov commented on a change in pull request #9093: IGNITE-14701 Simple PDS upgrade test

nizhikov commented on a change in pull request #9093:
URL: https://github.com/apache/ignite/pull/9093#discussion_r631016021



##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/persistence_upgrade_test/DataLoaderAndCheckerApplication.java
##########
@@ -0,0 +1,57 @@
+/*
+ * 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.persistence_upgrade_test;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+import org.apache.ignite.internal.util.typedef.internal.U;
+
+/**
+ * Loads/checks the data.
+ */
+public class DataLoaderAndCheckerApplication extends IgniteAwareApplication {
+    /** {@inheritDoc} */
+    @Override public void run(JsonNode jNode) throws IgniteInterruptedCheckedException {
+        boolean check = jNode.get("check").asBoolean();
+
+        markInitialized();
+
+        waitForActivation();
+
+        CacheConfiguration<Integer, Integer> cacheCfg = new CacheConfiguration<>("cache");
+
+        IgniteCache<Integer, Integer> cache = ignite.getOrCreateCache(cacheCfg);
+
+        for (int i = 0; i < 10_000; i++) {
+            if (!check)
+                cache.put(i, i);

Review comment:
       Let's have some simple model class here instead of integer.
   
   `Model { int id; String name }` or similar.




-- 
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:
users@infra.apache.org