org.apache.nutch.mapReduce
Class JobTracker.JobInProgress

java.lang.Object
  extended byorg.apache.nutch.mapReduce.JobTracker.JobInProgress
Enclosing class:
JobTracker

public class JobTracker.JobInProgress
extends Object


Constructor Summary
JobTracker.JobInProgress(String jobFile)
          Create a 'JobInProgress' object, which contains both JobProfile and JobStatus.
 
Method Summary
 int attemptedMaps()
           
 int attemptedReduces()
           
 int completedMaps()
           
 float completedRatio()
           
 int completedReduces()
           
 void completedTask(String taskid)
          A task assigned to this JobInProgress has reported in successfully.
 int desiredMaps()
           
 int desiredReduces()
           
 void failedTask(String taskid)
          A task assigned to this JobInProgress has reported in as failed.
 void garbageCollect()
          The job is dead.
 long getFinishTime()
           
 JobProfile getProfile()
           
 long getStartTime()
           
 JobStatus getStatus()
           
 Task getTask(String taskid)
           
 TaskStatus getTaskStatus(String taskid)
           
 void kill()
          Kill the job and all its component tasks.
 void launch()
          Start up the tasks
 MapOutputLocation[] locateTasks(String[] taskIds)
          Return locations for all the indicated taskIds.
 void updateTaskStatus(String taskid, TaskStatus status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobTracker.JobInProgress

public JobTracker.JobInProgress(String jobFile)
                         throws IOException
Create a 'JobInProgress' object, which contains both JobProfile and JobStatus. Those two sub-objects are sometimes shipped outside of the JobTracker. But JobInProgress adds info that's useful for the JobTracker alone.

Method Detail

launch

public void launch()
            throws IOException
Start up the tasks

Throws:
IOException

kill

public void kill()
Kill the job and all its component tasks.


garbageCollect

public void garbageCollect()
                    throws IOException
The job is dead. We're now GC'ing it, getting rid of the job from all tables. Be sure to remove all of this job's tasks from the various tables.

Throws:
IOException

completedTask

public void completedTask(String taskid)
A task assigned to this JobInProgress has reported in successfully. This might prompt us to launch more tasks, or it might even indicate the job is now complete.


failedTask

public void failedTask(String taskid)
A task assigned to this JobInProgress has reported in as failed. Most of the time, we'll just reschedule execution. However, after many repeated failures we may instead decide to allow the entire job to fail. Even if a task has reported as completed in the past, it might later be reported as failed. That's because the TaskTracker that hosts a map task might die before the entire job can complete. If that happens, we need to schedule reexecution so that downstream reduce tasks can obtain the map task's output.


locateTasks

public MapOutputLocation[] locateTasks(String[] taskIds)
Return locations for all the indicated taskIds. If the task is not complete, don't return anything.


getProfile

public JobProfile getProfile()

getStatus

public JobStatus getStatus()

getTask

public Task getTask(String taskid)

completedRatio

public float completedRatio()

getStartTime

public long getStartTime()

getFinishTime

public long getFinishTime()

desiredMaps

public int desiredMaps()

attemptedMaps

public int attemptedMaps()

completedMaps

public int completedMaps()

desiredReduces

public int desiredReduces()

attemptedReduces

public int attemptedReduces()

completedReduces

public int completedReduces()

updateTaskStatus

public void updateTaskStatus(String taskid,
                             TaskStatus status)

getTaskStatus

public TaskStatus getTaskStatus(String taskid)


Copyright © 2006 The Apache Software Foundation