The Gap Window operator defines a relation that consists of events that are missing from the input stream, based on an attribute that has a sequential order.
Assume that you have the following scenario:
You could add a Stream Input operator with the following attributes:
You could then connect the Stream Input operator to a Gap Window operator.
In the property editor of the Gap Window operator, set the partition key to the deviceID attribute. This setting divides the input stream into multiple substreams, one per device.
In the property editor of the Gap Window operator, set the sort value to the msgID attribute and the start value to 1. For each substream, the Gap Window operator creates an output relation that indicates which message is missing at any point in time.
For example, let's say that the messages from one device arrive in the following order: 3, 2, 5, 1, 7, 4, 4, 6.
When message 3 is received, the Gap Window operator will output message 1. When message 1 is received, the Gap Window operator will output message 4. When message 4 is received, the Gap Window operator will output message 6. When message 6 is received, the Gap Window operator will output nothing because there is no gap.
To use the Gap Window operator: