rkhachatryan commented on a change in pull request #10151: [FLINK-14231] Handle
the processing-time timers when closing operators to make endInput semantics on
the operator chain strict
URL: https://github.com/apache/flink/pull/10151#discussion_r355557036
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/OperatorChain.java
##########
@@ -246,34 +270,45 @@ public void prepareSnapshotPreBarrier(long checkpointId)
throws Exception {
* @param inputId the input ID starts from 1 which indicates the first
input.
*/
public void endHeadOperatorInput(int inputId) throws Exception {
- endOperatorInput(headOperator, inputId);
+ headOperatorWrapper.endOperatorInput(inputId);
+ }
+
+ public RecordWriterOutput<?>[] getStreamOutputs() {
+ return streamOutputs;
}
/**
- * Ends all inputs of the non-head operator specified by {@code
streamOperator})
- * (now there is only one input for each non-head operator).
- *
- * @param streamOperator non-head operator for ending the only input.
+ * Returns an iterator traversing operators in topological order.
*/
- public void endNonHeadOperatorInput(StreamOperator<?> streamOperator)
throws Exception {
- checkState(streamOperator != headOperator);
- endOperatorInput(streamOperator, 1);
+ public Iterator<StreamOperatorWrapper<?, ?>> getOperatorIterator() {
+ return new
StreamOperatorWrapper.ReadIterator(headOperatorWrapper);
Review comment:
With `Iterable` it would be easier to write loops:
```
public Iterable<StreamOperatorWrapper<?, ?>> getAll() {
return () -> new
StreamOperatorWrapper.ReadIterator(headOperatorWrapper);
}
for (StreamOperatorWrapper<?, ?> w: chain.getAll()) {
...
}
```
(instead of while)
----------------------------------------------------------------
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