Q:

How to replace the deprecated fold function on KeyedStreams

The fold function on Flink's KeyedStreams is deprecated. The aggregate function is private and furthermore limited to some predefined aggregation-types.
A nice aggregate implementation is available on WindowedStreams. So what I could do is to define a GlobalWindow with some kind of AlwaysOnElementTrigger (which fires on every single element). That somehow feels wrong to me but I can't see the downsides.
My question: Do I have to live with the deprecation-warning or is the GlobalWindow workaround just a little ugly but does what I want? 

A:

A RichFlatMapFunction or KeyedProcessFunction feels like a more straightforward approach.

