WordCount that emits each 10 seconds

25 views
Skip to first unread message

Gustavo Arjones

unread,
Sep 25, 2011, 5:06:17 PM9/25/11
to storm-user
Hi,
I changed the WordCount example to emit counts each 10 seconds, so
I'll be able to publish results in a pub/sub and plot in a chart.

My version is available at: https://gist.github.com/1241146

I'm not sure if this would be the proper way to implement this
pattern, once I'm emitting results outside of "execute(Tuple tupple)"
method and all samples emits inside of it.

Is this a properly way to implement a time-bounded emit? Please can
you point me on right direction if not.

Thanks for the awesome work with Storm.

- Gustavo

nathanmarz

unread,
Sep 26, 2011, 2:25:15 AM9/26/11
to storm-user
Hey Gustavo,

Your code looks great, although you probably meant to clear the
counters outside of the for loop.

-Nathan

Gustavo Arjones

unread,
Sep 26, 2011, 5:50:56 PM9/26/11
to storm-user
Thanks Nathan,
I fixed the clear loop error and change the logic to take an snapshot
before emits.
Hope it can be help for someone else. https://gist.github.com/1241146

Cheers,
- Gustavo
Reply all
Reply to author
Forward
0 new messages