Vladsz83 commented on code in PR #13454:
URL: https://github.com/apache/ignite/pull/13454#discussion_r3750762598
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImplSelfTest.java:
##########
@@ -142,6 +153,71 @@ public void testCloseWithCancellation() throws Exception {
assertTrue(fut.isDone());
}
+ /**
+ * The receiver does not change between batches, so it is marshalled once:
every request carries the very bytes
+ * produced for the first one.
+ *
+ * @throws Exception If failed.
+ */
+ @Test
+ public void testReceiverMarshalledOncePerStreamer() throws Exception {
Review Comment:
Is not a duplicate?
##########
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:
I'm aftaid, there are also built-in `DataStreamerCacheUpdaters` which should
not be marshalled too.
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImplSelfTest.java:
##########
@@ -88,6 +89,16 @@ public class DataStreamerImplSelfTest extends
GridCommonAbstractTest {
/** Indicates whether we need to make the topology stale */
private static boolean needStaleTop = false;
+ /** Receiver carriers of the streamer requests sent since the current test
started; {@code null} for the isolated one. */
+ private static final List<DataStreamerReceiverMessage> sentReceivers =
Collections.synchronizedList(new ArrayList<>());
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ super.beforeTest();
+
+ sentReceivers.clear();
Review Comment:
Let's clear where needed.
--
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]