Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the method that triggers the calculation for the first time in Flink sliding window?

Shulou Source: shulou.com Published: 2022-06-01 06:01:25 10月04日 Update

The main content of this article is to explain "what is the method of triggering calculation for the first time in Flink sliding window". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the method of triggering calculation for the first time in Flink sliding window?"

For the sliding window in the time window, the initial data can easily determine the window to which it belongs and the time when the window is closed according to its own timestamp. For the sliding window in the count window, there is the following code:

/ / Open a count window to test SingleOutputStreamOperator avgTempResultStream = dataStream.keyBy ("id") .countWindow (10,2) .counting (new MyAvgTemp ())

If the window size is 10 and the step size is 2, the window to which each element belongs is

As shown in the figure, the first two elements, although there is no data before, are also treated as the last two elements of the window.

At this point, I believe that everyone on the "Flink sliding window first trigger calculation method is what" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Methods elements first time two content ownership data time learning practical deeper code interest size practicality practical simple operation timing more friends Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn Huawei macOS Shulou Information