org.apache.hadoop.yarn.server.webapp

## 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

    Constructors
    Constructor and Description
    `LogServlet(org.apache.hadoop.conf.Configuration conf, AppInfoProvider appInfoProvider)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static WrappedLogMetaRequest.Builder` | `createRequestFromContainerId(String containerIdStr)`
    `javax.ws.rs.core.Response` | `getContainerLogsInfo(javax.servlet.http.HttpServletRequest req, WrappedLogMetaRequest.Builder builder, String nmId, boolean redirectedFromNode, String clusterId)` Returns information about the logs for a specific container.
    `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)` Returns an aggregated log file belonging to a container.
    `javax.ws.rs.core.Response` | `getLogsInfo(javax.servlet.http.HttpServletRequest hsr, String appIdStr, String appAttemptIdStr, String containerIdStr, String nmId, boolean redirectedFromNode)`
    `String` | `getNMWebAddressFromRM(String nodeId)`

    - ### Methods inherited from class org.apache.hadoop.conf.Configured

      `getConf, setConf`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LogServlet

          public LogServlet(org.apache.hadoop.conf.Configuration conf,
                            AppInfoProvider appInfoProvider)

  - ### Method Detail

    - #### getNMWebAddressFromRM

          public String getNMWebAddressFromRM(String nodeId)
                                       throws com.sun.jersey.api.client.ClientHandlerException,
                                              com.sun.jersey.api.client.UniformInterfaceException,
                                              org.codehaus.jettison.json.JSONException

      Throws:
        `com.sun.jersey.api.client.ClientHandlerException`
        `com.sun.jersey.api.client.UniformInterfaceException`
        `org.codehaus.jettison.json.JSONException`

    - #### getLogsInfo

          public javax.ws.rs.core.Response getLogsInfo(javax.servlet.http.HttpServletRequest hsr,
                                                       String appIdStr,
                                                       String appAttemptIdStr,
                                                       String containerIdStr,
                                                       String nmId,
                                                       boolean redirectedFromNode)

    - #### getContainerLogsInfo

          public javax.ws.rs.core.Response getContainerLogsInfo(javax.servlet.http.HttpServletRequest req,
                                                                WrappedLogMetaRequest.Builder builder,
                                                                String nmId,
                                                                boolean redirectedFromNode,
                                                                String clusterId)

      Returns information about the logs for a specific container.
      Parameters:
        `req` - the `HttpServletRequest`
        `builder` - builder instance for the log meta request
        `nmId` - NodeManager id
        `redirectedFromNode` - whether the request was redirected
        `clusterId` - the id of the cluster
      Returns:
        `Response` object 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)

      Returns an aggregated log file belonging to a container.
      Parameters:
        `req` - the `HttpServletRequest`
        `containerIdStr` - container id
        `filename` - the name of the file
        `format` - the format of the response
        `size` - the size of bytes of the log file that should be returned
        `nmId` - NodeManager id
        `redirectedFromNode` - whether the request was redirected
        `clusterId` - the id of the cluster
      Returns:
        `Response` object containing information about the logs

    - #### createRequestFromContainerId

          public static WrappedLogMetaRequest.Builder createRequestFromContainerId(String containerIdStr)

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.