Class EventTimeSessionWindows

  • All Implemented Interfaces:
    Serializable

    @PublicEvolving
    public class EventTimeSessionWindows
    extends MergingWindowAssigner<Object,​TimeWindow>
    A WindowAssigner that windows elements into sessions based on the timestamp of the elements. Windows cannot overlap.

    For example, in order to window into windows of 1 minute, every 10 seconds:

    
     DataStream<Tuple2<String, Integer>> in = ...;
     KeyedStream<String, Tuple2<String, Integer>> keyed = in.keyBy(...);
     WindowedStream<Tuple2<String, Integer>, String, TimeWindows> windowed =
       keyed.window(EventTimeSessionWindows.withGap(Duration.ofMinutes(1)));
     
    See Also:
    Serialized Form