anton-vinogradov commented on code in PR #13462:
URL: https://github.com/apache/ignite/pull/13462#discussion_r3784843277
##########
modules/codegen/src/main/java/org/apache/ignite/internal/MessageMarshallerGenerator.java:
##########
@@ -115,6 +115,12 @@ public class MessageMarshallerGenerator extends
MessageCompanionGenerator {
/** Whether the message marshals fields of its own, so the generated
methods call its step. */
private boolean selfMarshalling;
+ /** Whether the message pins the JDK marshaller, see {@link
JdkMarshalled}. */
+ private boolean jdkMarshalled;
+
+ /** Name of the marshaller the generated body uses: the transport one, or
the pinned JDK one. */
+ private String marshVar;
+
/** */
private boolean hasMarshalled;
Review Comment:
Right, it stopped being read when the generated companion lost its
marshaller constructor - removed.
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/CommunicationMarshalling.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.managers.communication;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.cache.CacheObjectContext;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.jetbrains.annotations.Nullable;
+
+/** Marshalling of the communication transport. It uses the schema-aware
marshaller. */
Review Comment:
Reworded: "It uses the schema-aware marshaller, {@link BinaryMarshaller},
which writes a type once and refers to it by id afterwards, so a type unknown
to the cluster has to be registered first."
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java:
##########
@@ -28,8 +28,10 @@
* Used internally to track version counters (see javadoc for {@link
MetadataUpdateProposedMessage} for more details).
* The version refers solely to the internal protocol for updating
BinaryMetadata and is unknown externally.
* It can be updated dynamically from different nodes and threads on the same
node.
+ * <p>
+ * Travels both transports: by discovery in the data bag, by communication in
the {@link MetadataResponseMessage}.
Review Comment:
Done, here and in the other five notes: Communication and Discovery are now
spelled as the subsystems are.
##########
modules/core/src/main/java/org/apache/ignite/internal/util/distributed/SingleNodeMessage.java:
##########
@@ -27,12 +28,16 @@
/**
* Single node result message.
+ * <p>
+ * The process result travels both transports: this message carries it to the
coordinator by communication, and the
+ * {@link FullMessage} of the coordinator carries it back to every node by
discovery.
*
* @param <R> Result type.
* @see DistributedProcess
* @see FullMessage
* @see InitMessage
*/
+@JdkMarshalled
Review Comment:
True, fixed: the FullMessage carries the results collected from the single
node messages, not the messages themselves.
##########
modules/core/src/test/java/org/apache/ignite/internal/util/distributed/DistributedProcessResultMarshallingTest.java:
##########
@@ -0,0 +1,320 @@
+/*
+ * 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.util.Collection;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.CountDownLatch;
+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.CommunicationMarshalling;
+import org.apache.ignite.internal.managers.communication.GridIoMessage;
+import org.apache.ignite.internal.managers.communication.MessageMarshalling;
+import org.apache.ignite.internal.processors.cache.CacheObjectContext;
+import org.apache.ignite.internal.util.ErrorMessage;
+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.marshaller.Marshallers;
+import org.apache.ignite.marshaller.jdk.JdkMarshaller;
+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
Review Comment:
Rewrote the class javadoc along those lines: InitMessage by Discovery,
SingleNodeMessage by Communication, then the collected results in a FullMessage
by Discovery.
--
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]