You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by 朱韬 <ry...@163.com> on 2011/03/29 16:56:26 UTC

how to get each task's process

hi,guys:
       I want to monitor each tasks' io usage, do can I get each task's process id?
       I used  jvmManager.getPid(tip.getTaskRunner()); but it didn't seem to be the task's process.
       Thanks
                                                                                                 zhutao

Re: Re: how to get each task's process

Posted by Nan Zhu <zh...@gmail.com>.
Oh,  I missed that..shy.....

TaskRunner is extended from thread, I think
Thread.currendThread().getName() may be the answer

But I have a impression on that the java api cannot give the real thread id
since java doesn't allow user to manage the thread, I mean that you can only
get a id of java object instead of the id in OS....

Best,

Nan
2011/3/29 朱韬 <ry...@163.com>

> Nan:
>     Thanks, I mean process, not progress
>
>
>
>
> 在 2011-03-29 23:05:29,"Nan Zhu" <zh...@gmail.com> 写道:
>
> >TaskStatus.getprogress() is helpful
> >
> >Best,
> >Nan
> >
> >2011/3/29 朱韬 <ry...@163.com>
> >
> >> hi,guys:
> >>       I want to monitor each tasks' io usage, do can I get each task's
> >> process id?
> >>       I used  jvmManager.getPid(tip.getTaskRunner()); but it didn't seem
> to
> >> be the task's process.
> >>       Thanks
> >>
> >>                     zhutao
> >
> >
> >
> >
> >--
> >Nan Zhu
> >School of Software,5501
> >Shanghai Jiao Tong University
> >800,Dongchuan Road,Shanghai,China
> >E-Mail: zhunansjtu@gmail.com
>



-- 
Nan Zhu
School of Software,5501
Shanghai Jiao Tong University
800,Dongchuan Road,Shanghai,China
E-Mail: zhunansjtu@gmail.com

Re:Re: how to get each task's process

Posted by 朱韬 <ry...@163.com>.
Nan:
     Thanks, I mean process, not progress




在 2011-03-29 23:05:29,"Nan Zhu" <zh...@gmail.com> 写道:

>TaskStatus.getprogress() is helpful
>
>Best,
>Nan
>
>2011/3/29 朱韬 <ry...@163.com>
>
>> hi,guys:
>>       I want to monitor each tasks' io usage, do can I get each task's
>> process id?
>>       I used  jvmManager.getPid(tip.getTaskRunner()); but it didn't seem to
>> be the task's process.
>>       Thanks
>>
>>                     zhutao
>
>
>
>
>-- 
>Nan Zhu
>School of Software,5501
>Shanghai Jiao Tong University
>800,Dongchuan Road,Shanghai,China
>E-Mail: zhunansjtu@gmail.com

Re: how to get each task's process

Posted by Nan Zhu <zh...@gmail.com>.
TaskStatus.getprogress() is helpful

Best,
Nan

2011/3/29 朱韬 <ry...@163.com>

> hi,guys:
>       I want to monitor each tasks' io usage, do can I get each task's
> process id?
>       I used  jvmManager.getPid(tip.getTaskRunner()); but it didn't seem to
> be the task's process.
>       Thanks
>
>                     zhutao




-- 
Nan Zhu
School of Software,5501
Shanghai Jiao Tong University
800,Dongchuan Road,Shanghai,China
E-Mail: zhunansjtu@gmail.com

Re:Re: how to get each task's process

Posted by 朱韬 <ry...@163.com>.
Harsh: 
         I  found that jvmManager.getPid(...) returned the pid of MapTaskRunner, but I want to get the task's pid. For example, I ran the the example randomwrite, the pid of  task which is writing is 8268, but jvmManager.getPid(...) seemed to be its parent pid. I can not figure out the relationship between the taskrunner and the real task.
        Thanks 
                                                                                                                                     zhutao





At 2011-03-30 01:17:30,"Harsh J" <qw...@gmail.com> wrote:

>I think jvmManager.getPid(...) is correct. It should give you the
>launched JVM's PID properly. In fact, the same is even used to kill
>the JVMs.
>
>2011/3/29 朱韬 <ry...@163.com>:
>> hi,guys:
>>       I want to monitor each tasks' io usage, do can I get each task's process id?
>>       I used  jvmManager.getPid(tip.getTaskRunner()); but it didn't seem to be the task's process.
>>       Thanks
>>                                                                                                 zhutao
>
>
>
>-- 
>Harsh J
>http://harshj.com

Re: how to get each task's process

Posted by Harsh J <qw...@gmail.com>.
I think jvmManager.getPid(...) is correct. It should give you the
launched JVM's PID properly. In fact, the same is even used to kill
the JVMs.

2011/3/29 朱韬 <ry...@163.com>:
> hi,guys:
>       I want to monitor each tasks' io usage, do can I get each task's process id?
>       I used  jvmManager.getPid(tip.getTaskRunner()); but it didn't seem to be the task's process.
>       Thanks
>                                                                                                 zhutao



-- 
Harsh J
http://harshj.com