Register a user scope metric in window reduce function

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Register a user scope metric in window reduce function

tao xiao
Hi team,

Is there any way that I can register a metric in a window reduce function? As per the flink doc getRuntimecontext is only available in RichFunction but window operator doesn't allow RichFunction to be chained. Any way to workaround this?
Reply | Threaded
Open this post in threaded view
|

Re: Register a user scope metric in window reduce function

Stephan Ewen
Hi!

There is a window variant where you can use both a ReduceFunction and a Window Function. You can use the metrics in the WindowFunction. Does that help your use case, or do you need the metrics strictly in the ReduceFunction?

There are thoughts to allow the ReduceFunction to be "semi-rich", meaning it can get access to the RuntimeContext and use metrics, etc, but no keyed state.

Stephan


On Thu, Jan 19, 2017 at 3:51 AM, tao xiao <[hidden email]> wrote:
Hi team,

Is there any way that I can register a metric in a window reduce function? As per the flink doc getRuntimecontext is only available in RichFunction but window operator doesn't allow RichFunction to be chained. Any way to workaround this?