![](http://hi.csdn.net/attachment/201112/18/0_1324210783VgbL.gif)
As shown in this figure, the user first call the runJob() method on the JobClient to create Joblient instance and then calls submitJob(). Then the jobclient would ask the jobtracker for a new JOb ID. the Jobtracker will run a counple of checks of the submitted job, for exaple, the input splites of the job. After the checks are successful, it copies all the resources to the jobstraker's filesystem ina directory named after the jobID. Then the jobtracker will call submitJob(). Then the job is putinto a internal queue from where the job scheduler will pick up and initilize it. The initialization of a job include a creating an object to represent the job being run. It also create a list of takes to run, this is done by estimate how many tasks are there.
Tasktrackers has a fixed number of slots for tasks, the jobs will first fill out all the map tasks and then the reduce tasks.
After tasktracker is assigned with a task, it will first retrieve the information from the file system, and then use a taskrunner class to run the task, the taskrunner would launches a new Java Virtual Machine.
Failuers
Task Failure(user program bug and so on, it tells the tasktracker, tasktraker free up the slot and run something else)
Shuffle and Sort
The process to sort all the output of