流处理中时间本质上就是一个普通的递增字段(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://www.bilibili.com/video/av53193640/

https://ci.apache.org/projects/flink/flink-docs-release-1.9/api/java/

flink time and watermark的更多相关文章

  1. 老板让阿粉学习 flink 中的 Watermark,现在他出教程了

    1 前言 在时间 Time 那一篇中,介绍了三种时间概念 Event.Ingestin 和 Process, 其中还简单介绍了乱序 Event Time 事件和它的解决方案 Watermark 水位线 ...

  2. Flink Pre-defined Timestamp Extractors / Watermark Emitters(预定义的时间戳提取/水位线发射器)

    https://ci.apache.org/projects/flink/flink-docs-release-1.6/dev/event_timestamp_extractors.html 根据官网 ...

  3. Flink的时间类型和watermark机制

    一FlinkTime类型 有3类时间,分别是数据本身的产生时间.进入Flink系统的时间和被处理的时间,在Flink系统中的数据可以有三种时间属性: Event Time 是每条数据在其生产设备上发生 ...

  4. flink中对于window和watermark的一些理解

    package com.chenxiang.flink.demo; import java.io.IOException; import java.net.ServerSocket; import j ...

  5. Flink系列之Time和WaterMark

    当数据进入Flink的时候,数据需要带入相应的时间,根据相应的时间进行处理. 让咱们想象一个场景,有一个队列,分别带着指定的时间,那么处理的时候,需要根据相应的时间进行处理,比如:统计最近五分钟的访问 ...

  6. [白话解析] Flink的Watermark机制

    [白话解析] Flink的Watermark机制 0x00 摘要 对于Flink来说,Watermark是个很难绕过去的概念.本文将从整体的思路上来说,运用感性直觉的思考来帮大家梳理Watermark ...

  7. [源码分析] 从源码入手看 Flink Watermark 之传播过程

    [源码分析] 从源码入手看 Flink Watermark 之传播过程 0x00 摘要 本文将通过源码分析,带领大家熟悉Flink Watermark 之传播过程,顺便也可以对Flink整体逻辑有一个 ...

  8. [Flink] Flink的waterMark的通俗理解

    导读 Flink 为实时计算提供了三种时间,即事件时间(event time).摄入时间(ingestion time)和处理时间(processing time). 遇到的问题: 假设在一个5秒的T ...

  9. Flink - DataStream

    先看例子, final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); D ...

随机推荐

  1. Mybaits学习总结

    一.Mybatis介绍 邮箱:1727292697 MyBatis是一个支持普通SQL查询,存储过程和高级映射的优秀持久层框架.MyBatis消除了几乎所有的JDBC代码和参数的手工设置以及对结果集的 ...

  2. HDFS之DataNode

    DataNode工作机制 1)一个数据块在datanode上以文件形式存储在磁盘上,包括两个文件,一个是数据本身,一个是元数据包括数据块的长度,块数据的校验和,以及时间戳. 2)DataNode启动后 ...

  3. 关于.ssh目录下的known_hosts文件的补充

    一.关于.ssh目录下的known_hosts文件的补充 其实一开始是没有注意到的,按照网上的教程一步一步操作,并没有注意到这个文件的生成.直到有一次我试着去查询.ssh目录是否存在时,出现了下面的情 ...

  4. 算法整理(php语言完成),持续更行中......

    一下所有实例中,均在同一个方法中,所以算法使用内部函数完成 归并排序 public function test1Action () { $tmp = 0; $al_merge = function($ ...

  5. java 数组注意细节,例子解析

    1. int x[]; 或int [] x; 此时却无物理的存在数组.需:数组名= new 数组元素类型[size]: a = new int [10]; 2. 不能使用任何未初始化的数组. 默认的初 ...

  6. appium自动化的一个实例

    实现appium的自动化,三步走,具体如下: 第一步:启动appium的服务端: 可以通过命令行的方式启动:cmd,然后输入appium,如下图 也可以打开桌面程序appium,点击右上角的运行按钮, ...

  7. 构建一个flink程序,从kafka读取然后写入MYSQL

    最近flink已经变得比较流行了,所以大家要了解flink并且使用flink.现在最流行的实时计算应该就是flink了,它具有了流计算和批处理功能.它可以处理有界数据和无界数据,也就是可以处理永远生产 ...

  8. DRF Django REST framework APIView(一)

    什么是REST? REST是一个标准,一种规范,遵循REST风格可以使开发的接口通用,便于调用者理解接口的作用. 使url更容易理解,让增删改清晰易懂,在前后端分离开发中按照这一规范能加快开发效率,减 ...

  9. Too many open files的四种解决办法

    [摘要] Too many open files有四种可能:一 单个进程打开文件句柄数过多,二 操作系统打开的文件句柄数过多,三 systemd对该进程进行了限制,四 inotify达到上限. 领导见 ...

  10. JS获得天数差异

    //获得天数差异 function datedifference(sDate1, sDate2) { //sDate1和sDate2是2006-12-18格式 var dateSpan, tempDa ...