Question

I'm using the storm architecture, and I've got a bolt which spawns 5 threads(/tasks, as far as I can tell they're an interchangeable term).

Is there a way for me to set a variable which all threads can read and write to?

Thanks :).

Was it helpful?

Solution

For understanding parallelism in Storm (and what tasks, executors, workers means), I recommend: Understanding the parallelism of a Storm topology.

In your Bolt, you can have a shared resource (like an instance variable of a Bolt) but you need to synchronise access to it, otherwise you will be in a deep trouble (unsurprisingly). But that shared resource isn't going to be shared between different Bolts.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top