Class AMRMTokenIdentifier

java.lang.Object
org.apache.hadoop.security.token.TokenIdentifier
org.apache.hadoop.yarn.security.AMRMTokenIdentifier
All Implemented Interfaces:
Writable

@Public @Evolving public class AMRMTokenIdentifier extends TokenIdentifier
AMRMTokenIdentifier is the TokenIdentifier to be used by ApplicationMasters to authenticate to the ResourceManager.
  • Field Details

    • KIND_NAME

      public static final Text KIND_NAME
  • Constructor Details

    • AMRMTokenIdentifier

      public AMRMTokenIdentifier()
    • AMRMTokenIdentifier

      public AMRMTokenIdentifier(ApplicationAttemptId appAttemptId, int masterKeyId)
  • Method Details

    • getApplicationAttemptId

      @Private public ApplicationAttemptId getApplicationAttemptId()
    • write

      public void write(DataOutput out) throws IOException
      Description copied from interface: Writable
      Serialize the fields of this object to out.
      Parameters:
      out - DataOuput to serialize this object into.
      Throws:
      IOException - any other problem for write.
    • readFields

      public void readFields(DataInput in) throws IOException
      Description copied from interface: Writable
      Deserialize the fields of this object from in.

      For efficiency, implementations should attempt to re-use storage in the existing object where possible.

      Parameters:
      in - DataInput to deseriablize this object from.
      Throws:
      IOException - any other problem for readFields.
    • getKind

      public Text getKind()
      Description copied from class: TokenIdentifier
      Get the token kind
      Specified by:
      getKind in class TokenIdentifier
      Returns:
      the kind of the token
    • getUser

      public UserGroupInformation getUser()
      Description copied from class: TokenIdentifier
      Get the Ugi with the username encoded in the token identifier
      Specified by:
      getUser in class TokenIdentifier
      Returns:
      the username. null is returned if username in the identifier is empty or null.
    • getKeyId

      public int getKeyId()
    • getProto

      public org.apache.hadoop.yarn.proto.YarnSecurityTokenProtos.AMRMTokenIdentifierProto getProto()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object