You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Gaurav Sehgal <gs...@gmail.com> on 2014/05/19 07:53:02 UTC

Initialization code.

I need to do some initialization before the worker goes ahead and spawns
the different the threads, as I need to create a initialziaze a resource
which will be available by all the threads.

The prepare method; can be called for each bolt. Is there method where
which is called when worker is started.

Re: Initialization code.

Posted by Susheel Kumar Gadalay <sk...@gmail.com>.
You have to use bolts prepare method or spouts init method.

A worker can be executing multiple instances of different bolts/spouts.

On 5/19/14, Gaurav Sehgal <gs...@gmail.com> wrote:
> I need to do some initialization before the worker goes ahead and spawns
> the different the threads, as I need to create a initialziaze a resource
> which will be available by all the threads.
>
> The prepare method; can be called for each bolt. Is there method where
> which is called when worker is started.
>