anton-vinogradov commented on code in PR #13454:
URL: https://github.com/apache/ignite/pull/13454#discussion_r3751906518


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerReceiverMessage.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.processors.datastreamer;
+
+import org.apache.ignite.internal.Marshalled;
+import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.UseBinaryMarshaller;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.stream.StreamReceiver;
+import org.jetbrains.annotations.Nullable;
+
+/** DataStreamer cache receiver/updater message. */
+@UseBinaryMarshaller
+public class DataStreamerReceiverMessage implements Message {
+    /** Custom cache receiver/updater; {@code null} when {@link #builtIn} is 
effective. */
+    @Nullable
+    @Marshalled("rcvrBytes")
+    StreamReceiver<?, ?> rcvr;

Review Comment:
   Done — `@Nullable StreamReceiver<?, ?> rcvr;`, with `@Marshalled` above it.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerReceiverMessage.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.processors.datastreamer;
+
+import org.apache.ignite.internal.Marshalled;
+import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.UseBinaryMarshaller;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.stream.StreamReceiver;
+import org.jetbrains.annotations.Nullable;
+
+/** DataStreamer cache receiver/updater message. */
+@UseBinaryMarshaller
+public class DataStreamerReceiverMessage implements Message {
+    /** Custom cache receiver/updater; {@code null} when {@link #builtIn} is 
effective. */
+    @Nullable
+    @Marshalled("rcvrBytes")
+    StreamReceiver<?, ?> rcvr;
+
+    /** Serialized {@link #rcvr}. */
+    @Order(0)
+    volatile byte[] rcvrBytes;

Review Comment:
   Added — `volatile @Nullable byte[] rcvrBytes;`



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerReceiverMessage.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.processors.datastreamer;
+
+import org.apache.ignite.internal.Marshalled;
+import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.UseBinaryMarshaller;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.stream.StreamReceiver;
+import org.jetbrains.annotations.Nullable;
+
+/** DataStreamer cache receiver/updater message. */
+@UseBinaryMarshaller
+public class DataStreamerReceiverMessage implements Message {
+    /** Custom cache receiver/updater; {@code null} when {@link #builtIn} is 
effective. */
+    @Nullable
+    @Marshalled("rcvrBytes")
+    StreamReceiver<?, ?> rcvr;
+
+    /** Serialized {@link #rcvr}. */
+    @Order(0)
+    volatile byte[] rcvrBytes;
+
+    /** A built-in updater every node has; {@code null} when {@link #rcvr} is 
effective. */
+    @Nullable
+    @Order(1)
+    DataStreamerBuiltInUpdater builtIn;

Review Comment:
   Done — `@Nullable DataStreamerBuiltInUpdater builtIn;`



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerReceiverMessage.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.processors.datastreamer;
+
+import org.apache.ignite.internal.Marshalled;
+import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.UseBinaryMarshaller;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.stream.StreamReceiver;
+import org.jetbrains.annotations.Nullable;
+
+/** DataStreamer cache receiver/updater message. */
+@UseBinaryMarshaller
+public class DataStreamerReceiverMessage implements Message {
+    /** Custom cache receiver/updater; {@code null} when {@link #builtIn} is 
effective. */
+    @Nullable
+    @Marshalled("rcvrBytes")
+    StreamReceiver<?, ?> rcvr;
+
+    /** Serialized {@link #rcvr}. */
+    @Order(0)
+    volatile byte[] rcvrBytes;
+
+    /** A built-in updater every node has; {@code null} when {@link #rcvr} is 
effective. */
+    @Nullable
+    @Order(1)
+    DataStreamerBuiltInUpdater builtIn;
+
+    /** Empty constructor for serialization purposes. */
+    public DataStreamerReceiverMessage() {
+        // No-op.
+    }
+
+    /** @param rcvr Custom receiver. */
+    DataStreamerReceiverMessage(StreamReceiver<?, ?> rcvr) {
+        assert DataStreamerBuiltInUpdater.of(rcvr) == null : "A built-in 
updater travels by name: " + rcvr;
+
+        this.rcvr = rcvr;
+    }
+
+    /** @param builtIn A built-in updater every node has, named rather than 
carried. */

Review Comment:
   Reworded to `Built-in updater every node has, named rather than sent`.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerReceiverMessage.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.processors.datastreamer;
+
+import org.apache.ignite.internal.Marshalled;
+import org.apache.ignite.internal.Order;
+import org.apache.ignite.internal.UseBinaryMarshaller;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.stream.StreamReceiver;
+import org.jetbrains.annotations.Nullable;
+
+/** DataStreamer cache receiver/updater message. */
+@UseBinaryMarshaller
+public class DataStreamerReceiverMessage implements Message {
+    /** Custom cache receiver/updater; {@code null} when {@link #builtIn} is 
effective. */
+    @Nullable
+    @Marshalled("rcvrBytes")
+    StreamReceiver<?, ?> rcvr;
+
+    /** Serialized {@link #rcvr}. */
+    @Order(0)
+    volatile byte[] rcvrBytes;
+
+    /** A built-in updater every node has; {@code null} when {@link #rcvr} is 
effective. */
+    @Nullable
+    @Order(1)
+    DataStreamerBuiltInUpdater builtIn;
+
+    /** Empty constructor for serialization purposes. */
+    public DataStreamerReceiverMessage() {
+        // No-op.
+    }
+
+    /** @param rcvr Custom receiver. */
+    DataStreamerReceiverMessage(StreamReceiver<?, ?> rcvr) {
+        assert DataStreamerBuiltInUpdater.of(rcvr) == null : "A built-in 
updater travels by name: " + rcvr;
+
+        this.rcvr = rcvr;
+    }
+
+    /** @param builtIn A built-in updater every node has, named rather than 
carried. */
+    DataStreamerReceiverMessage(DataStreamerBuiltInUpdater builtIn) {
+        this.builtIn = builtIn;
+    }
+
+    /** @return {@code True} if this is a custom receiver, {@code false} if a 
built-in one. */
+    boolean custom() {
+        return builtIn == null;
+    }
+
+    /** @return Receiver: the custom one carried here, or the built-in one 
this message names. */

Review Comment:
   Same there: `Receiver: the custom one sent here, or the built-in one this 
message names`.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java:
##########
@@ -235,9 +230,11 @@ private void processRequest(final UUID nodeId, final 
DataStreamerRequest req) {
             StreamReceiver<?, ?> updater;
 
             try {
-                updater = U.unmarshal(marsh, req.updaterBytes(), 
U.resolveClassLoader(clsLdr, ctx.config()));
+                MessageMarshalling.unmarshal(req, ctx, null, 
U.resolveClassLoader(clsLdr, ctx.config()));
+
+                updater = req.updater();
 
-                if (updater != null)
+                if (req.hasCustomUpdater())

Review Comment:
   Renamed to `customUpdater()` — it sits next to `skipStore()` and 
`keepBinary()`, so it should read like them.



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