public final class LogToolUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONTAINER_ON_NODE_PATTERN |
Modifier and Type | Method and Description |
---|---|
static PrintStream |
createPrintStream(String localDir,
String nodeId,
String containerId)
Create the container log file under given (local directory/nodeId) and
return the PrintStream object.
|
static com.sun.jersey.api.client.ClientResponse |
getResponseFromNMWebService(org.apache.hadoop.conf.Configuration conf,
com.sun.jersey.api.client.Client webServiceClient,
ContainerLogsRequest request,
String logFile)
Redirect the
ContainerLogsRequest to the NodeManager's
NMWebServices. |
static void |
outputContainerLog(String containerId,
String nodeId,
String fileName,
long fileLength,
long outputSize,
String lastModifiedTime,
InputStream fis,
OutputStream os,
byte[] buf,
ContainerLogAggregationType logType)
Output container log.
|
static void |
outputContainerLogThroughZeroCopy(String containerId,
String nodeId,
String fileName,
long fileLength,
long outputSize,
String lastModifiedTime,
FileInputStream fis,
OutputStream os,
ContainerLogAggregationType logType) |
public static final String CONTAINER_ON_NODE_PATTERN
public static void outputContainerLog(String containerId, String nodeId, String fileName, long fileLength, long outputSize, String lastModifiedTime, InputStream fis, OutputStream os, byte[] buf, ContainerLogAggregationType logType) throws IOException
containerId
- the containerIdnodeId
- the nodeIdfileName
- the log file namefileLength
- the log file lengthoutputSize
- the output sizelastModifiedTime
- the log file last modified timefis
- the log file input streamos
- the output streambuf
- the bufferlogType
- the log type.IOException
- if we can not access the log file.public static void outputContainerLogThroughZeroCopy(String containerId, String nodeId, String fileName, long fileLength, long outputSize, String lastModifiedTime, FileInputStream fis, OutputStream os, ContainerLogAggregationType logType) throws IOException
IOException
public static PrintStream createPrintStream(String localDir, String nodeId, String containerId) throws IOException
localDir
- the Local DirnodeId
- the NodeIdcontainerId
- the ContainerIdIOException
- if an I/O error occurspublic static com.sun.jersey.api.client.ClientResponse getResponseFromNMWebService(org.apache.hadoop.conf.Configuration conf, com.sun.jersey.api.client.Client webServiceClient, ContainerLogsRequest request, String logFile)
ContainerLogsRequest
to the NodeManager's
NMWebServices.conf
- Configuration objectwebServiceClient
- clientrequest
- the request for container logslogFile
- name of the log fileCopyright © 2008–2024 Apache Software Foundation. All rights reserved.