Class YarnServerSecurityUtils

java.lang.Object
org.apache.hadoop.yarn.server.utils.YarnServerSecurityUtils

@Private public final class YarnServerSecurityUtils extends Object
Utility class that contains commonly used server methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.hadoop.yarn.security.AMRMTokenIdentifier
    Authorizes the current request and returns the AMRMTokenIdentifier for the current application.
    static org.apache.hadoop.security.Credentials
    parseCredentials(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 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • authorizeRequest

      public static org.apache.hadoop.yarn.security.AMRMTokenIdentifier authorizeRequest() throws org.apache.hadoop.yarn.exceptions.YarnException
      Authorizes 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 RM
      user - ugi used for RM proxy
      conf - 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.