You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Pa Rö <pa...@googlemail.com> on 2015/05/26 16:01:23 UTC

count the k-means iteration

hi community,

my k-means works fine now. thanks a lot for your help.

now i want test something, how is the best way in flink to cout
the iteration?

best regards,
paul

Re: count the k-means iteration

Posted by Robert Metzger <rm...@apache.org>.
Sorry for the late reply.
Operators part of an iteration allow you to get the current iteration id
like this: getIterationRuntimeContext().getSuperstepNumber()
To get the IterationRuntimeContext, the function needs to implement the
Rich* interface.

On Tue, May 26, 2015 at 4:01 PM, Pa Rö <pa...@googlemail.com>
wrote:

> hi community,
>
> my k-means works fine now. thanks a lot for your help.
>
> now i want test something, how is the best way in flink to cout
> the iteration?
>
> best regards,
> paul
>