Re: Shared static data between bolts

2015-05-06 Thread Huy Le Van
t;user@storm.apache.org" Date: Thursday, December 4, 2014 at 11:40 AM To: "user@storm.apache.org" Subject: Re: Shared static data between bolts Thanks! All the answers give me good idea. Here's why I need this list be sharable. One bolt needs the list for computation. Anoth

Re: Shared static data between bolts

2015-05-05 Thread Devang Shah
initialization, will bolts of type B see the same instance? >>>>> >>>>> Sent from my Android phone >>>>> On Dec 4, 2014 10:26 PM, "Eyal Golan" wrote: >>>>> >>>>>> Thanks Michael and Ben ! >>>>>> >>

Re: Shared static data between bolts

2015-05-05 Thread Supun Kamburugamuva
>>>> Sent from my Android phone >>>> On Dec 4, 2014 10:26 PM, "Eyal Golan" wrote: >>>> >>>>> Thanks Michael and Ben ! >>>>> >>>>> Sent from my Android phone >>>>> On Dec 4, 2014 9:53 PM, "

Re: Shared static data between bolts

2015-05-05 Thread Huy Le Van
tforward to implement a distributed data structure. From: Eyal Golan Reply-To: "user@storm.apache.org" Date: Thursday, December 4, 2014 at 11:40 AM To: "user@storm.apache.org" Subject: Re: Shared static data between bolts Thanks! All the answers give me good id

Re: Shared static data between bolts

2015-04-29 Thread Huy Le Van
ser@storm.apache.org" Date: Thursday, December 4, 2014 at 11:40 AM To: "user@storm.apache.org" Subject: Re: Shared static data between bolts Thanks! All the answers give me good idea. Here's why I need this list be sharable. One bolt needs the list for computation. A

Re: Shared static data between bolts

2014-12-09 Thread Eyal Golan
Thanks Michael and Ben ! >>>> >>>> Sent from my Android phone >>>> On Dec 4, 2014 9:53 PM, "Flint, Ben" wrote: >>>> >>>>> I’ve used Hazelcast for use cases like this with great success. It >>>>> makes it relatively straigh

Re: Shared static data between bolts

2014-12-04 Thread Dima Dragan
On Dec 4, 2014 9:53 PM, "Flint, Ben" wrote: >>> >>>> I’ve used Hazelcast for use cases like this with great success. It >>>> makes it relatively straightforward to implement a distributed data >>>> structure. >>>> >>>

Re: Shared static data between bolts

2014-12-04 Thread Eyal Golan
ke this with great success. It >>>> makes it relatively straightforward to implement a distributed data >>>> structure. >>>> >>>> From: Eyal Golan >>>> Reply-To: "user@storm.apache.org" >>>> Date: Thursday, December

Re: Shared static data between bolts

2014-12-04 Thread Michael Rose
"Flint, Ben" wrote: >> >>> I’ve used Hazelcast for use cases like this with great success. It >>> makes it relatively straightforward to implement a distributed data >>> structure. >>> >>> From: Eyal Golan >>> Reply-To: "

Re: Shared static data between bolts

2014-12-04 Thread Eyal Golan
t;user@storm.apache.org" >> Date: Thursday, December 4, 2014 at 11:40 AM >> To: "user@storm.apache.org" >> Subject: Re: Shared static data between bolts >> >> Thanks! >> All the answers give me good idea. >> Here's why I need

Re: Shared static data between bolts

2014-12-04 Thread Eyal Golan
Golan > Reply-To: "user@storm.apache.org" > Date: Thursday, December 4, 2014 at 11:40 AM > To: "user@storm.apache.org" > Subject: Re: Shared static data between bolts > > Thanks! > All the answers give me good idea. > Here's why I need this list b

Re: Shared static data between bolts

2014-12-04 Thread Flint, Ben
ser@storm.apache.org>> Date: Thursday, December 4, 2014 at 11:40 AM To: "user@storm.apache.org<mailto:user@storm.apache.org>" mailto:user@storm.apache.org>> Subject: Re: Shared static data between bolts Thanks! All the answers give me good idea. Here's why I need th

Re: Shared static data between bolts

2014-12-04 Thread Michael Rose
Hazelcast is killing a cockroach with a sledgehammer in this case. Have your singleton able to initialize its self, then in prepare() of your bolts call out to init it. Whichever one gets there first will lock it, then it'll initialize and unlock. Other bolts will call init, find it already initial

Re: Shared static data between bolts

2014-12-04 Thread Eyal Golan
Thanks! All the answers give me good idea. Here's why I need this list be sharable. One bolt needs the list for computation. Another bolt will periodically update the list. In other words, the list is changeable. I tried passing it in conf but there are some 3rd party libs in the wrapper. Anyway,

Re: Shared static data between bolts

2014-12-04 Thread Kushan Maskey
Hi Eyal, I had the similar issue earlier. Static objects are not a good way of passing the variables around in Storm due to clustered nature of the Storm. You will see null for all the static variables. This is how I implemented mine, for instance I wanted to pass around the server properties suc

Re: Shared static data between bolts

2014-12-04 Thread Vincent Russell
Eyal, Don't instantiate it in the main method just set it when you are defining the variable. private static List SHARED_LIST = Arrays.asList("item1","item2"); On Thu, Dec 4, 2014 at 2:01 PM, Eyal Golan wrote: > Hi all, > I am newbie with Storm and having some issues with static objects in the

Re: Shared static data between bolts

2014-12-04 Thread Michael Rose
Hi Eyal, you should be instantiating it on first access instead, then (preferably) getting one of the bolts to do so in the prepare method. Rules of singletons still apply, do your double-check locking to ensure you don't do it twice. Doing it in the main method will initialize it on the machine

Shared static data between bolts

2014-12-04 Thread Eyal Golan
Hi all, I am newbie with Storm and having some issues with static objects in the topology. In the main class, where I set the topology, I also set a static object. It's actually a wrapper for a collection of strings. This object needs to he shared between different bolts. It's big so I want it to b