【发布时间】:2020-07-16 02:34:06
【问题描述】:
我正在尝试在我的 Flink 作业中使用事件时间,并使用 BoundedOutOfOrdernessTimestampExtractor 来提取时间戳并生成水印。
但是我有一些输入 Kafka 有稀疏流,它可以很长时间没有数据,这使得 AggregateFunction 中的 getResult 根本没有被调用。我可以看到数据进入add 函数。
我已设置getEnv().getConfig().setAutoWatermarkInterval(1000L);
我试过了
eventsWithKey
.keyBy(entry -> (String) entry.get(key))
.window(TumblingEventTimeWindows.of(Time.minutes(windowInMinutes)))
.allowedLateness(WINDOW_LATENESS)
.aggregate(new CountTask(basicMetricTags, windowInMinutes))
还有会话窗口
eventsWithKey
.keyBy(entry -> (String) entry.get(key))
.window(EventTimeSessionWindows.withGap(Time.seconds(30)))
.aggregate(new CountTask(basicMetricTags, windowInMinutes))
所有水印指标显示No Watermark
如何让 Flink 忽略无水印的事情?
【问题讨论】:
标签: apache-flink flink-streaming