zhijiangW commented on a change in pull request #11351: [FLINK-16404][runtime]
Avoid caching buffers for blocked input channels before barrier alignment
URL: https://github.com/apache/flink/pull/11351#discussion_r408656192
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/PipelinedSubpartition.java
##########
@@ -275,14 +283,24 @@ public PipelinedSubpartitionView
createReadView(BufferAvailabilityListener avail
return readView;
}
- public boolean isAvailable() {
+ public boolean isAvailable(int numCreditsAvailable) {
synchronized (buffers) {
- return isAvailableUnsafe();
+ if (numCreditsAvailable > 0) {
+ return isDataAvailableUnsafe();
+ }
+
+ return isEventAvailableUnsafe();
}
}
- private boolean isAvailableUnsafe() {
- return flushRequested || getNumberOfFinishedBuffers() > 0;
+ private boolean isDataAvailableUnsafe() {
+ return !isBlockedByCheckpoint && (flushRequested ||
getNumberOfFinishedBuffers() > 0);
+ }
+
+ private boolean isEventAvailableUnsafe() {
+ assert Thread.holdsLock(buffers);
Review comment:
Unify this `assert` also for above `isDataAvailableUnsafe`?
----------------------------------------------------------------
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