You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by tao xiao <xi...@gmail.com> on 2017/01/19 02:51:47 UTC

Register a user scope metric in window reduce function

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?

Re: Register a user scope metric in window reduce function

Posted by Stephan Ewen <se...@apache.org>.
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 <xi...@gmail.com> 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?
>