You shouldn't do that. Those input values could potentially be re-used for
other operations. I would recommend looking into using persistent data
structures.


On Sat, Dec 21, 2013 at 6:42 AM, Adam Lewis <[email protected]> wrote:

> Hi All,
>
> When implementing CombinerAggregator in Trident,
> is
>  there any issue with aggregating in
> place?  That is, something like this:
>
>
> public class
> MyAgg
>  implements CombinerAggregator<
> MyMutable
> > {
>
>
> public MyMutable combine(MyMutable val1, MyMutable val2) {
>
> val1.mergeInPlace(val2);
>        return val1;
>
>     }
>
>   ...
>
> }
>
> In my use case the values are somewhat elaborate structurally, and
> combining them in place is a lot more efficient...this seems to be working
> fine in local mode, but I can't find any indication if this is a sound
> practice before I commit to it.
>
>
> Thanks,
> Adam
>
>
>


-- 
Twitter: @nathanmarz
http://nathanmarz.com

Reply via email to