You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Giacomo Berardi <ba...@gmail.com> on 2014/12/06 01:14:42 UTC

obtaining the grouping strategy

Hi,
I am developing an application on Storm with some particular requirements.
I would access to grouping information from a source bolt, i.e., I would
know how messages are sent to the output tasks.
For example, connecting a bolt A to a bolt B by fields grouping, I would
know, in bolt A, to which task of bolt B a tuple is sent (before emitting
it).
Is there any way to retrieve this information?

Thank you
Giacomo

Re: obtaining the grouping strategy

Posted by Giacomo Berardi <ba...@gmail.com>.
Thank you Nathan, I missed that method.

Giacomo

2014-12-08 23:48 GMT+01:00 Nathan Marz <na...@nathanmarz.com>:

> This information is available via the TopologyContext passed to the
> prepare method. See TopologyContext#getTargets
> https://storm.apache.org/apidocs/backtype/storm/task/GeneralTopologyContext.html#getTargets(java.lang.String)
>
> The OutputCollector#emit method returns the list of all task ids the tuple
> is being sent to.
>
> On Fri, Dec 5, 2014 at 7:14 PM, Giacomo Berardi <ba...@gmail.com> wrote:
>
>> Hi,
>> I am developing an application on Storm with some particular
>> requirements.
>> I would access to grouping information from a source bolt, i.e., I would
>> know how messages are sent to the output tasks.
>> For example, connecting a bolt A to a bolt B by fields grouping, I would
>> know, in bolt A, to which task of bolt B a tuple is sent (before emitting
>> it).
>> Is there any way to retrieve this information?
>>
>> Thank you
>> Giacomo
>>
>
>
>
> --
> Twitter: @nathanmarz
> http://nathanmarz.com
>

Re: obtaining the grouping strategy

Posted by Nathan Marz <na...@nathanmarz.com>.
This information is available via the TopologyContext passed to the prepare
method. See TopologyContext#getTargets
https://storm.apache.org/apidocs/backtype/storm/task/GeneralTopologyContext.html#getTargets(java.lang.String)

The OutputCollector#emit method returns the list of all task ids the tuple
is being sent to.

On Fri, Dec 5, 2014 at 7:14 PM, Giacomo Berardi <ba...@gmail.com> wrote:

> Hi,
> I am developing an application on Storm with some particular requirements.
> I would access to grouping information from a source bolt, i.e., I would
> know how messages are sent to the output tasks.
> For example, connecting a bolt A to a bolt B by fields grouping, I would
> know, in bolt A, to which task of bolt B a tuple is sent (before emitting
> it).
> Is there any way to retrieve this information?
>
> Thank you
> Giacomo
>



-- 
Twitter: @nathanmarz
http://nathanmarz.com