Class ContainerLogsUtils

java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.webapp.ContainerLogsUtils

public class ContainerLogsUtils extends Object
Contains utilities for fetching a user's log file in a secure fashion.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

    • ContainerLogsUtils

      public ContainerLogsUtils()
  • Method Details

    • getContainerLogDirs

      public static List<File> getContainerLogDirs(org.apache.hadoop.yarn.api.records.ContainerId containerId, String remoteUser, Context context) throws org.apache.hadoop.yarn.exceptions.YarnException
      Finds the local directories that logs for the given container are stored on.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
    • getContainerLogFile

      public static File getContainerLogFile(org.apache.hadoop.yarn.api.records.ContainerId containerId, String fileName, String remoteUser, Context context) throws org.apache.hadoop.yarn.exceptions.YarnException
      Finds the log file with the given filename for the given container.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
    • openLogFileForRead

      public static FileInputStream openLogFileForRead(String containerIdStr, File logFile, Context context) throws IOException
      Throws:
      IOException