public class TaskTracker extends Object implements TaskUmbilicalProtocol, Runnable, TaskTrackerMXBean
| Modifier and Type | Class and Description |
|---|---|
static class |
TaskTracker.DefaultShuffleProvider |
static class |
TaskTracker.MapOutputServlet
This class is used in TaskTracker's Jetty to serve the map outputs
to other nodes.
|
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
ClientTraceLog |
static long |
COUNTER_UPDATE_INTERVAL |
static long |
DEFAULT_DISK_HEALTH_CHECK_INTERVAL
How often TaskTracker needs to check the health of its disks, if not
configured using mapred.disk.healthChecker.interval
|
static int |
FILE_NOT_FOUND |
static String |
FOR_REDUCE_TASK
The reduce task number for which this map output is being transferred
|
static String |
FROM_MAP_TASK
The map task from which the map output data is being transferred
|
static int |
HEARTBEAT_INTERVAL_MIN_DEFAULT |
static org.apache.commons.logging.Log |
LOG |
static String |
MAP_OUTPUT_LENGTH
The custom http header used for the map output length.
|
static String |
MR_CLIENTTRACE_FORMAT |
static String |
RAW_MAP_OUTPUT_LENGTH
The custom http header used for the "raw" map output length.
|
static String |
SHUFFLE_PROVIDER_PLUGIN_CLASSES |
static String |
SUBDIR |
static int |
SUCCESS |
static String |
TT_KEYTAB_FILE |
static String |
TT_LOG_TMP_DIR |
static String |
TT_RESOURCE_CALCULATOR_PLUGIN |
static String |
TT_USER_NAME |
static String |
WORKDIR |
versionID| Constructor and Description |
|---|
TaskTracker(JobConf conf)
Start with the local machine name, and the default JobTracker
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCommit(TaskAttemptID taskid,
org.apache.hadoop.mapred.JvmContext jvmContext)
Child checking whether it can commit
|
void |
cleanupStorage()
Deprecated.
|
void |
close()
Close down the TaskTracker and all its components.
|
void |
commitPending(TaskAttemptID taskid,
TaskStatus taskStatus,
org.apache.hadoop.mapred.JvmContext jvmContext)
Task is reporting that it is in commit_pending
and it is waiting for the commit Response
|
void |
done(TaskAttemptID taskid,
org.apache.hadoop.mapred.JvmContext jvmContext)
The task is done.
|
void |
fatalError(TaskAttemptID taskId,
String msg,
org.apache.hadoop.mapred.JvmContext jvmContext)
A child task had a fatal error.
|
void |
fsError(TaskAttemptID taskId,
String message,
org.apache.hadoop.mapred.JvmContext jvmContext)
A child task had a local filesystem error.
|
String |
getConfigVersion() |
String |
getHostname() |
int |
getHttpPort() |
static Class<? extends org.apache.hadoop.mapred.TaskTrackerInstrumentation> |
getInstrumentationClass(org.apache.hadoop.conf.Configuration conf) |
static String |
getIntermediateOutputDir(String user,
String jobid,
String taskid) |
static String |
getJobCacheSubdir(String user) |
org.apache.hadoop.mapred.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.
|
JobConf |
getJobConf(JobID jobId)
Get the specific job conf for a running job.
|
static String |
getJobJarFile(String user,
String jobid) |
String |
getJobTrackerUrl() |
org.apache.hadoop.mapred.JvmManager |
getJvmManagerInstance() |
static String |
getLocalJobDir(String user,
String jobid) |
static String |
getLocalTaskDir(String user,
String jobid,
String taskid) |
static String |
getLocalTaskDir(String user,
String jobid,
String taskid,
boolean isCleanupAttempt) |
MapTaskCompletionEventsUpdate |
getMapCompletionEvents(JobID jobId,
int fromEventId,
int maxLocs,
TaskAttemptID id,
org.apache.hadoop.mapred.JvmContext jvmContext)
Called by a reduce task to get the map output locations for finished maps.
|
static String |
getPrivateDistributedCacheDir(String user) |
org.apache.hadoop.ipc.ProtocolSignature |
getProtocolSignature(String protocol,
long clientVersion,
int clientMethodsHash) |
long |
getProtocolVersion(String protocol,
long clientVersion) |
static String |
getPublicDistributedCacheDir() |
int |
getRpcPort() |
JvmTask |
getTask(org.apache.hadoop.mapred.JvmContext context)
Called upon startup by the child process, to fetch Task data.
|
TaskController |
getTaskController() |
org.apache.hadoop.mapred.TaskMemoryManagerThread |
getTaskMemoryManager() |
String |
getTasksInfoJson() |
org.apache.hadoop.mapred.TaskTrackerInstrumentation |
getTaskTrackerInstrumentation() |
InetSocketAddress |
getTaskTrackerReportAddress()
Return the port at which the tasktracker bound to
|
static String |
getUserDir(String user) |
String |
getVersion() |
boolean |
isHealthy() |
boolean |
isIdle()
Is this task tracker idle?
|
boolean |
isTaskMemoryManagerEnabled()
Is the TaskMemoryManager Enabled on this system?
|
static void |
main(String[] argv)
Start the TaskTracker, point toward the indicated JobTracker
|
void |
mapOutputLost(TaskAttemptID taskid,
String errorMsg)
A completed map task's output has been lost.
|
boolean |
ping(TaskAttemptID taskid,
org.apache.hadoop.mapred.JvmContext jvmContext)
Child checking to see if we're alive.
|
void |
reportDiagnosticInfo(TaskAttemptID taskid,
String info,
org.apache.hadoop.mapred.JvmContext jvmContext)
Called when the task dies before completion, and we want to report back
diagnostic info
|
void |
reportNextRecordRange(TaskAttemptID taskid,
org.apache.hadoop.mapred.SortedRanges.Range range,
org.apache.hadoop.mapred.JvmContext jvmContext)
Report the record range which is going to process next by the Task.
|
void |
run()
The server retry loop.
|
static void |
setInstrumentationClass(org.apache.hadoop.conf.Configuration conf,
Class<? extends org.apache.hadoop.mapred.TaskTrackerInstrumentation> t) |
void |
shuffleError(TaskAttemptID taskId,
String message,
org.apache.hadoop.mapred.JvmContext jvmContext)
A reduce-task failed to shuffle the map-outputs.
|
void |
shutdown() |
boolean |
statusUpdate(TaskAttemptID taskid,
TaskStatus taskStatus,
org.apache.hadoop.mapred.JvmContext jvmContext)
Called periodically to report Task progress, from 0.0 to 1.0.
|
void |
updatePrivateDistributedCacheSizes(JobID jobId,
long[] sizes)
The job initializer needs to report the sizes of the archive
objects and directories in the private distributed cache.
|
public static final String SHUFFLE_PROVIDER_PLUGIN_CLASSES
public static final org.apache.commons.logging.Log LOG
public static final String MR_CLIENTTRACE_FORMAT
public static final org.apache.commons.logging.Log ClientTraceLog
public static final String SUBDIR
public static final String TT_LOG_TMP_DIR
public static final String TT_RESOURCE_CALCULATOR_PLUGIN
public static final String TT_USER_NAME
public static final String TT_KEYTAB_FILE
public static final int HEARTBEAT_INTERVAL_MIN_DEFAULT
public static final long COUNTER_UPDATE_INTERVAL
public static final long DEFAULT_DISK_HEALTH_CHECK_INTERVAL
public static final int SUCCESS
public static final int FILE_NOT_FOUND
public static final String MAP_OUTPUT_LENGTH
public static final String RAW_MAP_OUTPUT_LENGTH
public static final String FROM_MAP_TASK
public static final String FOR_REDUCE_TASK
public static final String WORKDIR
public TaskTracker(JobConf conf) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic org.apache.hadoop.mapred.TaskTrackerInstrumentation getTaskTrackerInstrumentation()
public TaskController getTaskController()
public static String getPublicDistributedCacheDir()
public static String getIntermediateOutputDir(String user, String jobid, String taskid)
public static String getLocalTaskDir(String user, String jobid, String taskid, boolean isCleanupAttempt)
public long getProtocolVersion(String protocol, long clientVersion) throws IOException
getProtocolVersion in interface org.apache.hadoop.ipc.VersionedProtocolIOExceptionpublic org.apache.hadoop.ipc.ProtocolSignature getProtocolSignature(String protocol, long clientVersion, int clientMethodsHash) throws IOException
getProtocolSignature in interface org.apache.hadoop.ipc.VersionedProtocolIOExceptionpublic static Class<? extends org.apache.hadoop.mapred.TaskTrackerInstrumentation> getInstrumentationClass(org.apache.hadoop.conf.Configuration conf)
public static void setInstrumentationClass(org.apache.hadoop.conf.Configuration conf,
Class<? extends org.apache.hadoop.mapred.TaskTrackerInstrumentation> t)
@Deprecated public void cleanupStorage() throws IOException
IOExceptionorg.apache.hadoop.mapreduce.util.MRAsyncDiskService#cleanupDirsInAllVolumes()public void shutdown()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void close()
throws IOException,
InterruptedException
InterruptedExceptionIOExceptionpublic org.apache.hadoop.mapred.InterTrackerProtocol getJobClient()
public InetSocketAddress getTaskTrackerReportAddress()
public org.apache.hadoop.mapred.JvmManager getJvmManagerInstance()
public void run()
public JvmTask getTask(org.apache.hadoop.mapred.JvmContext context) throws IOException
getTask in interface TaskUmbilicalProtocolcontext - the JvmContext of the JVM w.r.t the TaskTracker that
launched itIOExceptionpublic boolean statusUpdate(TaskAttemptID taskid, TaskStatus taskStatus, org.apache.hadoop.mapred.JvmContext jvmContext) throws IOException
statusUpdate in interface TaskUmbilicalProtocoltaskid - task-id of the childtaskStatus - status of the childjvmContext - context the jvmContext running the task.IOExceptionpublic void reportDiagnosticInfo(TaskAttemptID taskid, String info, org.apache.hadoop.mapred.JvmContext jvmContext) throws IOException
reportDiagnosticInfo in interface TaskUmbilicalProtocoltaskid - the id of the task involvedinfo - the text to reportjvmContext - context the jvmContext running the task.IOExceptionpublic void reportNextRecordRange(TaskAttemptID taskid, org.apache.hadoop.mapred.SortedRanges.Range range, org.apache.hadoop.mapred.JvmContext jvmContext) throws IOException
TaskUmbilicalProtocolreportNextRecordRange in interface TaskUmbilicalProtocoltaskid - the id of the task involvedrange - the range of record sequence nosjvmContext - context the jvmContext running the task.IOExceptionpublic boolean ping(TaskAttemptID taskid, org.apache.hadoop.mapred.JvmContext jvmContext) throws IOException
ping in interface TaskUmbilicalProtocoltaskid - the id of the task involvedjvmContext - context the jvmContext running the task.IOExceptionpublic void commitPending(TaskAttemptID taskid, TaskStatus taskStatus, org.apache.hadoop.mapred.JvmContext jvmContext) throws IOException
commitPending in interface TaskUmbilicalProtocoltaskid - task's idtaskStatus - status of the childjvmContext - context the jvmContext running the task.IOExceptionpublic boolean canCommit(TaskAttemptID taskid, org.apache.hadoop.mapred.JvmContext jvmContext) throws IOException
canCommit in interface TaskUmbilicalProtocoljvmContext - context the jvmContext running the task.IOExceptionpublic void done(TaskAttemptID taskid, org.apache.hadoop.mapred.JvmContext jvmContext) throws IOException
done in interface TaskUmbilicalProtocoltaskid - task's idjvmContext - context the jvmContext running the task.IOExceptionpublic void shuffleError(TaskAttemptID taskId, String message, org.apache.hadoop.mapred.JvmContext jvmContext) throws IOException
shuffleError in interface TaskUmbilicalProtocolIOExceptionpublic void fsError(TaskAttemptID taskId, String message, org.apache.hadoop.mapred.JvmContext jvmContext) throws IOException
fsError in interface TaskUmbilicalProtocolIOExceptionpublic void fatalError(TaskAttemptID taskId, String msg, org.apache.hadoop.mapred.JvmContext jvmContext) throws IOException
fatalError in interface TaskUmbilicalProtocolIOExceptionpublic MapTaskCompletionEventsUpdate getMapCompletionEvents(JobID jobId, int fromEventId, int maxLocs, TaskAttemptID id, org.apache.hadoop.mapred.JvmContext jvmContext) throws IOException
TaskUmbilicalProtocolgetMapCompletionEvents in interface TaskUmbilicalProtocoljobId - the reducer job idfromEventId - the index starting from which the locations should be
fetchedmaxLocs - the max number of locations to fetchid - The attempt id of the task that is trying to communicateMapTaskCompletionEventsUpdateIOExceptionpublic void mapOutputLost(TaskAttemptID taskid, String errorMsg) throws IOException
IOExceptionpublic JobConf getJobConf(JobID jobId) throws IOException
IOExceptionpublic JobConf getJobConf()
public boolean isIdle()
public static void main(String[] argv) throws Exception
Exceptionpublic boolean isTaskMemoryManagerEnabled()
public org.apache.hadoop.mapred.TaskMemoryManagerThread getTaskMemoryManager()
public String getHostname()
getHostname in interface TaskTrackerMXBeanpublic String getVersion()
getVersion in interface TaskTrackerMXBeanpublic String getConfigVersion()
getConfigVersion in interface TaskTrackerMXBeanpublic String getJobTrackerUrl()
getJobTrackerUrl in interface TaskTrackerMXBeanpublic int getRpcPort()
getRpcPort in interface TaskTrackerMXBeanpublic int getHttpPort()
getHttpPort in interface TaskTrackerMXBeanpublic boolean isHealthy()
isHealthy in interface TaskTrackerMXBeanpublic String getTasksInfoJson()
getTasksInfoJson in interface TaskTrackerMXBeanpublic void updatePrivateDistributedCacheSizes(JobID jobId, long[] sizes) throws IOException
TaskUmbilicalProtocolupdatePrivateDistributedCacheSizes in interface TaskUmbilicalProtocoljobId - the job to updatesizes - the array of sizes that were computedIOExceptionCopyright © 2009 The Apache Software Foundation