Skip to main content

WindowWrite Node

The WindowWrite Node gets a timestamp to the Input Port, applies the aggregation function to the time window that matches the timestamp, appends aggregate in the Window Collection, and sends the window timestamp to the Output Port.

WindowWrite Node
WindowWrite Node

The WindowWrite Node may get optional values for the input key and value Ports.

The WindowWrite Node requires Configuration Parameters to be defined:

  • Aggregator. The function which is applied to the input value from the following list SUM, MEAN, MAX, MIN.
  • Expiration Time. The Window older then the Expiration time is deleted automatically. Expiration time is limited by 172800 sec (48 hours).
  • Collection name. The name for the collection of aggregates. Collection name is used by the WindowRead Node to request the collection.
  • Window size. The duration of the Window in seconds from 0 to 172800 sec (48 hours).
  • Step size The offset between neighbour Windows in seconds from 0 to 172800 seс (48 hours).

Examples

Assume that the WindowWrite Node receives 10 events having the following values:

  • "ts": 1000000000, "key": "A", "value": 1
  • "ts": 1000000001, "key": "B", "value": 2
  • "ts": 1000000002, "key": "C", "value": 3
  • "ts": 1000000003, "key": "A", "value": 4
  • "ts": 1000000004, "key": "B", "value": 5
  • "ts": 1000000005, "key": "C", "value": 6
  • "ts": 1000000006, "key": "A", "value": 7
  • "ts": 1000000007, "key": "B", "value": 8
  • "ts": 1000000008, "key": "C", "value": 9
  • "ts": 1000000009, "key": "A", "value": 10

The Configuration Parameters are the following:

  • Window size = 5 sec
  • Step size = 5 sec

The WindowWrite Node will collect aggregates for the 2 following intervals:

  • [0-5] sec [1000000000, 1000000005)
  • [5-10] sec [1000000005, 1000000010)

The following aggregates will be counted:

  • Total number of events witthin [0-5) Window : 5
  • Total number of events witthin [6-10) Window : 5

[0-5) Window

"key" : "A""key" : "B""key" : "C"
COUNT : 2COUNT : 2COUNT : 1
SUM : 5SUM : 7SUM : 3
MEAN : 2.5MEAN : 3.5MEAN : 3
MAX : 4MAX : 5MAX : 3
MIN : 1MIN : 2MIN : 3

[6-10) Window

"key" : "A""key" : "B""key" : "C"
COUNT : 2COUNT : 1COUNT : 2
SUM : 17SUM : 8SUM : 15
MEAN : 8.5MEAN : 8MEAN : 7.5
MAX : 10MAX : 8MAX : 9
MIN : 7MIN : 8MIN : 6