You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Flavio Pompermaier <po...@okkam.it> on 2014/11/21 10:08:23 UTC

FlatMap on a batch of elements

Hy all,
in my FlatMap function I'd like to call a service every 100 elements.
That would be possible if Collector was passed to the close function but it
is not.
How can I simulate that?

Re: FlatMap on a batch of elements

Posted by Flavio Pompermaier <po...@okkam.it>.
Yes, that's perfectly fine!
Thanks!

On Fri, Nov 21, 2014 at 10:14 AM, Stefan Bunk <st...@googlemail.com>
wrote:

> Hi,
>
> maybe mapPartition ("Transforms a parallel partition in a single function
> call. The function get the partition as an `Iterator` and can produce an
> arbitrary number of result values.") is the right thing for you?
>
> Cheers
> Stefan
>
> On Fri, Nov 21, 2014 at 10:08 AM, Flavio Pompermaier <pompermaier@okkam.it
> > wrote:
>
>> Hy all,
>> in my FlatMap function I'd like to call a service every 100 elements.
>> That would be possible if Collector was passed to the close function but
>> it is not.
>> How can I simulate that?
>>
>>

Re: FlatMap on a batch of elements

Posted by Stefan Bunk <st...@googlemail.com>.
Hi,

maybe mapPartition ("Transforms a parallel partition in a single function
call. The function get the partition as an `Iterator` and can produce an
arbitrary number of result values.") is the right thing for you?

Cheers
Stefan

On Fri, Nov 21, 2014 at 10:08 AM, Flavio Pompermaier <po...@okkam.it>
wrote:

> Hy all,
> in my FlatMap function I'd like to call a service every 100 elements.
> That would be possible if Collector was passed to the close function but
> it is not.
> How can I simulate that?
>
>