org.apache.hadoop.yarn.server.nodemanager.webapp
Class ContainerLogsUtils

java.lang.Object
  extended by 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 Summary
static org.slf4j.Logger LOG
           
 
Constructor Summary
ContainerLogsUtils()
           
 
Method Summary
static List<File> getContainerLogDirs(org.apache.hadoop.yarn.api.records.ContainerId containerId, String remoteUser, Context context)
          Finds the local directories that logs for the given container are stored on.
static File getContainerLogFile(org.apache.hadoop.yarn.api.records.ContainerId containerId, String fileName, String remoteUser, Context context)
          Finds the log file with the given filename for the given container.
static FileInputStream openLogFileForRead(String containerIdStr, File logFile, Context context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.slf4j.Logger LOG
Constructor Detail

ContainerLogsUtils

public ContainerLogsUtils()
Method Detail

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


Copyright © 2014 Apache Software Foundation. All Rights Reserved.