org.apache.hadoop.yarn.logaggregation

## Class AggregatedLogFormat.LogReader

- java.lang.Object
- - org.apache.hadoop.yarn.logaggregation.AggregatedLogFormat.LogReader

- Enclosing class:
    AggregatedLogFormat

      @InterfaceAudience.Public
       @InterfaceStability.Evolving
      public static class AggregatedLogFormat.LogReader
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LogReader(Configuration conf, Path remoteAppLogFile)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `Map<ApplicationAccessType,String>` | `getApplicationAcls()` Returns ACLs for the application.
    `String` | `getApplicationOwner()` Returns the owner of the application.
    `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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LogReader

          public LogReader(Configuration conf,
                           Path remoteAppLogFile)
                    throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### getApplicationOwner

          public String getApplicationOwner()
                                     throws IOException

      Returns the owner of the application.
      Returns:
        the application owner.
      Throws:
        `IOException` - if we can not get the application owner.

    - #### getApplicationAcls

          public Map<ApplicationAccessType,String> getApplicationAcls()
                                                               throws IOException

      Returns ACLs for the application. An empty map is returned if no ACLs are found.
      Returns:
        a map of the Application ACLs.
      Throws:
        `IOException` - if we can not get the application acls.

    - #### next

          public DataInputStream next(AggregatedLogFormat.LogKey key)
                               throws IOException

      Read the next key and return the value-stream.
      Parameters:
        `key` - the log key
      Returns:
        the valueStream if there are more keys or null otherwise
      Throws:
        `IOException` - if we can not get the dataInputStream for the next key

    - #### readAcontainerLogs

          public static void readAcontainerLogs(DataInputStream valueStream,
                                                Writer writer,
                                                long logUploadedTime)
                                         throws IOException

      Writes all logs for a single container to the provided writer.
      Parameters:
        `valueStream` - the valueStream
        `writer` - the log writer
        `logUploadedTime` - the time stamp
      Throws:
        `IOException` - if we can not read the container logs.

    - #### readAcontainerLogs

          public static void readAcontainerLogs(DataInputStream valueStream,
                                                Writer writer)
                                         throws IOException

      Writes all logs for a single container to the provided writer.
      Parameters:
        `valueStream` - the value stream
        `writer` - the log writer
      Throws:
        `IOException` - if we can not read the container logs.

    - #### readAContainerLogsForALogType

          public static void readAContainerLogsForALogType(DataInputStream valueStream,
                                                           PrintStream out,
                                                           long logUploadedTime)
                                                    throws IOException

      Keep calling this till you get a `EOFException` for getting logs of all types for a single container.
      Parameters:
        `valueStream` - the value stream
        `out` - the print stream
        `logUploadedTime` - the time stamp
      Throws:
        `IOException` - if we can not read the container log by specifying the container log type.

    - #### readAContainerLogsForALogType

          public static void readAContainerLogsForALogType(DataInputStream valueStream,
                                                           PrintStream out,
                                                           long logUploadedTime,
                                                           long bytes)
                                                    throws IOException

      Keep calling this till you get a `EOFException` for getting logs of all types for a single container for the specific bytes.
      Parameters:
        `valueStream` - the value stream
        `out` - the output print stream
        `logUploadedTime` - the log upload time stamp
        `bytes` - the output size of the log
      Throws:
        `IOException` - if we can not read the container log

    - #### readAContainerLogsForALogType

          public static void readAContainerLogsForALogType(DataInputStream valueStream,
                                                           PrintStream out)
                                                    throws IOException

      Keep calling this till you get a `EOFException` for getting logs of all types for a single container.
      Parameters:
        `valueStream` - the value stream
        `out` - the output print stream
      Throws:
        `IOException` - if we can not read the container log

    - #### readContainerLogsForALogType

          public static int readContainerLogsForALogType(DataInputStream valueStream,
                                                         PrintStream out,
                                                         long logUploadedTime,
                                                         List<String> logType)
                                                  throws IOException

      Keep calling this till you get a `EOFException` for getting logs of the specific types for a single container.
      Parameters:
        `valueStream` - the value stream
        `out` - the output print stream
        `logUploadedTime` - the log uploaded time stamp
        `logType` - the given log type
      Throws:
        `IOException` - if we can not read the container logs

    - #### readContainerLogsForALogType

          public static int readContainerLogsForALogType(DataInputStream valueStream,
                                                         PrintStream out,
                                                         long logUploadedTime,
                                                         List<String> logType,
                                                         long bytes)
                                                  throws IOException

      Keep calling this till you get a `EOFException` for getting logs of the specific types for a single container.
      Parameters:
        `valueStream` - the value stream
        `out` - the output print stream
        `logUploadedTime` - the log uploaded time stamp
        `logType` - the given log type
      Throws:
        `IOException` - if we can not read the container logs

    - #### close

          public void close()

Copyright © 2022 Apache Software Foundation. All rights reserved.