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


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java:
##########
@@ -146,17 +146,14 @@ public class DataStreamerImpl<K, V> implements 
IgniteDataStreamer<K, V>, Delayed
      */
     private final Map<Long, ThreadBuffer> threadBufMap = new 
ConcurrentHashMap<>();
 
-    /** Isolated receiver. */
-    private static final StreamReceiver ISOLATED_UPDATER = new 
IsolatedUpdater();
+    /** Default, Isolated receiver. */
+    static final StreamReceiver ISOLATED_UPDATER = new IsolatedUpdater();
 
     /** 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 its message; {@code null} for {@link 
#ISOLATED_UPDATER}. */

Review Comment:
   You are right, and it now covers all four.
   
   `DataStreamerBuiltInUpdater` names them — `ISOLATED`, `INDIVIDUAL`, 
`BATCHED`, `BATCHED_SORTED` — and maps back to the local instance on the 
receiving side. A request carries a serialized updater only when it belongs to 
the user:
   
   ```java
   // The updaters the streamer ships with are named rather than sent: every 
node has them.
   DataStreamerBuiltInUpdater builtIn = 
DataStreamerBuiltInUpdater.of(rcvrMsg0.receiver());
   ```
   
   The lookup is by identity against the singletons, so a user instance of the 
same class still travels as a user receiver — safe, since these are stateless.
   
   Tests: `testBuiltInUpdaterIsNotSent` for the default receiver, 
`testBuiltInReceiverIsNotSent` for one set explicitly, and 
`testReceiverMarshalledOncePerStreamer` had to grow a receiver of its own, 
since the built-in one it used no longer travels.



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