Class RMWebAppUtil
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebAppUtil
Util class for ResourceManager WebApp.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hadoop.yarn.api.records.ApplicationSubmissionContextcreateAppSubmissionContext(ApplicationSubmissionContextInfo newApp, org.apache.hadoop.conf.Configuration conf) Create the actual ApplicationSubmissionContext to be submitted to the RM from the information provided by the user.static org.apache.hadoop.security.UserGroupInformationgetCallerUserGroupInformation(javax.servlet.http.HttpServletRequest hsr, boolean usePrincipal) Helper method to retrieve the UserGroupInformation from the HttpServletRequest.static voidsetupSecurityAndFilters(org.apache.hadoop.conf.Configuration conf, RMDelegationTokenSecretManager rmDTSecretManager) Helper method to setup filters and authentication for ResourceManager WebServices.
-
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 userconf- 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 requestusePrincipal- true if we need to use the principal user, remote otherwise.- Returns:
- the user group information of the caller.
-