Class LogWebService
java.lang.Object
org.apache.hadoop.yarn.server.webapp.LogWebService
- All Implemented Interfaces:
AppInfoProvider
@Singleton
@Path("/ws/v2/applicationlog")
public class LogWebService
extends Object
implements AppInfoProvider
Support only ATSv2 client only.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.yarn.server.webapp.BasicAppInfoReturnsBasicAppInfoobject that wraps the collected information about the application.javax.ws.rs.core.ResponsegetContainerLogFile(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String containerIdStr, String filename, String format, String size, String nmId, boolean redirectedFromNode, String clusterId, boolean manualRedirection) Returns the contents of a container's log file in plain text.javax.ws.rs.core.ResponsegetContainerLogsInfo(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String containerIdStr, String nmId, boolean redirectedFromNode, String clusterId, boolean manualRedirection) Returns log file's name as well as current file size for a container.protected org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntityjavax.ws.rs.core.ResponsegetLogs(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String containerIdStr, String filename, String format, String size, String nmId, boolean redirectedFromNode, String clusterId, boolean manualRedirection) getNodeHttpAddress(javax.servlet.http.HttpServletRequest req, String appId, String appAttemptId, String containerId, String clusterId) Returns the node HTTP address.
-
Constructor Details
-
LogWebService
public LogWebService()
-
-
Method Details
-
getContainerLogsInfo
@GET @Path("/containers/{containerid}/logs") @Produces({"application/json","application/xml"}) public javax.ws.rs.core.Response getContainerLogsInfo(@Context javax.servlet.http.HttpServletRequest req, @Context javax.servlet.http.HttpServletResponse res, @PathParam("containerid") String containerIdStr, @QueryParam("nm.id") String nmId, @QueryParam("redirected_from_node") @DefaultValue("false") boolean redirectedFromNode, @QueryParam("clusterid") String clusterId, @QueryParam("manual_redirection") @DefaultValue("false") boolean manualRedirection) Returns log file's name as well as current file size for a container.- Parameters:
req- HttpServletRequestres- HttpServletResponsecontainerIdStr- The container IDnmId- The Node Manager NodeIdredirectedFromNode- Whether this is a redirected request from NMclusterId- clusterId the id of the clustermanualRedirection- whether to return a response with a Location instead of an automatic redirection- Returns:
- The log file's name and current file size
-
getNodeHttpAddress
public String getNodeHttpAddress(javax.servlet.http.HttpServletRequest req, String appId, String appAttemptId, String containerId, String clusterId) Description copied from interface:AppInfoProviderReturns the node HTTP address.- Specified by:
getNodeHttpAddressin interfaceAppInfoProvider- Parameters:
req-HttpServletRequestassociated with the requestappId- the id of the applicationappAttemptId- the id of the application attemptcontainerId- the container idclusterId- the id of the cluster- Returns:
- the node HTTP address
-
getApp
public org.apache.hadoop.yarn.server.webapp.BasicAppInfo getApp(javax.servlet.http.HttpServletRequest req, String appId, String clusterId) Description copied from interface:AppInfoProviderReturnsBasicAppInfoobject that wraps the collected information about the application.- Specified by:
getAppin interfaceAppInfoProvider- Parameters:
req-HttpServletRequestassociated with the requestappId- the id of the applicationclusterId- the id of the cluster- Returns:
BasicAppInfoobject
-
getContainerLogFile
@GET @Path("/containers/{containerid}/logs/{filename}") @Produces("text/plain") @Public @Unstable public javax.ws.rs.core.Response getContainerLogFile(@Context javax.servlet.http.HttpServletRequest req, @Context javax.servlet.http.HttpServletResponse res, @PathParam("containerid") String containerIdStr, @PathParam("filename") String filename, @QueryParam("format") String format, @QueryParam("size") String size, @QueryParam("nm.id") String nmId, @QueryParam("redirected_from_node") boolean redirectedFromNode, @QueryParam("clusterid") String clusterId, @QueryParam("manual_redirection") @DefaultValue("false") boolean manualRedirection) Returns the contents of a container's log file in plain text.- Parameters:
req- HttpServletRequestres- HttpServletResponsecontainerIdStr- The container IDfilename- The name of the log fileformat- The content typesize- the size of the log filenmId- The Node Manager NodeIdredirectedFromNode- Whether this is the redirect request from NMclusterId- the id of the clustermanualRedirection- whether to return a response with a Location instead of an automatic redirection- Returns:
- The contents of the container's log file
-
getLogs
@GET @Path("/containerlogs/{containerid}/{filename}") @Produces("text/plain; charset=utf-8") @Public @Unstable public javax.ws.rs.core.Response getLogs(@Context javax.servlet.http.HttpServletRequest req, @Context javax.servlet.http.HttpServletResponse res, @PathParam("containerid") String containerIdStr, @PathParam("filename") String filename, @QueryParam("format") String format, @QueryParam("size") String size, @QueryParam("nm.id") String nmId, @QueryParam("redirected_from_node") @DefaultValue("false") boolean redirectedFromNode, @QueryParam("clusterid") String clusterId, @QueryParam("manual_redirection") @DefaultValue("false") boolean manualRedirection) -
getEntity
@VisibleForTesting protected org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity getEntity(String path, javax.ws.rs.core.MultivaluedMap<String, String> params) throws IOException- Throws:
IOException
-