sunhaibotb commented on a change in pull request #8811: [FLINK-12777][network]
Support CheckpointBarrierHandler in StreamTwoInputSelectableProcessor
URL: https://github.com/apache/flink/pull/8811#discussion_r298022130
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/CachedBufferStorage.java
##########
@@ -82,29 +92,30 @@ public BufferOrEventSequence
rollOverWithoutReusingResources() {
}
@Override
- public void close() {
+ public void close() throws IOException {
BufferOrEvent boe;
while ((boe = currentBuffers.poll()) != null) {
Review comment:
I mean, the reason why it don't need to add `try...finally` like the
following code is that the `while {...}` parts will never fail, and the code is
clearer if we can add some comments to express this point.
```
public void close() throws IOException {
try {
BufferOrEvent boe;
while ((boe = currentBuffers.poll()) != null) {
if (boe.isBuffer()) {
boe.getBuffer().recycleBuffer();
}
}
} finally {
super.close();
}
}
```
----------------------------------------------------------------
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