Hi,

for 1 worker you can create a class with your static thread-safe collection
and thread-safe initialization method (Double Checked Locking & volatile,
for example) which return collection reference . In bolt`s prepare() method
run init(). In this way all bolts will have the same ref to collection.

for case with more than 1 worker, previous option will not work, cause each
of worker has it`s own JVM process. You  will have to persist your
collection in external database and implement static access to connection
pool. Each of worker will have it`s own pool.

On Thu, May 21, 2015 at 7:41 PM, applyhhj <[email protected]> wrote:

>   Hi,
>     Is it possible to share data between tasks of the same bolt or spout.
> For example, a string list is set as the shared data and referenced by all
> tasks of a bolt. Thank you very much!!
>
>
>  2015-05-21
> ------------------------------
>



-- 
Best regards,
Dmytro Dragan

Reply via email to