flink time and watermark
流处理中时间本质上就是一个普通的递增字段(long型,自1970年算起的微秒数),不一定真的表示时间。
watermark只是应对乱序的办法之一,大多是启发式的,在延迟和完整性之间抉择。(如果没有延迟,就不够完整;如果有延迟,极端情况就是批处理,当然完整性足够高)
org.apache.flink.streaming.api.watermark
class watermark
java.lang.object
org.apache.flink.streaming.runtime.streamrecord.streamelement
org.apache.flink.streaming.api.watermark.watermark
@publicevolving
public final class watermark extends streamelement
a watermark tells operators that no elements with a timestamp older or equal to the watermark timestamp should arrive at the operator. watermarks are emitted at the sources and propagate through the operators of the topology. operators must themselves emit watermarks to downstream operators using output.emitwatermark(watermark). operators that do not internally buffer elements can always forward the watermark that they receive. operators that buffer elements, such as window operators, must forward a watermark after emission of elements that is triggered by the arriving watermark.
in some cases a watermark is only a heuristic and operators should be able to deal with late elements. they can either discard those or update the result and emit updates/retractions to downstream operations.
when a source closes it will emit a final watermark with timestamp long.max_value. when an operator receives this it will know that no more input will be arriving in the future.
modifier and type field and description
static watermark max_watermark
the watermark that signifies end-of-event-time.
reference:
https://ci.apache.org/projects/flink/flink-docs-release-1.9/api/java/
推荐阅读
-
Flink SQL 系列 | 5 个 TableEnvironment 我该用哪个? sqlscalajavajvm
-
PHP函数:set_time_limit()_PHP教程
-
ignore_user_abort(1) 且set_time_limit(0)然后设置了无限循环,如何终止呢?
-
ORA-02396: exceeded maximum idle time, please connect again的
-
上传50M文件max_execution_time 设置多大好?该如何解决
-
JavaScript查看代码运行效率console.time()与console.timeEnd()用法
-
ThinkPHP中SHOW_RUN_TIME不能正常显示运行时间的解决方法 原创,thinkphprun
-
php set_time_limit(0) 设置程序执行时间的函数
-
这一次带你彻底搞懂watermark
-
php time()使用date函数本地电脑和服务器时间不一样_PHP教程