Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt
hiddentrue

Siddhi Inbuilt windows in wiki format

Following are the supported inbuilt windows of Siddhi

Table of Contents

time
Anchor
time
time

<event> time (<int|long|time>  windowTime)

  • Extension TypeWindow 
  • Description: Sliding time window, that holds events for that arrived during last windowTime period, and gets updated on every event arrival and expiry.
  • ParameterwindowTime: The sliding time period for which the window should hold events.
  • Return Type: Return current and expired events.
  • Examplestime(20) for processing events arrived in last 20 milliseconds. time(2 min) for processing events arrived in last 2 minutes. 

timeBatch
Anchor
timeBatch
timeBatch

<event> timeBatch (<int|long|time>  windowTime)

  • Extension TypeWindow 
  • Description: Batch (tumbling) time window, that holds events arrived between windowTime periods, and gets updated for every windowTime.
  • ParameterwindowTime: The batch time period for which the window should hold events.
  • Return Type: Return current and expired events.
  • ExamplestimeBatch(20) for processing events arrived every 20 milliseconds. time(2 min) for processing events arrived every 2 minutes. 

length
Anchor
length
length

<event> length (<int>  windowLength)

  • Extension TypeWindow 
  • Description: Sliding length window, that holds last windowLength events, and gets updated on every event arrival and expiry.
  • ParameterwindowLength The number of events that need to should be in a sliding length window.
  • Return Type: Return current and expired events.
  • Exampleslength(10) for processing last 10 events. time(200) for processing last 200 events. 

lengthBatch
Anchor
lengthBatch
lengthBatch

<event> lengthBatch (<int>  windowLength)

  • Extension TypeWindow 
  • Description: Batch (tumbling) length window, that holds up to windowLength events, and gets updated on every windowLength event arrival.
  • ParameterwindowLength For the number of events the window should tumble.
  • Return Type: Return current and expired events.
  • ExampleslengthBatch(10) for processing 10 events as a batch. time(200) for processing 200 events as a batch. 

externalTime
Anchor
externalTime
externalTime

<event> time (<long> timestamp<int|long|time>  windowTime)

  • Extension TypeWindow 
  • Description: Sliding time window based on external time, that holds events for that arrived during last windowTime period from the external timestamp, and gets updated on every monotonically increasing timestamp.
  • Parametertimestamp The time which the window determines as current time and will act upon, the value of this parameter should be monotonically increasing. 
  • ParameterwindowTime: The sliding time period for which the window should hold events.
  • Return Type: Return current and expired events.
  • Examples: externalTime(eventTime,20) for processing events arrived in last 20 milliseconds from the eventTime. externalTime(eventTimestamp, 2 min) for processing events arrived in last 2 minutes from eventTimestamp. 

    Excerpt
    hiddentrue

    To do: add other window types