pnowojski commented on a change in pull request #9062: [FLINK-13100][network]
Fix the bug of throwing IOException while FileChannelBoundedData#nextBuffer
URL: https://github.com/apache/flink/pull/9062#discussion_r301965408
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BoundedBlockingSubpartitionReader.java
##########
@@ -89,9 +114,30 @@ public BufferAndBacklog getNextBuffer() throws IOException
{
return BufferAndBacklog.fromBufferAndLookahead(current,
nextBuffer, dataBufferBacklog);
}
+ /**
+ * This method is actually only meaningful for the {@link
BoundedBlockingSubpartitionType#FILE}. For the
+ * other types the next buffer is always not null while {@link
ResultSubpartitionView#getNextBuffer()},
+ * so it is no need to notify available via this method. But the
implementation is also compatible with
+ * other types even though called by mistake.
+ */
@Override
public void notifyDataAvailable() {
- throw new IllegalStateException("No data should become
available on a blocking partition during consumption.");
+ if (nextBuffer == null) {
Review comment:
add `checkState` for `BoundedBlockingSubpartitionType#FILE`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services