Class YarnServerSecurityUtils
java.lang.Object
org.apache.hadoop.yarn.server.utils.YarnServerSecurityUtils
Utility class that contains commonly used server methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hadoop.yarn.security.AMRMTokenIdentifierAuthorizes the current request and returns the AMRMTokenIdentifier for the current application.static org.apache.hadoop.security.CredentialsparseCredentials(org.apache.hadoop.yarn.api.records.ContainerLaunchContext launchContext) Parses the container launch context and returns a Credential instance that contains all the tokens from the launch context.static voidupdateAMRMToken(org.apache.hadoop.yarn.api.records.Token token, org.apache.hadoop.security.UserGroupInformation user, org.apache.hadoop.conf.Configuration conf) Update the new AMRMToken into the ugi used for RM proxy.
-
Method Details
-
authorizeRequest
public static org.apache.hadoop.yarn.security.AMRMTokenIdentifier authorizeRequest() throws org.apache.hadoop.yarn.exceptions.YarnExceptionAuthorizes the current request and returns the AMRMTokenIdentifier for the current application.- Returns:
- the AMRMTokenIdentifier instance for the current user
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- exceptions from yarn servers.
-
updateAMRMToken
public static void updateAMRMToken(org.apache.hadoop.yarn.api.records.Token token, org.apache.hadoop.security.UserGroupInformation user, org.apache.hadoop.conf.Configuration conf) Update the new AMRMToken into the ugi used for RM proxy.- Parameters:
token- the new AMRMToken sent by RMuser- ugi used for RM proxyconf- configuration
-
parseCredentials
public static org.apache.hadoop.security.Credentials parseCredentials(org.apache.hadoop.yarn.api.records.ContainerLaunchContext launchContext) throws IOException Parses the container launch context and returns a Credential instance that contains all the tokens from the launch context.- Parameters:
launchContext- ContainerLaunchContext.- Returns:
- the credential instance
- Throws:
IOException- if there are I/O errors.
-