multiple emits in nextTuple

602 views
Skip to first unread message

Colin Surprenant

unread,
Oct 28, 2011, 1:29:44 PM10/28/11
to storm...@googlegroups.com
Hi,

Is it generally a good idea to bundle multiple emits in a single nextTuple call? For example, if a spout is reading from a queue and we know there are N items sitting in the queue, is it a good idea to emit N items directly in a single nextTuple call of it's better to cycle through multiple nextTuple calls? 

I'd guess emitting multiple tuples when possible would be an optimization, but keeping in mind that nextTuple should not block, we could use an upper bound on the emit bundle size that each nextTuple can do...

Does that make sense?

Thanks,
Colin

nathanmarz

unread,
Oct 29, 2011, 7:56:43 PM10/29/11
to storm-user
It's better that nextTuple emit a maximum of one tuple. This lets
Storm enforce the TOPOLOGY_MAX_SPOUT_PENDING config.

If you have more tuples on hand, you can buffer those internally to
the spout.

-Nathan


On Oct 28, 10:29 am, Colin Surprenant <colin.surpren...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages