com.hazelcast.jet.pipeline

## Class SessionWindowDefinition

- java.lang.Object
- - com.hazelcast.jet.pipeline.WindowDefinition
  - - com.hazelcast.jet.pipeline.SessionWindowDefinition

-     public class SessionWindowDefinition
      extends WindowDefinition

  Represents the definition of a session window.
  Since:
    3.0

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `sessionTimeout()` Returns the session timeout, which is the largest difference in the timestamps of any two consecutive events in the session window.
    `SessionWindowDefinition` | `setEarlyResultsPeriod(long earlyResultPeriod)` Sets the period in milliseconds at which the windowed aggregation stage will emit partial results of all the windows that contain some data, but the watermark hasn't yet advanced enough to close them and emit the final results.

    - ### Methods inherited from class com.hazelcast.jet.pipeline.WindowDefinition

      `earlyResultsPeriod, session, sliding, tumbling`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### setEarlyResultsPeriod

          public SessionWindowDefinition setEarlyResultsPeriod(long earlyResultPeriod)

      Description copied from class: `WindowDefinition`
      Sets the period in milliseconds at which the windowed aggregation stage will emit partial results of all the windows that contain some data, but the watermark hasn't yet advanced enough to close them and emit the final results.

      Consider this example: we're collecting a 1-minute tumbling window of stock exchange data. The results we're getting pertain to the minute that just elapsed, but we'd also like to detect any sudden changes within the running minute. We can set the early results period to 1000 ms and get an update every second for the window that's currently being filled with data.

      Note that, for a sliding window, there will be many incomplete windows that contain some data and you'll get the early results for all of them. Similarly, if you configure a high-enough `maxLag` for the event timestamps, there can be more than one tumbling/session window with early results.

      The default value is zero, which means "don't emit early results".

      Overrides:
        `setEarlyResultsPeriod` in class `WindowDefinition`
      Parameters:
        `earlyResultPeriod` - the period in milliseconds from one start of the emission of early results to the next one
      Returns:
        `this`

    - #### sessionTimeout

          public long sessionTimeout()

      Returns the session timeout, which is the largest difference in the timestamps of any two consecutive events in the session window.

Copyright © 2019. All rights reserved.