java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebAppUtil

public final class RMWebAppUtil extends Object
Util class for ResourceManager WebApp.
  • Method Details

    • setupSecurityAndFilters

      public static void setupSecurityAndFilters(org.apache.hadoop.conf.Configuration conf, RMDelegationTokenSecretManager rmDTSecretManager)
      Helper method to setup filters and authentication for ResourceManager WebServices. Use the customized yarn filter instead of the standard kerberos filter to allow users to authenticate using delegation tokens 4 conditions need to be satisfied: 1. security is enabled. 2. http auth type is set to kerberos. 3. "yarn.resourcemanager.webapp.use-yarn-filter" override is set to true. 4. hadoop.http.filter.initializers container AuthenticationFilterInitializer.
      Parameters:
      conf - RM configuration.
      rmDTSecretManager - RM specific delegation token secret manager.
    • createAppSubmissionContext

      public static org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext createAppSubmissionContext(ApplicationSubmissionContextInfo newApp, org.apache.hadoop.conf.Configuration conf) throws IOException
      Create the actual ApplicationSubmissionContext to be submitted to the RM from the information provided by the user.
      Parameters:
      newApp - the information provided by the user
      conf - RM configuration
      Returns:
      returns the constructed ApplicationSubmissionContext
      Throws:
      IOException - in case of Error
    • getCallerUserGroupInformation

      public static org.apache.hadoop.security.UserGroupInformation getCallerUserGroupInformation(javax.servlet.http.HttpServletRequest hsr, boolean usePrincipal)
      Helper method to retrieve the UserGroupInformation from the HttpServletRequest.
      Parameters:
      hsr - the servlet request
      usePrincipal - true if we need to use the principal user, remote otherwise.
      Returns:
      the user group information of the caller.