Github user tzulitai commented on a diff in the pull request:
https://github.com/apache/flink/pull/5092#discussion_r153734546
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamSourceContexts.java
---
@@ -313,6 +325,7 @@ protected void processAndCollectWithTimestamp(T
element, long timestamp) {
@Override
protected void processAndEmitWatermark(Watermark mark) {
output.emitWatermark(mark);
+
watermarkGauge.setCurrentLowWatermark(mark.getTimestamp());
--- End diff --
Should probably move this to the base abstract class `WatermarkContext`,
after `processAndEmitWatermark(mark)` in the `emitWatermark` method (line):
https://github.com/apache/flink/pull/5092/files#diff-e38689efd0a97938646aa97eb8a97d96R438
The `processAndEmitWatermark` method of `AutomaticWatermarkContext` should
actually also update the watermark metric after emitting the `Long.MAX_VALUE`
watermark, but currently doesn't:
https://github.com/apache/flink/pull/5092/files#diff-e38689efd0a97938646aa97eb8a97d96R215
Implementing the metric update in the base class should cover both cases.
---