You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-user@hadoop.apache.org by Min Zhou <co...@gmail.com> on 2011/02/15 04:16:55 UTC

Why jobtracker.jsp can safely call a non-thread-safe method of JT?

Hi all,

Hadoop JobTracker's http info server provides running/failed/completed
job informations on the web through jobtracker.jsp.  Lines below show
the logic how the web retries those informations from JobTracker.

  JobTracker tracker = (JobTracker) application.getAttribute("job.tracker");
  ...
  Vector<JobInProgress> runningJobs = tracker.runningJobs();
  Vector<JobInProgress> completedJobs = tracker.completedJobs();
  Vector<JobInProgress> failedJobs = tracker.failedJobs();

Those three methods above are apparently non-thread-safe ones.  I am
confused,  why the web can safely call a non-thread-safe method of JT?

Thanks,
Min
-- 
My research interests are distributed systems, parallel computing and
bytecode based virtual machine.

My profile:
http://www.linkedin.com/in/coderplay
My blog:
http://coderplay.javaeye.com

Re: Why jobtracker.jsp can safely call a non-thread-safe method of JT?

Posted by Mahadev Konar <ma...@apache.org>.
These are all getter apis which if you look through the
implementations call some synchronized api's. Its just that they dont
need to synchronized across all the completed/retired/running jobs for
the web ui.

thanks
mahadev

On Wed, Feb 16, 2011 at 12:47 AM, Min Zhou <co...@gmail.com> wrote:
> Anyone can help me with this?
>
> Thanks,
> Min
>
> On Tue, Feb 15, 2011 at 11:16 AM, Min Zhou <co...@gmail.com> wrote:
>> Hi all,
>>
>> Hadoop JobTracker's http info server provides running/failed/completed
>> job informations on the web through jobtracker.jsp.  Lines below show
>> the logic how the web retries those informations from JobTracker.
>>
>>  JobTracker tracker = (JobTracker) application.getAttribute("job.tracker");
>>  ...
>>  Vector<JobInProgress> runningJobs = tracker.runningJobs();
>>  Vector<JobInProgress> completedJobs = tracker.completedJobs();
>>  Vector<JobInProgress> failedJobs = tracker.failedJobs();
>>
>> Those three methods above are apparently non-thread-safe ones.  I am
>> confused,  why the web can safely call a non-thread-safe method of JT?
>>
>> Thanks,
>> Min
>> --
>> My research interests are distributed systems, parallel computing and
>> bytecode based virtual machine.
>>
>> My profile:
>> http://www.linkedin.com/in/coderplay
>> My blog:
>> http://coderplay.javaeye.com
>>
>
>
>
> --
> My research interests are distributed systems, parallel computing and
> bytecode based virtual machine.
>
> My profile:
> http://www.linkedin.com/in/coderplay
> My blog:
> http://coderplay.javaeye.com
>

Re: Why jobtracker.jsp can safely call a non-thread-safe method of JT?

Posted by Mahadev Konar <ma...@apache.org>.
These are all getter apis which if you look through the
implementations call some synchronized api's. Its just that they dont
need to synchronized across all the completed/retired/running jobs for
the web ui.

thanks
mahadev

On Wed, Feb 16, 2011 at 12:47 AM, Min Zhou <co...@gmail.com> wrote:
> Anyone can help me with this?
>
> Thanks,
> Min
>
> On Tue, Feb 15, 2011 at 11:16 AM, Min Zhou <co...@gmail.com> wrote:
>> Hi all,
>>
>> Hadoop JobTracker's http info server provides running/failed/completed
>> job informations on the web through jobtracker.jsp.  Lines below show
>> the logic how the web retries those informations from JobTracker.
>>
>>  JobTracker tracker = (JobTracker) application.getAttribute("job.tracker");
>>  ...
>>  Vector<JobInProgress> runningJobs = tracker.runningJobs();
>>  Vector<JobInProgress> completedJobs = tracker.completedJobs();
>>  Vector<JobInProgress> failedJobs = tracker.failedJobs();
>>
>> Those three methods above are apparently non-thread-safe ones.  I am
>> confused,  why the web can safely call a non-thread-safe method of JT?
>>
>> Thanks,
>> Min
>> --
>> My research interests are distributed systems, parallel computing and
>> bytecode based virtual machine.
>>
>> My profile:
>> http://www.linkedin.com/in/coderplay
>> My blog:
>> http://coderplay.javaeye.com
>>
>
>
>
> --
> My research interests are distributed systems, parallel computing and
> bytecode based virtual machine.
>
> My profile:
> http://www.linkedin.com/in/coderplay
> My blog:
> http://coderplay.javaeye.com
>

Re: Why jobtracker.jsp can safely call a non-thread-safe method of JT?

Posted by Min Zhou <co...@gmail.com>.
Anyone can help me with this?

Thanks,
Min

On Tue, Feb 15, 2011 at 11:16 AM, Min Zhou <co...@gmail.com> wrote:
> Hi all,
>
> Hadoop JobTracker's http info server provides running/failed/completed
> job informations on the web through jobtracker.jsp.  Lines below show
> the logic how the web retries those informations from JobTracker.
>
>  JobTracker tracker = (JobTracker) application.getAttribute("job.tracker");
>  ...
>  Vector<JobInProgress> runningJobs = tracker.runningJobs();
>  Vector<JobInProgress> completedJobs = tracker.completedJobs();
>  Vector<JobInProgress> failedJobs = tracker.failedJobs();
>
> Those three methods above are apparently non-thread-safe ones.  I am
> confused,  why the web can safely call a non-thread-safe method of JT?
>
> Thanks,
> Min
> --
> My research interests are distributed systems, parallel computing and
> bytecode based virtual machine.
>
> My profile:
> http://www.linkedin.com/in/coderplay
> My blog:
> http://coderplay.javaeye.com
>



-- 
My research interests are distributed systems, parallel computing and
bytecode based virtual machine.

My profile:
http://www.linkedin.com/in/coderplay
My blog:
http://coderplay.javaeye.com

Re: Why jobtracker.jsp can safely call a non-thread-safe method of JT?

Posted by Min Zhou <co...@gmail.com>.
Anyone can help me with this?

Thanks,
Min

On Tue, Feb 15, 2011 at 11:16 AM, Min Zhou <co...@gmail.com> wrote:
> Hi all,
>
> Hadoop JobTracker's http info server provides running/failed/completed
> job informations on the web through jobtracker.jsp.  Lines below show
> the logic how the web retries those informations from JobTracker.
>
>  JobTracker tracker = (JobTracker) application.getAttribute("job.tracker");
>  ...
>  Vector<JobInProgress> runningJobs = tracker.runningJobs();
>  Vector<JobInProgress> completedJobs = tracker.completedJobs();
>  Vector<JobInProgress> failedJobs = tracker.failedJobs();
>
> Those three methods above are apparently non-thread-safe ones.  I am
> confused,  why the web can safely call a non-thread-safe method of JT?
>
> Thanks,
> Min
> --
> My research interests are distributed systems, parallel computing and
> bytecode based virtual machine.
>
> My profile:
> http://www.linkedin.com/in/coderplay
> My blog:
> http://coderplay.javaeye.com
>



-- 
My research interests are distributed systems, parallel computing and
bytecode based virtual machine.

My profile:
http://www.linkedin.com/in/coderplay
My blog:
http://coderplay.javaeye.com