Vladsz83 commented on code in PR #13462:
URL: https://github.com/apache/ignite/pull/13462#discussion_r3773279898


##########
modules/core/src/test/java/org/apache/ignite/spi/MessagesPluginProvider.java:
##########
@@ -43,13 +46,23 @@ public MessagesPluginProvider(Class<? extends Message>... 
msgs) {
             short directType = CoreMessagesProvider.MAX_MESSAGE_ID + 1;
 
             for (Class<? extends Message> msg : msgs) {
-                f.register(directType, loadSerializer(msg));
+                f.register(directType, loadSerializer(msg), marshaller(msg));
 
                 directType++;
             }
         };
     }
 
+    /** @return Generated marshaller of the message, or {@code null} when the 
message has nothing to marshal. */
+    private static <T extends Message> @Nullable MessageMarshaller<T> 
marshaller(Class<? extends Message> msg) {
+        try {
+            return loadMarshaller(msg);
+        }
+        catch (RuntimeException ignored) {

Review Comment:
   Looks too tough. Maybe we need a comment here?



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java:
##########
@@ -3821,7 +3821,7 @@ else if (forceAffReassignment)
 
             // Marshal eagerly: the heavy partition-map copy lands in the 
"Full message preparing" stage, and the
             // message cached in FinishState is sent to late joiners as is 
(the send-path marshal-once turns no-op).
-            MessageMarshalling.marshal(msg, cctx.kernalContext(), null);
+            CommunicationMarshalling.marshal(msg, cctx.kernalContext(), null);

Review Comment:
   Refactoring this issue might set us to revert or rewrite this ticket again 
I'm afraid. We split marshalling type. This is the nase of this ticket



##########
modules/core/src/test/java/org/apache/ignite/internal/util/distributed/DistributedProcessResultMarshallingTest.java:
##########
@@ -0,0 +1,236 @@
+/*
+ * 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.util.distributed;
+
+import java.io.ObjectStreamConstants;
+import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.CoreMessagesProvider;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.TestRecordingCommunicationSpi;
+import org.apache.ignite.internal.managers.communication.GridIoMessage;
+import org.apache.ignite.internal.processors.cache.CacheObjectContext;
+import org.apache.ignite.internal.util.future.GridFinishedFuture;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.marshaller.Marshaller;
+import org.apache.ignite.plugin.AbstractTestPluginProvider;
+import org.apache.ignite.plugin.ExtensionRegistry;
+import org.apache.ignite.plugin.PluginContext;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.plugin.extensions.communication.MessageFactory;
+import 
org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
+import org.apache.ignite.plugin.extensions.communication.MessageReader;
+import org.apache.ignite.plugin.extensions.communication.MessageSerializer;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static 
org.apache.ignite.internal.util.distributed.DistributedProcess.DistributedProcessType.TEST_PROCESS;
+import static org.apache.ignite.testframework.GridTestUtils.loadSerializer;
+
+/**
+ * Tests that the result of a {@link DistributedProcess} is marshalled with 
the JDK marshaller on both transports: it
+ * goes to the coordinator by communication and comes back in the {@link 
FullMessage} by discovery, while a marshalled
+ * field caches its wire form for the second leg.
+ */
+public class DistributedProcessResultMarshallingTest extends 
GridCommonAbstractTest {

Review Comment:
   One Test for one `@Test`? Can we put it in some existing Test? 



-- 
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: [email protected]

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

Reply via email to