You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Wenshuai Hou (JIRA)" <ji...@apache.org> on 2019/06/18 17:27:00 UTC
[jira] [Closed] (FLINK-12714) confusion about flink time window
TimeWindow#getWindowStartWithOffset
[ https://issues.apache.org/jira/browse/FLINK-12714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wenshuai Hou closed FLINK-12714.
--------------------------------
Resolution: Fixed
just saw this in flink doc.
For example, with an event-time-based windowing strategy that creates non-overlapping (or tumbling) windows every 5 minutes and has an allowed lateness of 1 min, Flink will create a new window for the interval between {{12:00}} and {{12:05}} when the first element with a timestamp that falls into this interval arrives, and it will remove it when the watermark passes the {{12:06}} timestamp
> confusion about flink time window TimeWindow#getWindowStartWithOffset
> ---------------------------------------------------------------------
>
> Key: FLINK-12714
> URL: https://issues.apache.org/jira/browse/FLINK-12714
> Project: Flink
> Issue Type: Improvement
> Components: flink-contrib
> Affects Versions: 1.8.0
> Reporter: Wenshuai Hou
> Priority: Minor
>
>
> hi flink team, i think the flink doc on how time windows are created and the javadoc of related method is a little confusing. They give me the impression that the window-start equals to the timestamp of the first event assigned to that window, however the window-start is actually quantized by the windowSize, see links below. Is this the intention or is this a mistake? If it's intended, can we please leave a comment in flink doc somewhere to make this more clear? I spent 5 hours wondering why my flink tests fail until i find that method.
>
> Thanks
> Wen
>
> links:
> ================
>
> The flink doc from here : [https://ci.apache.org/projects/flink/flink-docs-stable/dev/stream/operators/windows.html#window-lifecycle]
> > In a nutshell, a window is *created* as soon as the first element that should belong to this window arrives
>
> the java doc of this method: org.apache.flink.streaming.api.windowing.windows.TimeWindow#getWindowStartWithOffset
>
>
> {code:java}
> /**
> * Method to get the window start for a timestamp.
> *
> * @param timestamp epoch millisecond to get the window start.
> * @param offset The offset which window start would be shifted by.
> * @param windowSize The size of the generated windows.
> * @return window start
> */
> public static long getWindowStartWithOffset(long timestamp, long offset, long windowSize) {
> {code}
>
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)