You need to specify a cyclic dataflow:
> builder.setSpout("spout", ...);
> builder.setBolt("bolt1", ...).directGrouping("spout").directGrouping("bolt1");
> builder.setBolt("bolt2, ...).directGropuing("bolt1");You can use the default stream. -Matthias On 11/04/2015 09:06 PM, Nathan Leung wrote: > You would need: > > Spout-1 --(direct-grouping)--> Bolt-1 --(direct-grouping)--> Bolt-2 > --(direct grouping, non-default stream)--> Bolt 1 > > Task IDs are numbered from 0 (pretty sure it's 0, if not it's from 1) > for each component. Therefore Spout 1 task IDs are 0 to (n-1), Bolt 1 > task IDs are 0 to (m-1), etc where n = number of Spout 1 tasks and m = > number of Bolt 1 tasks. > > If you want a cyclic graph in your topology I believe you have to use a > non-default stream. > > On Wed, Nov 4, 2015 at 2:22 PM, Nick R. Katsipoulakis > <[email protected] <mailto:[email protected]>> wrote: > > Hello, > > I have a question regarding direct streaming and sending a tuple > from a downstream node to its upstream node. To be more precise, let > us assume we have the following topology: > > Spout-1 --(direct-grouping)--> Bolt-1 --(direct-grouping)--> Bolt-2 > > Can Bolt-2 call emitDirect() and send a tuple back to Bolt-1 (by > getting the task-id from tuple.getSourceTask() )? If not, is it > because of the general architecture of Storm? > > Thanks, > Nick > >
signature.asc
Description: OpenPGP digital signature
