You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by eric perler <er...@hotmail.com> on 2014/03/26 15:46:28 UTC
execute method invoked twice ?
hello
i just started using storm today .. and i have a newbie question...
in one of my BOLT.execute methods.. i added a system out to count how many times the execute method gets called...
i have 2 bolts.. one that writes to a database.. and one that writes to a file...
when i run the topology.. i see ~1500 system outs... but in the database and the file.. i only see 750 records
is the execute method called twice per tuple ?????
Thanks !!!
Re: execute method invoked twice ?
Posted by Naresh Bhatti <na...@gmail.com>.
Hi Eric,
You should return from execute if it is not a Tuple you expect.
We use tick Tuples for some bolts but in others we simply ignore them.
if (isTickTuple(input)) {
_collector.ack(input);
return;
}
Tick tuples are enabled in Configuration
conf.put(Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS, 10);
By trapping Tuples you don't expect you will be able to figure out the
source of extra count.
Regards
Naresh
On Wed, Mar 26, 2014 at 7:46 AM, eric perler <er...@hotmail.com> wrote:
> hello
>
> i just started using storm today .. and i have a newbie question...
>
> in one of my BOLT.execute methods.. i added a system out to count how many
> times the execute method gets called...
>
> i have 2 bolts.. one that writes to a database.. and one that writes to a
> file...
>
> when i run the topology.. i see ~1500 system outs... but in the database
> and the file.. i only see 750 records
>
> is the execute method called twice per tuple ?????
>
> Thanks !!!
>