@InterfaceAudience.Private public class TaskLog extends Object
hadoop.log.dir
.Modifier and Type | Class and Description |
---|---|
static class |
TaskLog.LogName
The filter for userlogs.
|
static class |
TaskLog.Reader |
Constructor and Description |
---|
TaskLog() |
Modifier and Type | Method and Description |
---|---|
static String |
addCommand(List<String> cmd,
boolean isExecutable)
Add quotes to each of the command strings and
return as a single string
|
static List<String> |
captureOutAndError(List<String> setup,
List<String> cmd,
File stdoutFilename,
File stderrFilename,
long tailLength,
boolean useSetsid)
Wrap a command in a shell to capture stdout and stderr to files.
|
static ScheduledExecutorService |
createLogSyncer() |
static File |
getJobDir(JobID jobid)
Get the user log directory for the job jobid.
|
static String |
getMRv2LogDir() |
static File |
getTaskLogFile(TaskAttemptID taskid,
boolean isCleanup,
TaskLog.LogName filter) |
static long |
getTaskLogLength(JobConf conf)
Get the desired maximum length of task's logs.
|
static void |
syncLogs() |
static void |
syncLogs(String logLocation,
TaskAttemptID taskid,
boolean isCleanup) |
static void |
syncLogsShutdown(ScheduledExecutorService scheduler) |
public static String getMRv2LogDir()
public static File getTaskLogFile(TaskAttemptID taskid, boolean isCleanup, TaskLog.LogName filter)
public static void syncLogs(String logLocation, TaskAttemptID taskid, boolean isCleanup) throws IOException
IOException
public static void syncLogsShutdown(ScheduledExecutorService scheduler)
public static void syncLogs()
public static ScheduledExecutorService createLogSyncer()
public static long getTaskLogLength(JobConf conf)
conf
- the job to look inpublic static List<String> captureOutAndError(List<String> setup, List<String> cmd, File stdoutFilename, File stderrFilename, long tailLength, boolean useSetsid) throws IOException
setup
- The setup commands for the execed process.cmd
- The command and the arguments that should be runstdoutFilename
- The filename that stdout should be saved tostderrFilename
- The filename that stderr should be saved totailLength
- The length of the tail to be saved.useSetsid
- Should setsid be used in the command or not.IOException
public static String addCommand(List<String> cmd, boolean isExecutable) throws IOException
cmd
- The command to be quotedisExecutable
- makes shell path if the first
argument is executableIOException
Copyright © 2014 Apache Software Foundation. All Rights Reserved.