anton-vinogradov commented on code in PR #13454:
URL: https://github.com/apache/ignite/pull/13454#discussion_r3750219312
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java:
##########
@@ -152,11 +152,8 @@ public class DataStreamerImpl<K, V> implements
IgniteDataStreamer<K, V>, Delayed
/** Amount of permissions should be available to continue new data
processing. */
private static final int REMAP_SEMAPHORE_PERMISSIONS_COUNT =
Integer.MAX_VALUE;
- /** Cache receiver. */
- private StreamReceiver<K, V> rcvr = ISOLATED_UPDATER;
-
- /** */
- private byte[] updaterBytes;
+ /** Cache receiver, in the message that carries it to the remote nodes. */
+ private volatile DataStreamerReceiverMessage rcvrMsg = new
DataStreamerReceiverMessage(ISOLATED_UPDATER);
Review Comment:
Fair point, and now it is not sent at all.
It was not new here — before this PR the isolated updater was marshalled and
put into `updaterBytes` of every request just the same, so it travelled with
each batch. What this PR changed was only who serializes it.
Now the request carries no updater when it is the isolated one, and
`DataStreamProcessor` uses the node's own instance:
```java
updater = req.updater();
// The isolated updater is not sent: it ships with this node, so the local
one is used instead.
if (updater == null)
updater = DataStreamerImpl.ISOLATED_UPDATER;
else
ctx.resource().injectGeneric(updater);
```
`DataStreamerImplSelfTest#testIsolatedUpdaterIsNotSent` covers it: every
request that leaves carries a `null` carrier and the data still lands on the
remote node. Verified the other way round too — putting the carrier back makes
the test fail.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerReceiverMessage.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * 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;
+
+/** Cache updater together with its serialized form, shared by the batches of
one streamer. */
Review Comment:
Trimmed to `/** Cache updater. */`.
--
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]