public class DefaultTaskController extends TaskController
TaskController.DeletionContextallocator, COMMAND_FILE, localStorage, TASK_LAUNCH_SCRIPT_PERMISSION| Constructor and Description |
|---|
DefaultTaskController() |
| Modifier and Type | Method and Description |
|---|---|
void |
createLogDir(TaskAttemptID taskID,
boolean isCleanup)
Creates task log dir
|
void |
deleteAsUser(java.lang.String user,
java.lang.String subDir)
Delete the user's files under all of the task tracker root directories.
|
void |
deleteLogAsUser(java.lang.String user,
java.lang.String subDir)
Delete the user's files under the userlogs directory.
|
void |
initializeJob(java.lang.String user,
java.lang.String jobid,
org.apache.hadoop.fs.Path credentials,
org.apache.hadoop.fs.Path jobConf,
TaskUmbilicalProtocol taskTracker,
java.net.InetSocketAddress ttAddr)
This routine initializes the local file system for running a job.
|
int |
launchTask(java.lang.String user,
java.lang.String jobId,
java.lang.String attemptId,
java.util.List<java.lang.String> setup,
java.util.List<java.lang.String> jvmArguments,
java.io.File currentWorkDirectory,
java.lang.String stdout,
java.lang.String stderr)
Create all of the directories for the task and launches the child jvm.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
void |
setup(org.apache.hadoop.fs.LocalDirAllocator allocator,
org.apache.hadoop.mapred.TaskTracker.LocalStorage localStorage)
Does initialization and setup.
|
void |
signalTask(java.lang.String user,
int taskPid,
ProcessTree.Signal signal)
Send a signal to a task pid as the user.
|
void |
truncateLogsAsUser(java.lang.String user,
java.util.List<Task> allAttempts)
Run the passed command as the user
|
getConf, getLocalDirs, getRunAsUser, logOutput, writeCommandpublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.ConfigurablesetConf in class TaskControllerpublic void createLogDir(TaskAttemptID taskID, boolean isCleanup) throws java.io.IOException
TaskControllercreateLogDir in class TaskControllertaskID - ID of the taskisCleanup - If the task is cleanup task or notjava.io.IOExceptionpublic int launchTask(java.lang.String user,
java.lang.String jobId,
java.lang.String attemptId,
java.util.List<java.lang.String> setup,
java.util.List<java.lang.String> jvmArguments,
java.io.File currentWorkDirectory,
java.lang.String stdout,
java.lang.String stderr)
throws java.io.IOException
launchTask in class TaskControlleruser - the user nameattemptId - the attempt idjobId - the jobId in questionsetup - list of shell commands to execute before the jvmjvmArguments - list of jvm argumentscurrentWorkDirectory - the full path of the cwd for the taskstdout - the file to redirect stdout tostderr - the file to redirect stderr tojava.io.IOExceptionpublic void initializeJob(java.lang.String user,
java.lang.String jobid,
org.apache.hadoop.fs.Path credentials,
org.apache.hadoop.fs.Path jobConf,
TaskUmbilicalProtocol taskTracker,
java.net.InetSocketAddress ttAddr)
throws java.io.IOException,
java.lang.InterruptedException
TaskTracker.JOB_LOCAL_DIR in the configurationinitializeJob in class TaskControlleruser - the user in question (the job owner)jobid - the ID of the job in questioncredentials - the path to the credentials file that the TaskTracker
downloadedjobConf - the path to the job configuration file that the TaskTracker
downloadedtaskTracker - the connection to the task trackerttAddr - the tasktracker's RPC addressjava.io.IOExceptionjava.lang.InterruptedExceptionpublic void signalTask(java.lang.String user,
int taskPid,
ProcessTree.Signal signal)
TaskControllersignalTask in class TaskControlleruser - the user nametaskPid - the pid of the tasksignal - the id of the signal to sendpublic void deleteAsUser(java.lang.String user,
java.lang.String subDir)
throws java.io.IOException
deleteAsUser in class TaskControlleruser - the user namesubDir - the path relative to the user's subdirectory under
the task tracker root directories.java.io.IOExceptionpublic void deleteLogAsUser(java.lang.String user,
java.lang.String subDir)
throws java.io.IOException
deleteLogAsUser in class TaskControlleruser - the user to work assubDir - the path under the userlogs directory.java.io.IOExceptionpublic void truncateLogsAsUser(java.lang.String user,
java.util.List<Task> allAttempts)
throws java.io.IOException
TaskControllertruncateLogsAsUser in class TaskControllerallAttempts - the list of attempts that the JVM ranjava.io.IOExceptionpublic void setup(org.apache.hadoop.fs.LocalDirAllocator allocator,
org.apache.hadoop.mapred.TaskTracker.LocalStorage localStorage)
TaskControllersetup in class TaskControllerallocator - the local dir allocator to uselocalStorage - TaskTracker's LocalStorage objectCopyright © 2009 The Apache Software Foundation