Class ContainerLogsUtils
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.webapp.ContainerLogsUtils
Contains utilities for fetching a user's log file in a secure fashion.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContainerLogDirs(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 FilegetContainerLogFile(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 FileInputStreamopenLogFileForRead(String containerIdStr, File logFile, Context context)
-
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
-