public class TaskLog extends Object
hadoop.log.dir
.
This class is for Map/Reduce internal use only.限定符和类型 | 类和说明 |
---|---|
static class |
TaskLog.LogName
The filter for userlogs.
|
构造器和说明 |
---|
TaskLog() |
限定符和类型 | 方法和说明 |
---|---|
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,
boolean useSetsid)
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,
boolean useSetsid,
String pidFileName)
已过时。
pidFiles are no more used. Instead pid is exported to
env variable JVM_PID.
|
static List<String> |
captureOutAndError(List<String> setup,
List<String> cmd,
File stdoutFilename,
File stderrFilename,
long tailLength,
String pidFileName)
已过时。
pidFiles are no more used. Instead pid is exported to
env variable JVM_PID.
|
static void |
createTaskAttemptLogDir(TaskAttemptID taskID,
boolean isCleanup,
String[] localDirs)
Create log directory for the given attempt.
|
static String |
getBaseLogDir() |
static File |
getJobDir(JobID jobid)
Get the user log directory for the job jobid.
|
static File |
getJobDir(String jobid)
Get the user log directory for the job jobid.
|
static String |
getTaskAttemptLogDir(TaskAttemptID taskID,
String cleanupSuffix,
String[] localDirs)
Get attempt log directory path for the given attempt-id under randomly
selected mapred local directory.
|
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 File |
getUserLogDir() |
static void |
syncLogs(String logLocation,
TaskAttemptID taskid,
boolean isCleanup,
boolean segmented) |
public static void createTaskAttemptLogDir(TaskAttemptID taskID, boolean isCleanup, String[] localDirs) throws IOException
taskID
- attempt-id for which log dir is to be createdisCleanup
- Is this attempt a cleanup attempt ?localDirs
- mapred local directoriesIOException
public static String getTaskAttemptLogDir(TaskAttemptID taskID, String cleanupSuffix, String[] localDirs) throws IOException
taskID
- attempt-id for which log dir path is neededcleanupSuffix
- ".cleanup" if this attempt is a cleanup attemptlocalDirs
- mapred local directoriesIOException
public static File getTaskLogFile(TaskAttemptID taskid, boolean isCleanup, TaskLog.LogName filter)
public static String getBaseLogDir()
public static void syncLogs(String logLocation, TaskAttemptID taskid, boolean isCleanup, boolean segmented) 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
@Deprecated 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.IOException
@Deprecated public static List<String> captureOutAndError(List<String> setup, List<String> cmd, File stdoutFilename, File stderrFilename, long tailLength, boolean useSetsid, 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.useSetsid
- Should setsid be used in the command or not.IOException
public 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
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
public static File getUserLogDir()
public static File getJobDir(String jobid)
jobid
- string representation of the jobidCopyright © 2009 The Apache Software Foundation