You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by applyhhj <ap...@163.com> on 2016/06/16 20:43:56 UTC

how to get supervisor id in Bolt or Spout

Hello,everyone!
    Is there anyway to get the id of the supervisor that the Bolt or the Spout is running on? And the also the id of the supervisor that the consumer tasks are running on? Thank you in advance!!

Best regards!

2016-06-16


applyhhj 

Re: how to get supervisor id in Bolt or Spout

Posted by hjh <ap...@163.com>.
Ok, thank you very much for your advice!

Best wishes!

On 06/17/2016 11:36 AM, Satish Duggana wrote:
> If you want to send tuples to local worker process from one task to 
> other, you can use `localOrShuffleGrouping` between spout and bolt. 
> But I do not think we have inbuilt grouping which sends it to any of 
> the workers on the same supervisor.
>
> For ex:
>
>     TopologyBuilder builder = new TopologyBuilder();
>     builder.setSpout("spout", new RandomSentenceSpout(), 5);
>     builder.setBolt("split", new SplitSentence(), 
> 8). localOrShuffleGrouping("spout");
>
>
> Thanks,
> Satish.
>
>
> On Fri, Jun 17, 2016 at 2:28 PM, hjh <applyhhj@163.com 
> <ma...@163.com>> wrote:
>
>     Thank you for your kind reply! Well, this is a special using case,
>     we need to make the spout or bolt tasks to transmit data to the
>     tasks, that run on the same supervisor or machine, of the next
>     bolt. For example, Spout A, task 1 runs on Supervisor 1, Bolt A is
>     connected to Spout A and it has two tasks where task 1 run on
>     Supervisor 1 and task 2 run on Supervisor 2, and we need to route
>     data from Spout A task 1 to Bolt A task 1 not to task 2. And it is
>     better to not introduce the third party as a central coordinator.
>     Thank you very much!
>
>     By the way, to do so, it is also required that some of the
>     scheduling information to be shared globally in the custom
>     scheduler. And I am not sure if this is possible to do that. Thank
>     you!
>
>     Best regards!
>
>
>     On 06/17/2016 06:10 AM, Satish Duggana wrote:
>>     Hi,
>>     Why do you need supervisor-id in a bolt/spout task? What are you
>>     using for?
>>
>>     Thanks,
>>     Satish.
>>
>>     On Fri, Jun 17, 2016 at 2:13 AM, applyhhj <applyhhj@163.com
>>     <ma...@163.com>> wrote:
>>
>>         Hello\uff0ceveryone\uff01
>>             Is there anyway to get the id of the supervisor that the
>>         Bolt or the Spout is running on? And the also the id of the
>>         supervisor that the consumer tasks are running on? Thank you
>>         in advance!!
>>         Best regards!
>>         2016-06-16
>>         ------------------------------------------------------------------------
>>         applyhhj
>>
>>
>
>


Re: how to get supervisor id in Bolt or Spout

Posted by Satish Duggana <sa...@gmail.com>.
If you want to send tuples to local worker process from one task to other,
you can use `localOrShuffleGrouping` between spout and bolt. But I do not
think we have inbuilt grouping which sends it to any of the workers on the
same supervisor.

For ex:

    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("spout", new RandomSentenceSpout(), 5);
    builder.setBolt("split", new SplitSentence(),
8). localOrShuffleGrouping("spout");


Thanks,
Satish.


On Fri, Jun 17, 2016 at 2:28 PM, hjh <ap...@163.com> wrote:

> Thank you for your kind reply! Well, this is a special using case, we need
> to make the spout or bolt tasks to transmit data to the tasks, that run on
> the same supervisor or machine, of the next bolt. For example, Spout A,
> task 1 runs on Supervisor 1, Bolt A is connected to Spout A and it has two
> tasks where task 1 run on Supervisor 1 and task 2 run on Supervisor 2, and
> we need to route data from Spout A task 1 to Bolt A task 1 not to task 2.
> And it is better to not introduce the third party as a central coordinator.
> Thank you very much!
>
> By the way, to do so, it is also required that some of the scheduling
> information to be shared globally in the custom scheduler. And I am not
> sure if this is possible to do that. Thank you!
>
> Best regards!
>
>
> On 06/17/2016 06:10 AM, Satish Duggana wrote:
>
> Hi,
> Why do you need supervisor-id in a bolt/spout task? What are you using
> for?
>
> Thanks,
> Satish.
>
> On Fri, Jun 17, 2016 at 2:13 AM, applyhhj <ap...@163.com> wrote:
>
>> Hello,everyone!
>>     Is there anyway to get the id of the supervisor that the Bolt or the
>> Spout is running on? And the also the id of the supervisor that the
>> consumer tasks are running on? Thank you in advance!!
>>
>> Best regards!
>>
>> 2016-06-16
>> ------------------------------
>> applyhhj
>>
>
>
>

Re: how to get supervisor id in Bolt or Spout

Posted by hjh <ap...@163.com>.
Thank you for your kind reply! Well, this is a special using case, we 
need to make the spout or bolt tasks to transmit data to the tasks, that 
run on the same supervisor or machine, of the next bolt. For example, 
Spout A, task 1 runs on Supervisor 1, Bolt A is connected to Spout A and 
it has two tasks where task 1 run on Supervisor 1 and task 2 run on 
Supervisor 2, and we need to route data from Spout A task 1 to Bolt A 
task 1 not to task 2. And it is better to not introduce the third party 
as a central coordinator. Thank you very much!

By the way, to do so, it is also required that some of the scheduling 
information to be shared globally in the custom scheduler. And I am not 
sure if this is possible to do that. Thank you!

Best regards!

On 06/17/2016 06:10 AM, Satish Duggana wrote:
> Hi,
> Why do you need supervisor-id in a bolt/spout task? What are you using 
> for?
>
> Thanks,
> Satish.
>
> On Fri, Jun 17, 2016 at 2:13 AM, applyhhj <applyhhj@163.com 
> <ma...@163.com>> wrote:
>
>     Hello\uff0ceveryone\uff01
>         Is there anyway to get the id of the supervisor that the Bolt
>     or the Spout is running on? And the also the id of the supervisor
>     that the consumer tasks are running on? Thank you in advance!!
>     Best regards!
>     2016-06-16
>     ------------------------------------------------------------------------
>     applyhhj
>
>


Re: how to get supervisor id in Bolt or Spout

Posted by Satish Duggana <sa...@gmail.com>.
Hi,
Why do you need supervisor-id in a bolt/spout task? What are you using for?

Thanks,
Satish.

On Fri, Jun 17, 2016 at 2:13 AM, applyhhj <ap...@163.com> wrote:

> Hello,everyone!
>     Is there anyway to get the id of the supervisor that the Bolt or the
> Spout is running on? And the also the id of the supervisor that the
> consumer tasks are running on? Thank you in advance!!
>
> Best regards!
>
> 2016-06-16
> ------------------------------
> applyhhj
>