flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Ewen <se...@apache.org>
Subject Re: Get an aggregator's value outside of an iteration
Date Mon, 30 Nov 2015 09:54:51 GMT
We wanted to combine the accumulators and aggregators for a while, but have
not gotten to it so far (there is a pending PR which needs some more work).

You can currently work your way around this by using the accumulators
together with the aggregators.
  - Aggregators: Within an iteration across supersteps
  - Accumulators: Across one job, retrievable at the end in the client

You can use the close() method of a function (close() is called after each
superstep) to take the aggregator value and put it into an accumulator.
That accumulator can be retrieved after the job has finished.

Hope that workaround works for you!

Stephan


On Mon, Nov 30, 2015 at 10:51 AM, Aljoscha Krettek <aljoscha@apache.org>
wrote:

> Hi,
> I’m afraid there is no way right now to get at the values of aggregators.
> I think implementing this is problematic since the aggregators from the
> different parallel instances of operators are only combined on the
> JobManager (master node).
>
> Cheers,
> Aljoscha
> > On 27 Nov 2015, at 23:04, Truong Duc Kien <duckientruong@gmail.com>
> wrote:
> >
> > Hi,
> >
> > I'm looking for a way get the value of aggregators outside of iteration.
> Specifically, I want the final aggregators' value after the iteration has
> finished. Is there any API for that ?
> >
> > Thanks,
> > Kien Truong
>
>

Mime
View raw message