Please go ahead and answer it.

I actually thought the the methods works as intended, too. But the SO
person claims not to get the correct information (see the comments):


> Are you sure that it returns executor IDs and not task IDs? Do you
have different number of executors than tasks? – Matthias J. Sax
        
> yes,i set parallelism to 5,setTaskNumber(10)..it only return 5 taskid

Not sure what he/she is doing wrong...

-Matthias

On 12/16/2015 03:20 PM, Bobby Evans wrote:
> I forgot to add if you want me to pop on the stack overflow and answer it 
> myself I can.  I just don't want to step on your toes if you have started.
>  - Bobby 
> 
> 
>     On Wednesday, December 16, 2015 8:17 AM, Bobby Evans 
> <[email protected]> wrote:
>  
> 
>  It should include all of the tasks, not the executors.  
> common/storm-task-info pulls out the task ids from the executor ids, before 
> doing a reverse map and sorting it to put it in the TopologyContext.  An 
> executor ID is a range of task IDs.  [1,5] indicates this executor handles 
> tasks 1, 2, 3, 4, 5.  Most of the time an executor ID is something like [1,1] 
> for task 1.  The code in storm-task-info expands it out. 
>  - Bobby 
> 
> 
>     On Wednesday, December 16, 2015 6:52 AM, Matthias J. Sax 
> <[email protected]> wrote:
>  
> 
>  Hi,
> 
> today, the above question appeared on SO:
> https://stackoverflow.com/questions/34309189/how-to-get-the-task-number-and-id-not-the-executor-in-storm
> 
> The problem is, that
> 
> TopologyContext.getComponentTasks(<componentId>)
> 
> returns the IDs of the executors (and not the tasks). The name of the
> method is not chooses very good -- I guess this dates back to the time
> before the separation of tasks and executors...
> 
> My question is now:
> 
>  - do tasks actually have an ID?
>  - if yes, can those IDs be retrieved?
>  - can we get at least the number of tasks per operator somehow?
>  - should the above method get renamed?
> 
> As the number of tasks is fix, one could of course collect this
> information an pass it via the Config to
> StormSubmitter.submitTopology(...). However, this is quite a work-around.
> 
> Please let me know what you think about it.
> 
> 
> -Matthias
> 
> 
>    
> 
>   
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to