Thanks Cody! Great you added it on SO, too! On 12/16/2015 05:06 PM, Cody Innowhere wrote: > I've replied the answer in Stackoverflow too if you don't mind. > > On Thu, Dec 17, 2015 at 12:01 AM, Cody Innowhere <[email protected]> > wrote: > >> Hi Matthias, >> In JStorm, there's no executor, so >> TopologyContext.getComponentTasks(<componentId>) >> returns task ids within this component. >> >> As to your questions: >> - do tasks actually have an ID? >> *[Cody] *in JStorm, each task has an taskId of Integer type. Usually, >> each component is assigned a range of task id's (the num is equal to >> component parallelism) >> >> - if yes, can those IDs be retrieved? >> *[Cody] *Yes, use TopologyContext.getThisTaskId() method >> >> - can we get at least the number of tasks per operator somehow? >> *[Cody] *Yes, use TopologyContext.getComponentTasks(<componentId>).size() >> >> - should the above method get renamed? >> *[Cody] *We may discuss this when merging phase starts. You may refer to >> related jira later. >> >> >> On Wed, Dec 16, 2015 at 11:37 PM, Matthias J. Sax <[email protected]> >> wrote: >> >>> Thanks for your feedback. >>> >>> Turns out, the question was related to JStorm... I guess this should be >>> consider for the merge process. >>> >>>> sorry , i find i use the jstorm. storm is no problem. but when i use >>> jstorm,this problem arise >>> >>> -Matthias >>> >>> >>> On 12/16/2015 03:25 PM, Arun Iyer wrote: >>>> TopologyContext.getComponentTasks returns the list of task ids for the >>> component (not executor ids). >>>> >>>> You could just try printing the output of getComponentTasks in the >>> prepare method after doing 'setNumTasks’ (with task > parallelism) >>>> while building the topology. Worked for me. >>>> >>>> - Arun >>>> >>>> >>>> >>>> On 12/16/15, 6:21 PM, "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 >>>>> >>> >>> >> >
signature.asc
Description: OpenPGP digital signature
