Unique ID of an operator

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Unique ID of an operator

Deepak Jha
Hi,
I have a use case where I need to get UniqueId of an operator inside a
stream. DataStream's getId() returns the ID of the stream but I have
operator partitioned (say partitionByHash) inside the datastream. So I
would like to get unique ID for each operator working in parallel. Is there
a way in which I can get it ?
Also, does DataStream's getId generates different ID in case i have
parallelism > 1 ?


--
Thanks,
Deepak
Reply | Threaded
Open this post in threaded view
|

Re: Unique ID of an operator

Robert Metzger
Hi,

the runtime context has the following method:

int subtask = getRuntimeContext().getIndexOfThisSubtask();

The RuntimeContext is available in each Rich* function.


On Fri, Apr 8, 2016 at 11:46 PM, Deepak Jha <[hidden email]> wrote:

> Hi,
> I have a use case where I need to get UniqueId of an operator inside a
> stream. DataStream's getId() returns the ID of the stream but I have
> operator partitioned (say partitionByHash) inside the datastream. So I
> would like to get unique ID for each operator working in parallel. Is there
> a way in which I can get it ?
> Also, does DataStream's getId generates different ID in case i have
> parallelism > 1 ?
>
>
> --
> Thanks,
> Deepak
>
Reply | Threaded
Open this post in threaded view
|

Unique ID of an operator

Deepak Jha
Hi Robert,
Thanks.

On Sat, Apr 9, 2016 at 12:55 AM, Robert Metzger <[hidden email]
<javascript:_e(%7B%7D,'cvml','[hidden email]');>> wrote:

> Hi,
>
> the runtime context has the following method:
>
> int subtask = getRuntimeContext().getIndexOfThisSubtask();
>
> The RuntimeContext is available in each Rich* function.
>
>
> On Fri, Apr 8, 2016 at 11:46 PM, Deepak Jha <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> wrote:
>
> > Hi,
> > I have a use case where I need to get UniqueId of an operator inside a
> > stream. DataStream's getId() returns the ID of the stream but I have
> > operator partitioned (say partitionByHash) inside the datastream. So I
> > would like to get unique ID for each operator working in parallel. Is
> there
> > a way in which I can get it ?
> > Also, does DataStream's getId generates different ID in case i have
> > parallelism > 1 ?
> >
> >
> > --
> > Thanks,
> > Deepak
> >
>



--
Thanks,
Deepak Jha



--
Sent from Gmail Mobile