You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@reef.apache.org by Rogan Carr <ro...@gmail.com> on 2017/07/27 00:25:16 UTC

Question about taskIds

Hi All,

Is there any way for a task to determine it's own ID? I've been digging
through the code and I haven't seen any examples of this. I can always
inject in in the constructor, but I wanted to see if I could get it for
free.

Thanks!

Best,
Rogan

RE: Question about taskIds

Posted by "Julia Wang (QIUHE)" <Qi...@microsoft.com.INVALID>.
This is beauty of TANG - inject it and use it! 

Julia

-----Original Message-----
From: Rogan Carr [mailto:rogan.carr@gmail.com] 
Sent: Wednesday, July 26, 2017 6:23 PM
To: dev@reef.apache.org
Subject: Re: Question about taskIds

Hi Julia,

Thanks for the help! I hadn't realized that we could access the TaskConfigurationOptions from the constructor. This worked perfectly:
[Parameter(typeof(TaskConfigurationOptions.Identifier))] string taskId

Best,
Rogan

On Wed, Jul 26, 2017 at 5:37 PM, Julia Wang (QIUHE) < Qiuhe.Wang@microsoft.com.invalid> wrote:

> I guess you are talking about to get task id inside task.
>
> Both UpdateTaskHost and MapTaskHost constructor have tasked injected. 
> So they are able to access task id. But task id is not passed to 
> map/update functions.
>
> In map function and update function, if user wants, they can inject 
> task id in the constructor:
> [Parameter(typeof(TaskConfigurationOptions.Identifier))] string taskId
>
> You will then able to access it inside the constructor. Here user 
> means map/update function writer.
>
> Julia
>
> -----Original Message-----
> From: Julia Wang (QIUHE) [mailto:Qiuhe.Wang@microsoft.com.INVALID]
> Sent: Wednesday, July 26, 2017 5:27 PM
> To: dev@reef.apache.org
> Subject: RE: Question about taskIds
>
> Do you mean specify task id at user end in the driver?
>
> -----Original Message-----
> From: Rogan Carr [mailto:rogan.carr@gmail.com]
> Sent: Wednesday, July 26, 2017 5:25 PM
> To: dev@reef.apache.org
> Subject: Question about taskIds
>
> Hi All,
>
> Is there any way for a task to determine it's own ID? I've been 
> digging through the code and I haven't seen any examples of this. I 
> can always inject in in the constructor, but I wanted to see if I 
> could get it for free.
>
> Thanks!
>
> Best,
> Rogan
>

Re: Question about taskIds

Posted by Rogan Carr <ro...@gmail.com>.
Hi Julia,

Thanks for the help! I hadn't realized that we could access the
TaskConfigurationOptions from the constructor. This worked perfectly:
[Parameter(typeof(TaskConfigurationOptions.Identifier))] string taskId

Best,
Rogan

On Wed, Jul 26, 2017 at 5:37 PM, Julia Wang (QIUHE) <
Qiuhe.Wang@microsoft.com.invalid> wrote:

> I guess you are talking about to get task id inside task.
>
> Both UpdateTaskHost and MapTaskHost constructor have tasked injected. So
> they are able to access task id. But task id is not passed to map/update
> functions.
>
> In map function and update function, if user wants, they can inject task
> id in the constructor:
> [Parameter(typeof(TaskConfigurationOptions.Identifier))] string taskId
>
> You will then able to access it inside the constructor. Here user means
> map/update function writer.
>
> Julia
>
> -----Original Message-----
> From: Julia Wang (QIUHE) [mailto:Qiuhe.Wang@microsoft.com.INVALID]
> Sent: Wednesday, July 26, 2017 5:27 PM
> To: dev@reef.apache.org
> Subject: RE: Question about taskIds
>
> Do you mean specify task id at user end in the driver?
>
> -----Original Message-----
> From: Rogan Carr [mailto:rogan.carr@gmail.com]
> Sent: Wednesday, July 26, 2017 5:25 PM
> To: dev@reef.apache.org
> Subject: Question about taskIds
>
> Hi All,
>
> Is there any way for a task to determine it's own ID? I've been digging
> through the code and I haven't seen any examples of this. I can always
> inject in in the constructor, but I wanted to see if I could get it for
> free.
>
> Thanks!
>
> Best,
> Rogan
>

RE: Question about taskIds

Posted by "Julia Wang (QIUHE)" <Qi...@microsoft.com.INVALID>.
I guess you are talking about to get task id inside task. 

Both UpdateTaskHost and MapTaskHost constructor have tasked injected. So they are able to access task id. But task id is not passed to map/update functions.

In map function and update function, if user wants, they can inject task id in the constructor:
[Parameter(typeof(TaskConfigurationOptions.Identifier))] string taskId

You will then able to access it inside the constructor. Here user means map/update function writer.

Julia

-----Original Message-----
From: Julia Wang (QIUHE) [mailto:Qiuhe.Wang@microsoft.com.INVALID] 
Sent: Wednesday, July 26, 2017 5:27 PM
To: dev@reef.apache.org
Subject: RE: Question about taskIds

Do you mean specify task id at user end in the driver? 

-----Original Message-----
From: Rogan Carr [mailto:rogan.carr@gmail.com] 
Sent: Wednesday, July 26, 2017 5:25 PM
To: dev@reef.apache.org
Subject: Question about taskIds

Hi All,

Is there any way for a task to determine it's own ID? I've been digging through the code and I haven't seen any examples of this. I can always inject in in the constructor, but I wanted to see if I could get it for free.

Thanks!

Best,
Rogan

RE: Question about taskIds

Posted by "Julia Wang (QIUHE)" <Qi...@microsoft.com.INVALID>.
Do you mean specify task id at user end in the driver? 

-----Original Message-----
From: Rogan Carr [mailto:rogan.carr@gmail.com] 
Sent: Wednesday, July 26, 2017 5:25 PM
To: dev@reef.apache.org
Subject: Question about taskIds

Hi All,

Is there any way for a task to determine it's own ID? I've been digging through the code and I haven't seen any examples of this. I can always inject in in the constructor, but I wanted to see if I could get it for free.

Thanks!

Best,
Rogan