sunhaibotb commented on a change in pull request #10151: [FLINK-14231] Handle 
the pending processing-time timers to make endInput semantics on the operator 
chain strict
URL: https://github.com/apache/flink/pull/10151#discussion_r367365909
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/OperatorChain.java
 ##########
 @@ -140,34 +140,41 @@ public OperatorChain(
                        }
 
                        // we create the chain of operators and grab the 
collector that leads into the chain
-                       List<StreamOperator<?>> allOps = new 
ArrayList<>(chainedConfigs.size());
+                       List<StreamOperatorWrapper<?, ?>> allOpWrappers = new 
ArrayList<>(chainedConfigs.size());
                        this.chainEntryPoint = createOutputCollector(
                                containingTask,
                                configuration,
                                chainedConfigs,
                                userCodeClassloader,
                                streamOutputMap,
-                               allOps,
+                               allOpWrappers,
                                containingTask.getMailboxExecutorFactory());
 
                        if (operatorFactory != null) {
                                WatermarkGaugeExposingOutput<StreamRecord<OUT>> 
output = getChainEntryPoint();
 
-                               headOperator = 
StreamOperatorFactoryUtil.createOperator(
+                               OP headOperator = 
StreamOperatorFactoryUtil.createOperator(
                                                operatorFactory,
                                                containingTask,
                                                configuration,
                                                output);
 
                                
headOperator.getMetricGroup().gauge(MetricNames.IO_CURRENT_OUTPUT_WATERMARK, 
output.getWatermarkGauge());
+                               this.headOperatorWrapper = 
createOperatorWrapper(headOperator, containingTask, configuration);
+
+                               // add head operator to end of chain
+                               allOpWrappers.add(headOperatorWrapper);
+
+                               this.tailOperatorWrapper = allOpWrappers.get(0);
                        } else {
-                               headOperator = null;
+                               checkState(allOpWrappers.size() == 0);
 
 Review comment:
   Corresponding to the `OP` type of  the head operator, the type of 
`headOperatorWrapper`  is  `StreamOperatorWrapper<OUT, OP>`, so we cannot 
assign `headOperatorWrapper` to the last element and this check seems to need 
to be retained. @rkhachatryan 

----------------------------------------------------------------
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

Reply via email to