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/12/06 06:57:47 UTC

[GitHub] [ignite-3] tkalkirill opened a new pull request #492: IGNITE-16056 Using polymorphic schema leads to ClassCastException

tkalkirill opened a new pull request #492:
URL: https://github.com/apache/ignite-3/pull/492


   https://issues.apache.org/jira/browse/IGNITE-16056


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

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] tkalkirill commented on a change in pull request #492: IGNITE-16056 Using polymorphic schema leads to ClassCastException

Posted by GitBox <gi...@apache.org>.
tkalkirill commented on a change in pull request #492:
URL: https://github.com/apache/ignite-3/pull/492#discussion_r763007556



##########
File path: modules/configuration/src/main/java/org/apache/ignite/internal/configuration/util/ConfigurationNotificationsUtil.java
##########
@@ -622,7 +622,7 @@ public Void visitNamedListNode(String key, NamedListNode<?> newNamedList) {
 
                 for (String name : newNamedList.namedListKeys()) {
                     DynamicConfiguration<InnerNode, ?> newNodeCfg =
-                            (DynamicConfiguration<InnerNode, ?>) namedDynamicConfig(cfgNode, key).get(name);
+                            (DynamicConfiguration<InnerNode, ?>) namedDynamicConfig(cfgNode, key).touchMembers().get(name);

Review comment:
       You are right, corrected it.




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

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] ibessonov commented on a change in pull request #492: IGNITE-16056 Using polymorphic schema leads to ClassCastException

Posted by GitBox <gi...@apache.org>.
ibessonov commented on a change in pull request #492:
URL: https://github.com/apache/ignite-3/pull/492#discussion_r763725937



##########
File path: modules/configuration/src/test/java/org/apache/ignite/internal/configuration/ConfigurationRegistryTest.java
##########
@@ -119,27 +123,53 @@ void missingPolymorphicExtension() {
                         List.of()
                 )
         );
+
         assertThat(ex.getMessage(), is("Polymorphic configuration schemas for which no extensions were found: "
                 + "[class org.apache.ignite.internal.configuration.ConfigurationRegistryTest$"
                 + "FirstPolymorphicConfigurationSchema]"));
     }
 
+    @Test
+    void testComplicatedPolymorphicConfig() throws Exception {
+        ConfigurationRegistry registry = new ConfigurationRegistry(
+                List.of(SixthRootConfiguration.KEY),
+                Map.of(),
+                new TestConfigurationStorage(LOCAL),
+                List.of(),
+                List.of(Fourth0PolymorphicConfigurationSchema.class)
+        );
+
+        registry.start();
+
+        registry.getConfiguration(SixthRootConfiguration.KEY).change(c -> c
+                .changePoly(toFirst0Polymorphic(0))
+                .changePolyNamed(c0 -> c0.create("1", toFirst0Polymorphic(1)))
+                .changeEntity(c0 -> c0.changePoly(toFirst0Polymorphic(2)).changePolyNamed(c1 -> c1.create("3", toFirst0Polymorphic(3))))
+                .changeEntityNamed(c0 -> c0.create("4",
+                        c1 -> c1.changePoly(toFirst0Polymorphic(4)).changePolyNamed(c2 -> c2.create("5", toFirst0Polymorphic(5)))))
+        ).get(1, SECONDS);
+
+        registry.stop();

Review comment:
       This should be in finally section




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

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] ibessonov merged pull request #492: IGNITE-16056 Using polymorphic schema leads to ClassCastException

Posted by GitBox <gi...@apache.org>.
ibessonov merged pull request #492:
URL: https://github.com/apache/ignite-3/pull/492


   


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

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] ibessonov commented on a change in pull request #492: IGNITE-16056 Using polymorphic schema leads to ClassCastException

Posted by GitBox <gi...@apache.org>.
ibessonov commented on a change in pull request #492:
URL: https://github.com/apache/ignite-3/pull/492#discussion_r762991508



##########
File path: modules/configuration/src/main/java/org/apache/ignite/internal/configuration/util/ConfigurationNotificationsUtil.java
##########
@@ -622,7 +622,7 @@ public Void visitNamedListNode(String key, NamedListNode<?> newNamedList) {
 
                 for (String name : newNamedList.namedListKeys()) {
                     DynamicConfiguration<InnerNode, ?> newNodeCfg =
-                            (DynamicConfiguration<InnerNode, ?>) namedDynamicConfig(cfgNode, key).get(name);
+                            (DynamicConfiguration<InnerNode, ?>) namedDynamicConfig(cfgNode, key).touchMembers().get(name);

Review comment:
       I don't think you should do it on every iteration




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

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org