zhijiangW commented on a change in pull request #7549: [FLINK-11403][network]
Introduce ResultPartitionWithConsumableNotifier in task for notifying
consumable result partition
URL: https://github.com/apache/flink/pull/7549#discussion_r289888689
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/writer/AbstractCollectingResultPartitionWriter.java
##########
@@ -70,10 +70,11 @@ public BufferBuilder getBufferBuilder() throws
IOException, InterruptedException
}
@Override
- public synchronized void addBufferConsumer(BufferConsumer
bufferConsumer, int targetChannel) throws IOException {
+ public synchronized boolean addBufferConsumer(BufferConsumer
bufferConsumer, int targetChannel) throws IOException {
checkState(targetChannel < getNumberOfSubpartitions());
- bufferConsumers.add(bufferConsumer);
+ boolean success = bufferConsumers.add(bufferConsumer);
Review comment:
I think it only has two possibilities here. One is return true, and the
other is throwing an exception. `success` here is either true or throwing
`NullPointerException` while `bufferConsumers.add`.
Or I could return true directly at the end of this method. WDYT?
----------------------------------------------------------------
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