public class TaskLog extends Object
hadoop.log.dir
.Modifier and Type | Class and Description |
---|---|
static class |
TaskLog.LogName
The filter for userlogs.
|
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> |
captureDebugOut(List<String> cmd,
File debugoutFilename)
Wrap a command in a shell to capture debug script's
stdout and stderr to debugout.
|
static List<String> |
captureOutAndError(List<String> cmd,
File stdoutFilename,
File stderrFilename,
long tailLength)
Wrap a command in a shell to capture stdout and stderr to files.
|
static List<String> |
captureOutAndError(List<String> setup,
List<String> cmd,
File stdoutFilename,
File stderrFilename,
long tailLength)
Wrap a command in a shell to capture stdout and stderr to files.
|
static List<String> |
captureOutAndError(List<String> setup,
List<String> cmd,
File stdoutFilename,
File stderrFilename,
long tailLength,
String pidFileName)
Wrap a command in a shell to capture stdout and stderr to files.
|
static void |
cleanup(int logsRetainHours)
Purge old user logs.
|
static File |
getIndexFile(String taskid) |
static File |
getIndexFile(String taskid,
boolean isCleanup) |
static File |
getRealTaskLogFileLocation(TaskAttemptID taskid,
TaskLog.LogName filter) |
static File |
getTaskLogFile(TaskAttemptID taskid,
TaskLog.LogName filter) |
static long |
getTaskLogLength(JobConf conf)
Get the desired maximum length of task's logs.
|
static void |
syncLogs(TaskAttemptID firstTaskid,
TaskAttemptID taskid) |
static void |
syncLogs(TaskAttemptID firstTaskid,
TaskAttemptID taskid,
boolean isCleanup) |
public static File getTaskLogFile(TaskAttemptID taskid, TaskLog.LogName filter)
public static File getRealTaskLogFileLocation(TaskAttemptID taskid, TaskLog.LogName filter)
public static void syncLogs(TaskAttemptID firstTaskid, TaskAttemptID taskid) throws IOException
IOException
public static void syncLogs(TaskAttemptID firstTaskid, TaskAttemptID taskid, boolean isCleanup) throws IOException
IOException
public static void cleanup(int logsRetainHours) throws IOException
IOException
public static long getTaskLogLength(JobConf conf)
conf
- the job to look inpublic static List<String> captureOutAndError(List<String> cmd, File stdoutFilename, File stderrFilename, long tailLength) throws IOException
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.IOException
public static List<String> captureOutAndError(List<String> setup, List<String> cmd, File stdoutFilename, File stderrFilename, long tailLength) 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.IOException
public static List<String> captureOutAndError(List<String> setup, List<String> cmd, File stdoutFilename, File stderrFilename, long tailLength, String pidFileName) 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.pidFileName
- The name of the pid-fileIOException
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
public static List<String> captureDebugOut(List<String> cmd, File debugoutFilename) throws IOException
cmd
- The command and the arguments that should be rundebugoutFilename
- The filename that stdout and stderr
should be saved to.IOException
Copyright © 2010 The Apache Software Foundation