AHeise commented on a change in pull request #13228:
URL: https://github.com/apache/flink/pull/13228#discussion_r476660758
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/CreditBasedSequenceNumberingViewReader.java
##########
@@ -133,14 +136,14 @@ public boolean isAvailable() {
* @param bufferAndBacklog
* current buffer and backlog including information about
the next buffer
*/
- private boolean isAvailable(BufferAndBacklog bufferAndBacklog) {
+ @Nullable
+ private Buffer.DataType getNextDataType(BufferAndBacklog
bufferAndBacklog) {
// BEWARE: this must be in sync with #isAvailable()!
- if (numCreditsAvailable > 0) {
- return bufferAndBacklog.isDataAvailable();
- }
- else {
- return bufferAndBacklog.isEventAvailable();
+ final Buffer.DataType nextDataType =
bufferAndBacklog.getNextDataType();
+ if (numCreditsAvailable > 0 || (nextDataType != null &&
nextDataType.isEvent())) {
+ return nextDataType;
}
+ return null;
Review comment:
An enum type NONE would work for me and might make the code a bit
clearer. However, be aware that this is mostly a copy&replace; I don't think it
would simplify any code path.
----------------------------------------------------------------
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]