/** * A {@link WindowAssigner} that windows elements into sliding windows based on the current * system time of the machine the operation is running on. Windows can possibly overlap. * * <p>For example, in order to window into windows of 1 minute, every 10 seconds: * <pre> {@code * DataStream<Tuple2<String, Integer>> in = ...; * KeyedStream<String, Tuple2<String, Integer>> keyed = in.keyBy(...); * WindowedStream<Tuple2<String, Integer>, String, TimeWindows> windowed = * keyed.window(SlidingProcessingTimeWindows.of(Time.of(1, MINUTES), Time.of(10, SECONDS)); * } </pre> */
/** * 基于flink处理时间的滑动窗口 */
6. SlidingEventTimeWindows
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/** * A {@link WindowAssigner} that windows elements into sliding windows based on the timestamp of the * elements. Windows can possibly overlap. * * <p>For example, in order to window into windows of 1 minute, every 10 seconds: * <pre> {@code * DataStream<Tuple2<String, Integer>> in = ...; * KeyedStream<Tuple2<String, Integer>, String> keyed = in.keyBy(...); * WindowedStream<Tuple2<String, Integer>, String, TimeWindow> windowed = * keyed.window(SlidingEventTimeWindows.of(Time.minutes(1), Time.seconds(10))); * } </pre> */
/** * 基于元素时间的滑动窗口 */
6.1 SlidingTimeWindows(废弃)
2. BaseAlignedWindowAssigner
1.1 SlidingAlignedProcessingTimeWindows
5. TumblingProcessingTimeWindows
3. TumblingEventTimeWindows
1 2 3 4 5 6 7 8 9 10 11 12
/** * A {@link WindowAssigner} that windows elements into windows based on the timestamp of the * elements. Windows cannot overlap. * * <p>For example, in order to window into windows of 1 minute: * <pre> {@code * DataStream<Tuple2<String, Integer>> in = ...; * KeyedStream<Tuple2<String, Integer>, String> keyed = in.keyBy(...); * WindowedStream<Tuple2<String, Integer>, String, TimeWindow> windowed = * keyed.window(TumblingEventTimeWindows.of(Time.minutes(1))); * } </pre> */
3.1 TumblingTimeWindows(废弃)
1 2 3 4 5 6
/** * A {@link WindowAssigner} that windows elements into windows based on the timestamp of the * elements. Windows cannot overlap. * * @deprecated Please use {@link TumblingEventTimeWindows}. */