1
votes

I am using PatternTimeoutFunction for discarding the event sequence when it falls out of the defined time window.

I am setting the watermark as follows

public Watermark checkAndGetNextWatermark(Event lastElement, long extractedTimestamp) {
    return new Watermark(extractedTimestamp);
}

When pattern timeout happens, timeoutTimestamp should be equal to first event timestamp + value of timewindow

But timeout is triggering after receiving the next watermark. Is timeout triggered after receiving next watermark or based on timeWindow expiry?

1

1 Answers

1
votes

The timeout is triggered by the reception of the watermarks if you use event time. Because you can only be sure to have seen all elements up to a certain point if you receive the watermark for this timestamp.

This means that the timeout timestamp can be larger than the first event timestamp + window length depending on the value of the next watermark. Thus, the timeout timestamp is actually the event time when you realize that your pattern timed out.