Save This Page
Home » hadoop-0.14.4 » org.apache » hadoop » mapred » [javadoc | source]
org.apache.hadoop.mapred
public class: TaskTracker [javadoc | source]
java.lang.Object
   org.apache.hadoop.mapred.TaskTracker

All Implemented Interfaces:
    TaskUmbilicalProtocol, MRConstants, Runnable

TaskTracker is a process that starts and tracks MR Tasks in a networked environment. It contacts the JobTracker for Task assignments and reporting results.
Nested Class Summary:
static enum class  TaskTracker.State   
class  TaskTracker.TaskInProgress   
static class  TaskTracker.RunningJob  The datastructure for initializing a job 
public static class  TaskTracker.Child  The main() for child processes. 
public static class  TaskTracker.MapOutputServlet  This class is used in TaskTracker's Jetty to serve the map outputs to other nodes. 
Field Summary
static final  long WAIT_FOR_DONE     
public static final  Log LOG     
 String taskTrackerName     
 String localHostname     
 InetSocketAddress jobTrackAddr     
 String taskReportBindAddress     
 Server taskReportServer     
 InterTrackerProtocol jobClient     
 short heartbeatResponseId     
 TaskTrackerStatus status     
 StatusHttpServer server     
 boolean shuttingDown     
 Map tasks     
 Map runningTasks    Map from taskId -> TaskInProgress. 
 Map runningJobs     
volatile  int mapTotal     
volatile  int reduceTotal     
 boolean justStarted     
 Map localDirsDf     
 long minSpaceStart     
 boolean acceptNewTasks     
 long minSpaceKill     
static  Random r     
 FileSystem fs     
 int workerThreads     
Constructor:
 public TaskTracker(JobConf conf) throws IOException 
    Start with the local machine name, and the default JobTracker
Method from org.apache.hadoop.mapred.TaskTracker Summary:
close,   done,   fsError,   getCacheSubdir,   getFileSystem,   getJobCacheSubdir,   getJobClient,   getJobConf,   getMapCompletionEvents,   getName,   getNonRunningTasks,   getProtocolVersion,   getRunningTaskStatuses,   getTask,   getTaskTrackerReportPort,   initialize,   isIdle,   main,   mapOutputLost,   offerService,   ping,   progress,   reportDiagnosticInfo,   reportTaskFinished,   run,   shutdown
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.hadoop.mapred.TaskTracker Detail:
 public synchronized  void close() throws IOException 
    Close down the TaskTracker and all its components. We must also shutdown any running tasks or threads, and cleanup disk space. A new TaskTracker within the same process space might be restarted, so everything must be clean.
 public synchronized  void done(String taskid) throws IOException 
    The task is done.
 public synchronized  void fsError(String taskId,
    String message) throws IOException 
    A child task had a local filesystem error. Kill the task.
 static String getCacheSubdir() 
 public FileSystem getFileSystem() 
    Return the DFS filesystem
 static String getJobCacheSubdir() 
 public InterTrackerProtocol getJobClient() 
    The connection to the JobTracker, used by the TaskRunner for locating remote files.
 JobConf getJobConf() 
    Get the default job conf for this tracker.
 public TaskCompletionEvent[] getMapCompletionEvents(String jobId,
    int fromEventId,
    int maxLocs) throws IOException 
 String getName() 
    Get the name for this task tracker.
 synchronized List getNonRunningTasks() 
    Get the list of stored tasks on this task tracker.
 public long getProtocolVersion(String protocol,
    long clientVersion) throws IOException 
 synchronized List getRunningTaskStatuses() 
    Get the list of tasks that will be reported back to the job tracker in the next heartbeat cycle.
 public synchronized Task getTask(String taskid) throws IOException 
    Called upon startup by the child process, to fetch Task data.
 public synchronized int getTaskTrackerReportPort() 
    Return the port at which the tasktracker bound to
 synchronized  void initialize() throws IOException 
    Do the real constructor work here. It's in a separate method so we can call it again and "recycle" the object after calling close().
 public synchronized boolean isIdle() 
    Is this task tracker idle?
 public static  void main(String[] argv) throws Exception 
    Start the TaskTracker, point toward the indicated JobTracker
 public synchronized  void mapOutputLost(String taskid,
    String errorMsg) throws IOException 
    A completed map task's output has been lost.
 TaskTracker.State offerService() throws Exception 
    Main service loop. Will stay in this loop forever.
 public synchronized boolean ping(String taskid) throws IOException 
    Child checking to see if we're alive. Normally does nothing.
 public synchronized boolean progress(String taskid,
    float progress,
    String state,
    TaskStatus.Phase phase,
    Counters counters) throws IOException 
    Called periodically to report Task progress, from 0.0 to 1.0.
 public synchronized  void reportDiagnosticInfo(String taskid,
    String info) throws IOException 
    Called when the task dies before completion, and we want to report back diagnostic info
  void reportTaskFinished(String taskid) 
    The task is no longer running. It may not have completed successfully
 public  void run() 
    The server retry loop. This while-loop attempts to connect to the JobTracker. It only loops when the old TaskTracker has gone bad (its state is stale somehow) and we need to reinitialize everything.
 public synchronized  void shutdown() throws IOException