Hi Govindarajan,
evert task is executed by exactly one thread. Thus, it should be fine to
use Thread local variables. However be aware that a single Task can execute
multiple operators if they are chained.
Cheers,
Till
On Wed, Aug 9, 2017 at 6:49 AM, Govindarajan Srinivasaraghavan <
govindragh...@gmail.com> wrote:
> Hi,
>
> I have a complex algorithm running on a flatmap operator and it requires
> cache and metrics instances to be passed to various classes. Since the task
> slots run on the same JVM, I'm not sure if I will be able to use static
> members or singleton classes. Can I use ThreadLocal variables to isolate
> the data on a task slot or is there any other approach? Thanks.
>