0
votes

Can Flink set timer on the non-keyed stream?

ProcessAllWindowFunctionis a good option. But it cannot scale up the parallelism. It has to be 1.

I am looking for such non-keyed process function that can set a timer.

1

1 Answers

1
votes

Flink's timers are only available within keyed process functions.

The standard answer to this question is to go ahead and key the stream, adding a field holding a random number to use as the key (if there isn't already a suitable way to implement a key selector).

If you can't live with the expense of a network shuffle, for event-time timers you could implement a custom operator that implements your logic in its processWatermark method.

And if you are looking for processing-time timers, you could roll your own.