sunhaibotb commented on a change in pull request #8124: [FLINK-11877] Implement
the runtime handling of the InputSelectable interface
URL: https://github.com/apache/flink/pull/8124#discussion_r274742831
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/UnionInputGate.java
##########
@@ -159,14 +167,26 @@ public void requestPartitions() throws IOException,
InterruptedException {
@Override
public Optional<BufferOrEvent> getNextBufferOrEvent() throws
IOException, InterruptedException {
+ return getNextBufferOrEvent(true);
+ }
+
+ @Override
+ public Optional<BufferOrEvent> pollNextBufferOrEvent() throws
IOException, InterruptedException {
+ return getNextBufferOrEvent(false);
+ }
+
+ private Optional<BufferOrEvent> getNextBufferOrEvent(boolean blocking)
throws IOException, InterruptedException {
if (inputGatesWithRemainingData.isEmpty()) {
return Optional.empty();
}
// Make sure to request the partitions, if they have not been
requested before.
requestPartitions();
- InputGateWithData inputGateWithData = waitAndGetNextInputGate();
+ InputGateWithData inputGateWithData =
waitAndGetNextInputGate(blocking);
+ if (!blocking && inputGateWithData == null) {
Review comment:
Yes, it can be simplified here.
----------------------------------------------------------------
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