One Star

getting root_pid

Hello,
I saw in the tStatCatcher that Talend creates a pid for each job executing.
If I have a job which calls some subjobs, pid are of 3 kinds:
- pid
- father_pid
- root_pid
I need, from every subjob to get the root_pid cause I need to put it in some tMaps.
Is it possible?
Thanks in advance.
6 REPLIES
One Star

Re: getting root_pid

Hi
The root_pids of the main job and subjobs are the same. It is the pid of main job.
Or I misunderstand what you mean?
Regards,
Pedro
One Star

Re: getting root_pid

This is a tStatCatcher line for one subjob:
2012-05-14 18:52:57|qTZYuj|gsFcBS|gsFcBS|15376|<Job_Name>|<Subjob_Name>|_gdIUwJp3EeGVbY8mRw3pmg|0.1|Default||end|success|12546
I noted the the 3rd,4rd and the 5th code are different because are referred to:
- the pid of the current subjob executing
- the pid of the father who called the subjob which is executing
- the pid of the root job (the main job)
I want the root job (the fifth code).
I saw I can get the 3rd code by using the variable "pid".
Is there a way to get the root_pid code?
I hope to have been clear.
Thanks
One Star

Re: getting root_pid

Hi
Got you.
You can link tStatCatcher with tJavaRow. And save root_pid into a context variable.
Regards,
Pedro
One Star

Re: getting root_pid

it works and it was easy to think too Smiley Happy
thank you very much!
One Star

Re: getting root_pid

You can use pid public vars of your job: 
    this.pid
    this.fatherPid
    this.rootPid
and assign to tMap columns
One Star

Re: getting root_pid

I just want to know that root pid is always unique ..its means in every instance can talend generate unique root pid.
I want to add job id in my job but i'm not getting any variable for that in Talend.