What does enableObjectReuse exactly do?

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

What does enableObjectReuse exactly do?

杨力
I wrote a streaming job with scala, using only immutable case class. Is it safe to enable object reuse? Will it get benefits from enabling object reuse?

I reached to documents but they cover neither streaming cases nor immutable data structures.
Reply | Threaded
Open this post in threaded view
|

Re: What does enableObjectReuse exactly do?

Dawid Wysakowicz-2
Hi,

In the streaming API, the biggest difference is that if you do not
disable object reuse, records will be duplicated/copied when forwarding
from an operator to the downstream one. If you are sure you work with
immutable objects, I'd highly recommend enabling object reuse.

Best,

Dawid

On 08/05/2021 05:24, 杨力 wrote:
> I wrote a streaming job with scala, using only immutable case class.
> Is it safe to enable object reuse? Will it get benefits from enabling
> object reuse?
>
> I reached to documents but they cover neither streaming cases nor
> immutable data structures.


OpenPGP_signature (855 bytes) Download Attachment