Apache storm static variable reference from bolt

79 Views Asked by At

A bolt in my storm topology has reference to a static variable in a utility class and will this static variable stays same for each tuple processed on a worker process.

1

There are 1 best solutions below

0
On

Task is not created for each tuple. Once the task is initiated on an executor thread, tuples will flow to this task. So, the static variable will shared across tuples.

The task thread will stay there until there is some issues with the thread and new thread gets allocated for a task. So, the static variable in my scenario is not to be used. So, changed the logic to not have static variable.