pnowojski commented on a change in pull request #8731: [FLINK-11878][runtime]
Implement the runtime handling of BoundedOneInput and BoundedMultiInput
URL: https://github.com/apache/flink/pull/8731#discussion_r294228450
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/StreamInputProcessor.java
##########
@@ -174,6 +179,18 @@ private void initializeNumRecordsIn() {
}
}
+ private boolean checkFinished() throws Exception {
+ boolean isFinished = input.isFinished();
+ if (isFinished) {
+ if (streamOperator instanceof BoundedOneInput) {
Review comment:
It would be better to have this logic in one place and not distributed
across two different classes (head is being marked as ended in the processor,
while non heads are marked via task).
Also what you proposed adds an (additional) cyclic dependency between Task
and Processor, which is also not good.
Maybe the best approach would be to encapsulate this whole logic in
`OperatorChain` class and pass it to the processors? For example by adding
`OperatorChain#endInput(int inputId)` method, which would:
- if the head is `TwoInput`, it would track which inputs have ended. If all
of them, then it would propagate the `endInput` call down the operator chain.
- if the head is `OneInput`, it would just end all of the inputs
For the future, we can not be sure how will be `TwoInputStreamOperator`
chaining implemented, but if we keep `OperatorChain` class, the support for
propagating `endInput` would need to be adjusted only there.
----------------------------------------------------------------
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