SteNicholas commented on a change in pull request #17105:
URL: https://github.com/apache/flink/pull/17105#discussion_r700797416



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/SourceOperator.java
##########
@@ -281,6 +290,21 @@ public void open() throws Exception {
                             watermarkStrategy, sourceMetricGroup);
         }
 
+        latencyMarerEmitter =
+                new LatencyMarkerEmitter<>(
+                        getProcessingTimeService(),
+                        getExecutionConfig().isLatencyTrackingConfigured()
+                                ? 
getExecutionConfig().getLatencyTrackingInterval()
+                                : getContainingTask() == null
+                                        ? 0
+                                        : getContainingTask()
+                                                .getEnvironment()
+                                                .getTaskManagerInfo()
+                                                .getConfiguration()
+                                                
.getLong(MetricOptions.LATENCY_INTERVAL),
+                        config == null ? null : getOperatorID(),

Review comment:
       IMO, it's unnecessary to check whether the task and config is null or 
not. But in `SourceOperatorEventTimeTest`, the `setup` method doesn't be 
invoked in `createTestOperator`, which causes that the task and config is null.
   @pnowojski , what do you think about?




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to