zjureel commented on code in PR #19380:
URL: https://github.com/apache/flink/pull/19380#discussion_r974073974
##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestServerHandler.java:
##########
@@ -88,10 +88,8 @@ protected void channelRead0(ChannelHandlerContext ctx,
NettyMessage msg) throws
new CreditBasedSequenceNumberingViewReader(
request.receiverId, request.credit,
outboundQueue);
- reader.requestSubpartitionView(
+ reader.requestSubpartitionViewOrNotify(
partitionProvider, request.partitionId,
request.queueIndex);
-
- outboundQueue.notifyReaderCreated(reader);
Review Comment:
Updated
##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ResultPartitionManagerTest.java:
##########
@@ -55,6 +68,29 @@ public void testCreateViewForRegisteredPartition() throws
Exception {
partition.getPartitionId(), 0, new
NoOpBufferAvailablityListener());
}
+ @Test
+ public void testCreateViewNotifierAfterRegisteredPartition() throws
Exception {
+ final ResultPartitionManager partitionManager = new
ResultPartitionManager();
+ final ResultPartition partition = createPartition();
+
+ partitionManager.registerResultPartition(partition);
+ PartitionRequestNotifier partitionRequestNotifier = new
TestingPartitionRequestNotifier();
+ assertNotNull(partitionManager.createSubpartitionViewOrNotify(
+ partition.getPartitionId(), 0, new
NoOpBufferAvailablityListener(), partitionRequestNotifier));
+ }
+
+ @Test
+ public void testCreateViewNotifierBeforeRegisteredPartition() throws
Exception {
+ final ResultPartitionManager partitionManager = new
ResultPartitionManager();
+ final ResultPartition partition = createPartition();
+
+ PartitionRequestNotifier partitionRequestNotifier = new
TestingPartitionRequestNotifier();
+ assertNull(partitionManager.createSubpartitionViewOrNotify(
+ partition.getPartitionId(), 0, new
NoOpBufferAvailablityListener(), partitionRequestNotifier));
+
Review Comment:
Done
##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ResultPartitionManagerTest.java:
##########
@@ -55,6 +68,29 @@ public void testCreateViewForRegisteredPartition() throws
Exception {
partition.getPartitionId(), 0, new
NoOpBufferAvailablityListener());
}
+ @Test
+ public void testCreateViewNotifierAfterRegisteredPartition() throws
Exception {
+ final ResultPartitionManager partitionManager = new
ResultPartitionManager();
+ final ResultPartition partition = createPartition();
+
+ partitionManager.registerResultPartition(partition);
+ PartitionRequestNotifier partitionRequestNotifier = new
TestingPartitionRequestNotifier();
+ assertNotNull(partitionManager.createSubpartitionViewOrNotify(
+ partition.getPartitionId(), 0, new
NoOpBufferAvailablityListener(), partitionRequestNotifier));
+ }
+
+ @Test
+ public void testCreateViewNotifierBeforeRegisteredPartition() throws
Exception {
+ final ResultPartitionManager partitionManager = new
ResultPartitionManager();
+ final ResultPartition partition = createPartition();
+
+ PartitionRequestNotifier partitionRequestNotifier = new
TestingPartitionRequestNotifier();
+ assertNull(partitionManager.createSubpartitionViewOrNotify(
+ partition.getPartitionId(), 0, new
NoOpBufferAvailablityListener(), partitionRequestNotifier));
+
+ partitionManager.registerResultPartition(partition);
Review Comment:
Done
--
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]