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 2020/12/21 08:13:10 UTC

[GitHub] [ignite] timoninmaxim commented on a change in pull request #8588: IGNITE-13605 Ducktests test: PDS compatibility for ignite versions

timoninmaxim commented on a change in pull request #8588:
URL: https://github.com/apache/ignite/pull/8588#discussion_r546560628



##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pds_compatibility_test/DictionaryCacheApplicationCheck.java
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.pds_compatibility_test;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+public class DictionaryCacheApplicationCheck extends IgniteAwareApplication {
+    /**
+     * {@inheritDoc}
+     */
+    @Override protected void run(JsonNode jsonNode) {
+        log.info("Opening cache...");
+
+        IgniteCache<Long, String> cache = ignite.cache(jsonNode.get("cacheName").asText());
+
+        for (long i = 0; i < jsonNode.get("range").asLong(); i++) {
+            cache.get(i);

Review comment:
       from cache.get docs:
   > @return the element, or null, if it does not exist
   
   is it enough for this check?
   

##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pds_compatibility_test/Account.java
##########
@@ -0,0 +1,86 @@
+/*
+ * 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.pds_compatibility_test;
+
+import java.io.Serializable;
+import org.apache.ignite.cache.query.annotations.QuerySqlField;
+
+public class Account implements Serializable {
+
+    @QuerySqlField(index = true, inlineSize = 48)

Review comment:
       Can we make inlineSize as test param too? To cover all test cases with inlinening (inline = 0, inline is too small, inline is enough)

##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pds_compatibility_test/Account.java
##########
@@ -0,0 +1,86 @@
+/*
+ * 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.pds_compatibility_test;
+
+import java.io.Serializable;
+import org.apache.ignite.cache.query.annotations.QuerySqlField;
+
+public class Account implements Serializable {

Review comment:
       Please add javadocs for all classes.

##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pds_compatibility_test/DictionaryCacheApplication.java
##########
@@ -0,0 +1,50 @@
+/*
+ * 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.pds_compatibility_test;
+
+import java.util.UUID;
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+public class DictionaryCacheApplication extends IgniteAwareApplication {
+    /**
+     * {@inheritDoc}
+     */
+    @Override protected void run(JsonNode jsonNode) {
+        log.info("Creating cache...");
+
+        CacheConfiguration<Long, String> cacheCfg = new CacheConfiguration<>();
+        cacheCfg.setName(jsonNode.get("cacheName").asText())
+                .setCacheMode(CacheMode.REPLICATED)

Review comment:
       Let's make cacheMode and atomicity modes as test params?

##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pds_compatibility_test/Account.java
##########
@@ -0,0 +1,86 @@
+/*
+ * 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.pds_compatibility_test;
+
+import java.io.Serializable;
+import org.apache.ignite.cache.query.annotations.QuerySqlField;
+
+public class Account implements Serializable {
+
+    @QuerySqlField(index = true, inlineSize = 48)
+    private final String firstName;
+
+    @QuerySqlField(index = true, inlineSize = 48)
+    private final String lastName;
+
+    @QuerySqlField(index = true, inlineSize = 48)
+    private final String catName;
+
+    @QuerySqlField(index = true, inlineSize = 48)
+    private final String dogName;
+
+    @QuerySqlField(index = true, inlineSize = 48)
+    private final String city;
+
+    @QuerySqlField(index = true, inlineSize = 48)
+    private final String country;
+
+    @QuerySqlField(index = true, inlineSize = 48)
+    private final String eMail;
+
+    @QuerySqlField(index = true, inlineSize = 48)
+    private final String phoneNumber;
+
+    @QuerySqlField(index = true, inlineSize = 48)
+    private final String socialNumber;
+
+    @QuerySqlField(index = true, inlineSize = 48)
+    private final Long postIndex;
+
+    public final long balance;
+
+    public Account(String firstName, String lastName, String catName, String dogName, String city, String country, String eMail, String phoneNumber, String socialNumber, Long postIndex, long balance) {

Review comment:
       In test constructor get only 2 params "uuid" and "i". Also most of fields are String and only one is different (Long). What is a purpose of this big class?




----------------------------------------------------------------
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