Striim 3.9.4 / 3.9.5 documentation

Advanced window settings (RANGE / Timeout)

When a window's size is based on events (KEEP ROWS) or event time (KEEP WITHIN <int> <time unit> ON <timestamp field name>), the window may not jump for far longer than is desired. Use the RANGE or Timeout property to force the window to jump within a set period. For example:

CREATE JUMPING WINDOW MyWindow OVER MyStream KEEP WITHIN 5 MINUTE ON DateTime

If there is an hour gap between events, the window could be open for over an hour without sending any data. To prevent that, use the Timeout (UI) or RANGE (TQL) option. Use the following when the window size is based on event time:

CREATE [ JUMPING ] WINDOW <name> OVER <stream name>
KEEP RANGE <int> { SECOND | MINUTE | HOUR | DAY }
 ON <timestamp field name>
WITHIN <int> { SECOND | MINUTE | HOUR | DAY } 
[ PARTITION BY <field name> ];
Screen_Shot_2016-04-25_at_10.47.56_AM.png

Note

Note that Timeout / RANGE is always based on system time.

Use the following when the window size is based on event count:

CREATE [ JUMPING ] WINDOW <name> OVER <stream name>
KEEP <int> ROWS
WITHIN <int> { SECOND | MINUTE | HOUR | DAY }
[ PARTITION BY <field name> ];
Screen_Shot_2016-04-25_at_10.43.42_AM.png

Note

Note that when Timeout is used with used with Time it maps to RANGE, but when used with Events it maps to WITHIN.

Jumping by event time

With the following settings, when events enter the window steadily, the window will jump every five minutes, but if there is a gap in events, the window will always jump within six minutes.

TQL:

CREATE JUMPING WINDOW P8J_ET_TO
OVER PosSource_TransformedStream
KEEP RANGE 6 MINUTE
ON dateTime
WITHIN 5 MINUTE;

UI:

  • Mode: Jumping

  • Size of Window: Advanced

    • Time: 5 minute

    • Timeout: 6 minute

    • On: logTime

Jumping by event count

The following will emit a batch of events every time the count reaches 100 or ten seconds has elapsed from the last time it emitted data:

TQL:

CREATE JUMPING WINDOW P14J_ROWS_TO
OVER PosSource_TransformedStream
KEEP 100 ROWS
WITHIN 10 SECOND;

UI:

  • Mode: Jumping

  • Size of Window: Advanced

    • Events: 100

    • Timeout: 10 second

Sliding by event time

With the following settings, when there is a gap in events, the window will always emit its contents within six minutes.

TQL:

CREATE WINDOW P7S_ET_TO
OVER PosSource_TransformedStream
KEEP RANGE 6 MINUTE
ON dateTime
WITHIN 5 MINUTE;

UI:

  • Mode: Sliding

  • Size of Window: Advanced

    • Time: 5 miinute

    • Timeout: 6 minute

    • On: dateTime

Sliding by event count

With these settings, when there is a gap in events, the window will always emit its contents within six minutes.

TQL:

CREATE WINDOW P13S_ROWS_TO
OVER PosSource_TransformedStream
KEEP 100 ROWS
WITHIN 10 SECOND;

UI:

  • Mode: Sliding

  • Size of Window: Advanced

    • Events: 100

    • Timeout: 10