Remove Accumulators at runtime

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

Remove Accumulators at runtime

PedroMrChaves
Hello,

We can add an accumulator using the following call:
getRuntimeContext().addAccumulator(NAME, ACCUMULATOR);

Is there a way to remove the added accumulators at runtime?

Regards,
Pedro Chaves
Best Regards,
Pedro Chaves
Reply | Threaded
Open this post in threaded view
|

Re: Remove Accumulators at runtime

Ufuk Celebi
Hey Pedro! No, this is not possible. What your use case for this?


On Wed, Mar 8, 2017 at 10:52 AM, PedroMrChaves
<[hidden email]> wrote:

> Hello,
>
> We can add an accumulator using the following call:
> getRuntimeContext().addAccumulator(NAME, ACCUMULATOR);
>
> Is there a way to remove the added accumulators at runtime?
>
> Regards,
> Pedro Chaves
>
>
>
> -----
> Best Regards,
> Pedro Chaves
> --
> View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Remove-Accumulators-at-runtime-tp12106.html
> Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Remove Accumulators at runtime

PedroMrChaves
Hi,

I'm building a system that maintains a set of rules that can be dynamically added/removed. I wanted to count every element that matched each rule in an accumulator ( I have several parallel instances). If the rule is removed so should the accumulator.

Best Regards,
Pedro Chaves
Reply | Threaded
Open this post in threaded view
|

Re: Remove Accumulators at runtime

Ufuk Celebi
I see, this is not possible with accumulators. You could wrap all
counts in a single metric and update that one. Check out Flink's
metrics:

https://ci.apache.org/projects/flink/flink-docs-release-1.2/monitoring/metrics.html


On Wed, Mar 8, 2017 at 5:04 PM, PedroMrChaves <[hidden email]> wrote:

> Hi,
>
> I'm building a system that maintains a set of rules that can be dynamically
> added/removed. I wanted to count every element that matched each rule in an
> accumulator ( I have several parallel instances). If the rule is removed so
> should the accumulator.
>
>
>
>
>
> -----
> Best Regards,
> Pedro Chaves
> --
> View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Remove-Accumulators-at-runtime-tp12106p12119.html
> Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.