看完这篇 Apache Flink中的Watermark更通俗易懂!

Posted Flink

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了看完这篇 Apache Flink中的Watermark更通俗易懂!相关的知识,希望对你有一定的参考价值。


As folks first begin to work with Flink, watermarks can be a source of confusion. But this topic doesn't have to be complicated. Let's work through a simple example that will show why we need watermarks, and how they work.



4 observations when working with Watermarks in Apache Flink



In the example below, we have a stream of timestamped events that arrive somewhat out of order. The numbers shown are timestamps that indicate when these events actually occurred. The first event to arrive happened at time 4, and it is followed by an event that happened earlier, at time 2, and so on:
Note that this is an example of event-time processing, meaning that the timestamps reflect when the events took place, and not when they were processed. Event-time processing is a powerful abstraction that makes it possible to create streaming applications that behave consistently whether they are processing live data or re-processing historic data.