|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapred.TaskController org.apache.hadoop.mapred.DefaultTaskController
public class DefaultTaskController
The default implementation for controlling tasks.
This class provides an implementation for launching and killing
tasks that need to be run as the tasktracker itself. Hence,
many of the initializing or cleanup methods are not required here.
NOTE: This class is internal only class and not intended for users!!
Field Summary |
---|
Fields inherited from class org.apache.hadoop.mapred.TaskController |
---|
allocator, COMMAND_FILE, localStorage, TASK_LAUNCH_SCRIPT_PERMISSION |
Constructor Summary | |
---|---|
DefaultTaskController()
|
Method Summary | |
---|---|
void |
createLogDir(TaskAttemptID taskID,
boolean isCleanup)
Creates task log dir |
void |
deleteAsUser(String user,
String subDir)
Delete the user's files under all of the task tracker root directories. |
void |
deleteLogAsUser(String user,
String subDir)
Delete the user's files under the userlogs directory. |
void |
initializeJob(String user,
String jobid,
Path credentials,
Path jobConf,
TaskUmbilicalProtocol taskTracker,
InetSocketAddress ttAddr)
This routine initializes the local file system for running a job. |
int |
launchTask(String user,
String jobId,
String attemptId,
List<String> setup,
List<String> jvmArguments,
File currentWorkDirectory,
String stdout,
String stderr)
Create all of the directories for the task and launches the child jvm. |
void |
setConf(Configuration conf)
Set the configuration to be used by this object. |
void |
setup(LocalDirAllocator allocator,
org.apache.hadoop.mapred.TaskTracker.LocalStorage localStorage)
Does initialization and setup. |
void |
signalTask(String user,
int taskPid,
ProcessTree.Signal signal)
Send a signal to a task pid as the user. |
void |
truncateLogsAsUser(String user,
List<Task> allAttempts)
Run the passed command as the user |
Methods inherited from class org.apache.hadoop.mapred.TaskController |
---|
getConf, getLocalDirs, getRunAsUser, logOutput, writeCommand |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultTaskController()
Method Detail |
---|
public void setConf(Configuration conf)
Configurable
setConf
in interface Configurable
setConf
in class TaskController
public void createLogDir(TaskAttemptID taskID, boolean isCleanup) throws IOException
TaskController
createLogDir
in class TaskController
taskID
- ID of the taskisCleanup
- If the task is cleanup task or not
IOException
public int launchTask(String user, String jobId, String attemptId, List<String> setup, List<String> jvmArguments, File currentWorkDirectory, String stdout, String stderr) throws IOException
launchTask
in class TaskController
user
- 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 to
IOException
public void initializeJob(String user, String jobid, Path credentials, Path jobConf, TaskUmbilicalProtocol taskTracker, InetSocketAddress ttAddr) throws IOException, InterruptedException
TaskTracker.JOB_LOCAL_DIR
in the configuration
initializeJob
in class TaskController
user
- 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 address
IOException
InterruptedException
public void signalTask(String user, int taskPid, ProcessTree.Signal signal)
TaskController
signalTask
in class TaskController
user
- the user nametaskPid
- the pid of the tasksignal
- the id of the signal to sendpublic void deleteAsUser(String user, String subDir) throws IOException
deleteAsUser
in class TaskController
user
- the user namesubDir
- the path relative to the user's subdirectory under
the task tracker root directories.
IOException
public void deleteLogAsUser(String user, String subDir) throws IOException
deleteLogAsUser
in class TaskController
user
- the user to work assubDir
- the path under the userlogs directory.
IOException
public void truncateLogsAsUser(String user, List<Task> allAttempts) throws IOException
TaskController
truncateLogsAsUser
in class TaskController
allAttempts
- the list of attempts that the JVM ran
IOException
public void setup(LocalDirAllocator allocator, org.apache.hadoop.mapred.TaskTracker.LocalStorage localStorage)
TaskController
setup
in class TaskController
allocator
- the local dir allocator to uselocalStorage
- local storage to obtain dirs from
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |