Class LogServlet
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.yarn.server.webapp.LogServlet
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
public class LogServlet
extends org.apache.hadoop.conf.Configured
Extracts aggregated logs and related information.
Used by various WebServices (AHS, ATS).
-
Constructor Summary
ConstructorsConstructorDescriptionLogServlet(org.apache.hadoop.conf.Configuration conf, AppInfoProvider appInfoProvider) -
Method Summary
Modifier and TypeMethodDescriptioncreateRequestFromContainerId(String containerIdStr) javax.ws.rs.core.ResponsegetContainerLogsInfo(javax.servlet.http.HttpServletRequest req, org.apache.hadoop.yarn.logaggregation.ExtendedLogMetaRequest.ExtendedLogMetaRequestBuilder logsRequest) javax.ws.rs.core.ResponsegetContainerLogsInfo(javax.servlet.http.HttpServletRequest req, WrappedLogMetaRequest.Builder builder, String nmId, boolean redirectedFromNode, String clusterId, boolean manualRedirection) Returns information about the logs for a specific container.javax.ws.rs.core.ResponsegetLogFile(javax.servlet.http.HttpServletRequest req, String containerIdStr, String filename, String format, String size, String nmId, boolean redirectedFromNode, String clusterId, boolean manualRedirection) Returns an aggregated log file belonging to a container.javax.ws.rs.core.ResponsegetLogsInfo(javax.servlet.http.HttpServletRequest hsr, String appIdStr, String appAttemptIdStr, String containerIdStr, String nmId, boolean redirectedFromNode, boolean manualRedirection) getNMWebAddressFromRM(String nodeId) javax.ws.rs.core.ResponsegetRemoteLogDirPath(String user, String applicationId) Returns the user qualified path name of the remote log directory for each pre-configured log aggregation file controller.Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
-
Constructor Details
-
LogServlet
-
-
Method Details
-
getNMWebAddressFromRM
@VisibleForTesting public String getNMWebAddressFromRM(String nodeId) throws org.codehaus.jettison.json.JSONException - Throws:
org.codehaus.jettison.json.JSONException
-
getRemoteLogDirPath
public javax.ws.rs.core.Response getRemoteLogDirPath(String user, String applicationId) throws IOException Returns the user qualified path name of the remote log directory for each pre-configured log aggregation file controller.- Parameters:
user- remoteUser.applicationId- applicationId.- Returns:
Responseobject containing remote log dir path names- Throws:
IOException- if there are I/O errors.
-
getLogsInfo
-
getContainerLogsInfo
public javax.ws.rs.core.Response getContainerLogsInfo(javax.servlet.http.HttpServletRequest req, org.apache.hadoop.yarn.logaggregation.ExtendedLogMetaRequest.ExtendedLogMetaRequestBuilder logsRequest) throws IOException - Throws:
IOException
-
getContainerLogsInfo
public javax.ws.rs.core.Response getContainerLogsInfo(javax.servlet.http.HttpServletRequest req, WrappedLogMetaRequest.Builder builder, String nmId, boolean redirectedFromNode, String clusterId, boolean manualRedirection) Returns information about the logs for a specific container.- Parameters:
req- theHttpServletRequestbuilder- builder instance for the log meta requestnmId- NodeManager idredirectedFromNode- whether the request was redirectedclusterId- the id of the clustermanualRedirection- whether to return a response with a Location instead of an automatic redirection- Returns:
Responseobject containing information about the logs
-
getLogFile
public javax.ws.rs.core.Response getLogFile(javax.servlet.http.HttpServletRequest req, String containerIdStr, String filename, String format, String size, String nmId, boolean redirectedFromNode, String clusterId, boolean manualRedirection) Returns an aggregated log file belonging to a container.- Parameters:
req- theHttpServletRequestcontainerIdStr- container idfilename- the name of the fileformat- the format of the responsesize- the size of bytes of the log file that should be returnednmId- NodeManager idredirectedFromNode- whether the request was redirectedclusterId- the id of the clustermanualRedirection- whether to return a response with a Location instead of an automatic redirection- Returns:
Responseobject containing information about the logs
-
createRequestFromContainerId
-