anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3589078038
##########
modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/DiscoveryMessageParser.java:
##########
@@ -44,8 +47,15 @@ public class DiscoveryMessageParser {
private final MessageFactory msgFactory;
/** */
- public DiscoveryMessageParser(MessageFactory msgFactory) {
+ private final GridKernalContext ctx;
Review Comment:
Renamed `ctx` → `kctx`.
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java:
##########
@@ -2011,25 +2042,102 @@ else if (async)
ackC.apply(null);
}
else {
+ MessageMarshaller.marshal(ctx.messageFactory(), ioMsg, ctx,
null);
+
+ sendMarshalled(node, ioMsg, ackC);
+ }
+ }
+ }
+
+ /**
+ * Wraps {@code msg} into a marshalled {@link GridIoMessage} without
sending it. Message marshalling is not
+ * idempotent (see {@code MessageMarshalOnceTest}), so a caller that
retries transmission must prepare the
+ * message once and re-send it via {@link #sendPrepared} on each attempt.
+ */
+ public GridIoMessage prepare(Object topic, Message msg, byte plc, boolean
ordered, long timeout,
+ boolean skipOnTimeout) throws IgniteCheckedException {
+ assert !ordered || timeout > 0 || skipOnTimeout;
+
+ GridIoMessage ioMsg = createGridIoMessage(topic, msg, plc, ordered,
timeout, skipOnTimeout);
+
+ MessageMarshaller.marshal(ctx.messageFactory(), ioMsg, ctx, null);
+
+ return ioMsg;
+ }
+
+ /**
+ * Transmits a message created by {@link #prepare} to a remote node.
Transmission does not mutate the message,
Review Comment:
Done — "Sends a message… Sending does not mutate…".
--
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]