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 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 occursCopyright © 2008–2019 Apache Software Foundation. All rights reserved.