@InterfaceAudience.Public @InterfaceStability.Evolving public static class AggregatedLogFormat.LogReader extends Object implements AutoCloseable
Constructor and Description |
---|
LogReader(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path remoteAppLogFile) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType,String> |
getApplicationAcls()
Returns ACLs for the application.
|
String |
getApplicationOwner()
Returns the owner of the application.
|
AggregatedLogFormat.ContainerLogsReader |
getContainerLogsReader(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Get a ContainerLogsReader to read the logs for
the specified container.
|
DataInputStream |
next(AggregatedLogFormat.LogKey key)
Read the next key and return the value-stream.
|
static void |
readAcontainerLogs(DataInputStream valueStream,
Writer writer)
Writes all logs for a single container to the provided writer.
|
static void |
readAcontainerLogs(DataInputStream valueStream,
Writer writer,
long logUploadedTime)
Writes all logs for a single container to the provided writer.
|
static void |
readAContainerLogsForALogType(DataInputStream valueStream,
PrintStream out)
Keep calling this till you get a
EOFException for getting logs of
all types for a single container. |
static void |
readAContainerLogsForALogType(DataInputStream valueStream,
PrintStream out,
long logUploadedTime)
Keep calling this till you get a
EOFException for getting logs of
all types for a single container. |
static void |
readAContainerLogsForALogType(DataInputStream valueStream,
PrintStream out,
long logUploadedTime,
long bytes)
Keep calling this till you get a
EOFException for getting logs of
all types for a single container for the specific bytes. |
static int |
readContainerLogsForALogType(DataInputStream valueStream,
PrintStream out,
long logUploadedTime,
List<String> logType)
Keep calling this till you get a
EOFException for getting logs of
the specific types for a single container. |
static int |
readContainerLogsForALogType(DataInputStream valueStream,
PrintStream out,
long logUploadedTime,
List<String> logType,
long bytes)
Keep calling this till you get a
EOFException for getting logs of
the specific types for a single container. |
static org.apache.commons.math3.util.Pair<String,String> |
readContainerMetaDataAndSkipData(DataInputStream valueStream) |
public LogReader(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path remoteAppLogFile) throws IOException
IOException
public String getApplicationOwner() throws IOException
IOException
- if we can not get the application owner.public Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType,String> getApplicationAcls() throws IOException
IOException
- if we can not get the application acls.public DataInputStream next(AggregatedLogFormat.LogKey key) throws IOException
key
- the log keyIOException
- if we can not get the dataInputStream
for the next key@InterfaceAudience.Private public AggregatedLogFormat.ContainerLogsReader getContainerLogsReader(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws IOException
containerId
- the containerIdIOException
- if we can not get the container log reader.public static void readAcontainerLogs(DataInputStream valueStream, Writer writer, long logUploadedTime) throws IOException
valueStream
- the valueStreamwriter
- the log writerlogUploadedTime
- the time stampIOException
- if we can not read the container logs.public static void readAcontainerLogs(DataInputStream valueStream, Writer writer) throws IOException
valueStream
- the value streamwriter
- the log writerIOException
- if we can not read the container logs.public static void readAContainerLogsForALogType(DataInputStream valueStream, PrintStream out, long logUploadedTime) throws IOException
EOFException
for getting logs of
all types for a single container.valueStream
- the value streamout
- the print streamlogUploadedTime
- the time stampIOException
- if we can not read the container log by specifying
the container log type.public static void readAContainerLogsForALogType(DataInputStream valueStream, PrintStream out, long logUploadedTime, long bytes) throws IOException
EOFException
for getting logs of
all types for a single container for the specific bytes.valueStream
- the value streamout
- the output print streamlogUploadedTime
- the log upload time stampbytes
- the output size of the logIOException
- if we can not read the container logpublic static void readAContainerLogsForALogType(DataInputStream valueStream, PrintStream out) throws IOException
EOFException
for getting logs of
all types for a single container.valueStream
- the value streamout
- the output print streamIOException
- if we can not read the container logpublic static int readContainerLogsForALogType(DataInputStream valueStream, PrintStream out, long logUploadedTime, List<String> logType) throws IOException
EOFException
for getting logs of
the specific types for a single container.valueStream
- the value streamout
- the output print streamlogUploadedTime
- the log uploaded time stamplogType
- the given log typeIOException
- if we can not read the container logspublic static int readContainerLogsForALogType(DataInputStream valueStream, PrintStream out, long logUploadedTime, List<String> logType, long bytes) throws IOException
EOFException
for getting logs of
the specific types for a single container.valueStream
- the value streamout
- the output print streamlogUploadedTime
- the log uploaded time stamplogType
- the given log typebytes
- log bytes.IOException
- if we can not read the container logs@InterfaceAudience.Private public static org.apache.commons.math3.util.Pair<String,String> readContainerMetaDataAndSkipData(DataInputStream valueStream) throws IOException
IOException
public void close()
close
in interface AutoCloseable
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.