flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Till Rohrmann <trohrm...@apache.org>
Subject Re: Task slot data
Date Wed, 09 Aug 2017 09:47:50 GMT
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.


On Wed, Aug 9, 2017 at 6:49 AM, Govindarajan Srinivasaraghavan <
govindraghvan@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.

View raw message