简体   繁体   中英

Apache storm static variable reference from bolt

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM