Flink notes (xiii): Flink Window in Time and presentation

1.Time

  In streaming Flink, the different concepts involve time
Here Insert Picture Description
Event Time:is the time the event was created. It is generally described by a time stamp in the event, for example, log data acquired in each log will record their generation time.

Ingestion Time:Flink of data entry time

Processing Time:The operator processing time. The default time property is the Processing Time.


我们来举个Time时间的例子↓↓↓

For example: Now logging system generates a log as follows:

2020-02-11 15: 15: 06.218 INFO kernel : NMI watchdog: BUG: soft lockup
Here Insert Picture Description
      for business needs, if we want to count the number of fault logs in the 1min, then three times in which time is the most meaningful of?       答案显然是 EventTime,因为我们要根据日志的生成时间进行统计


2.Window

2.1 Window concept

      Streaming Streaming is a calculation designed for processing 无限数据集data processing engine, the data set is infinitely growing unlimited refers to a data set.而 Window 是一种切割无限数据集为有限块进行处理的手段。

      1. 没有 Window 操作之前We processing of the data is: be a calculated one.
      2 有了 Window 操作之后, we can use the Window operating, unbounded data stream by dividing the window, the data of a certain period of time as bounded data stream, then this part of the data stream bounded calculated.

      Window core unlimited data stream is processed, Window may be an infinite stream stream into a limited size "buckets"bucket, we can do the calculation operations on these buckets.

2.2 Window Classification

Window can be divided into two categories:

1 CountWindow: the number of data pieces generated as a Window specified, regardless of the time


2 TimeWindow: Window generated by time

For the TimeWindow, the window may be divided according to different principles to achieve three categories: 1.滚动窗口(Tumbling Window), 2.滑动窗口(Sliding Window),3.会话窗口(Session Window)

2.2.1 rolling window

The
       将数据依据固定的窗口长度,对数据进行切片concept:. Commonly used to scroll a window, the data in the window is calculated.

2.2.2 sliding window

2.2.3 Session window

Published 252 original articles · won praise 45 · views 50000 +

Guess you like

Origin blog.csdn.net/lzb348110175/article/details/104263221