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

anton-vinogradov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 54f054c4fd7 IGNITE-28953 Init CalciteMessageFactory with marshallers 
in Calcite tests (#13434)
54f054c4fd7 is described below

commit 54f054c4fd79678eef3ea970d91ded12a310fba5
Author: Anton Vinogradov <[email protected]>
AuthorDate: Wed Aug 5 02:16:29 2026 +0300

    IGNITE-28953 Init CalciteMessageFactory with marshallers in Calcite tests 
(#13434)
---
 .../processors/query/calcite/exec/rel/ContinuousExecutionTest.java | 7 ++++++-
 .../message/CalciteCommunicationMessageSerializationTest.java      | 7 ++++++-
 .../processors/query/calcite/planner/PlanExecutionTest.java        | 7 ++++++-
 .../plugin/AbstractMarshallableMessageFactoryProvider.java         | 4 ++++
 4 files changed, 22 insertions(+), 3 deletions(-)

diff --git 
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ContinuousExecutionTest.java
 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ContinuousExecutionTest.java
index af835b4f0ad..422a9d71d92 100644
--- 
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ContinuousExecutionTest.java
+++ 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ContinuousExecutionTest.java
@@ -34,6 +34,7 @@ import 
org.apache.ignite.internal.processors.query.calcite.message.CalciteMessag
 import org.apache.ignite.internal.processors.query.calcite.trait.AllNodes;
 import 
org.apache.ignite.internal.processors.query.calcite.type.IgniteTypeFactory;
 import org.apache.ignite.internal.processors.query.calcite.util.TypeUtils;
+import org.apache.ignite.marshaller.Marshallers;
 import 
org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider;
 import org.junit.Before;
 import org.junit.Test;
@@ -98,8 +99,12 @@ public class ContinuousExecutionTest extends 
AbstractExecutionTest {
         nodesCnt = remoteFragmentsCnt + 1;
         super.setup();
 
+        CalciteMessageFactory msgFactory = new CalciteMessageFactory();
+
+        msgFactory.init(Marshallers.jdk(), Marshallers.jdk());
+
         // Register messages in Message#REGISTRATIONS and avoids failure in 
Message#directType().
-        new IgniteMessageFactoryImpl(new MessageFactoryProvider[]{new 
CalciteMessageFactory()});
+        new IgniteMessageFactoryImpl(new MessageFactoryProvider[]{msgFactory});
     }
 
     /** */
diff --git 
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteCommunicationMessageSerializationTest.java
 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteCommunicationMessageSerializationTest.java
index 7a88dc1687e..d703949d78c 100644
--- 
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteCommunicationMessageSerializationTest.java
+++ 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteCommunicationMessageSerializationTest.java
@@ -18,12 +18,17 @@
 package org.apache.ignite.internal.processors.query.calcite.message;
 
 import org.apache.ignite.internal.managers.AbstractMessageSerializationTest;
+import org.apache.ignite.marshaller.Marshallers;
 import 
org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider;
 
 /** */
 public class CalciteCommunicationMessageSerializationTest extends 
AbstractMessageSerializationTest {
     /** {@inheritDoc} */
     @Override protected MessageFactoryProvider messageFactory() {
-        return new CalciteMessageFactory();
+        CalciteMessageFactory msgFactory = new CalciteMessageFactory();
+
+        msgFactory.init(Marshallers.jdk(), Marshallers.jdk());
+
+        return msgFactory;
     }
 }
diff --git 
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/PlanExecutionTest.java
 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/PlanExecutionTest.java
index 75530ae0304..327f28386cd 100644
--- 
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/PlanExecutionTest.java
+++ 
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/PlanExecutionTest.java
@@ -65,6 +65,7 @@ import 
org.apache.ignite.internal.processors.query.calcite.util.Commons;
 import 
org.apache.ignite.internal.processors.security.NoOpIgniteSecurityProcessor;
 import org.apache.ignite.internal.thread.pool.IgniteStripedThreadPoolExecutor;
 import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.marshaller.Marshallers;
 import 
org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider;
 import org.apache.ignite.testframework.junits.GridTestKernalContext;
 import org.junit.Assert;
@@ -82,8 +83,12 @@ public class PlanExecutionTest extends AbstractPlannerTest {
     @Override protected void beforeTest() throws Exception {
         super.beforeTest();
 
+        CalciteMessageFactory msgFactory = new CalciteMessageFactory();
+
+        msgFactory.init(Marshallers.jdk(), Marshallers.jdk());
+
         // Register messages in Message#REGISTRATIONS and avoids failure in 
Message#directType().
-        new IgniteMessageFactoryImpl(new MessageFactoryProvider[]{new 
CalciteMessageFactory()});
+        new IgniteMessageFactoryImpl(new MessageFactoryProvider[]{msgFactory});
     }
 
     /**
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/plugin/AbstractMarshallableMessageFactoryProvider.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/plugin/AbstractMarshallableMessageFactoryProvider.java
index 74e8768167c..083be41b16d 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/plugin/AbstractMarshallableMessageFactoryProvider.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/plugin/AbstractMarshallableMessageFactoryProvider.java
@@ -68,6 +68,10 @@ public abstract class 
AbstractMarshallableMessageFactoryProvider implements Mess
 
     /** */
     private static <T extends Message> void register(IgniteMessageFactory 
factory, Class<T> cls, short id, Marshaller marsh) {
+        // Companions are instantiated right here, so a provider registering 
before init() would bind them to a null
+        // marshaller instead of picking the proper one up later.
+        assert marsh != null : "Provider is not initialized, see init(), while 
registering " + cls.getName();
+
         MessageSerializer<T> serializer = loadGenerated(cls, "Serializer", 
null, true);
 
         // A MarshallableMessage always gets a generated marshaller (the hook 
call alone is a statement), so its

Reply via email to