Вопрос

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 :).

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top