org.apache.hadoop.yarn.security
Class AMRMTokenIdentifier

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

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class AMRMTokenIdentifier
extends org.apache.hadoop.security.token.TokenIdentifier

AMRMTokenIdentifier is the TokenIdentifier to be used by ApplicationMasters to authenticate to the ResourceManager.


Field Summary
static Text KIND_NAME
           
 
Constructor Summary
AMRMTokenIdentifier()
           
AMRMTokenIdentifier(ApplicationAttemptId appAttemptId, int masterKeyId)
           
 
Method Summary
 boolean equals(Object other)
           
 int getKeyId()
           
 Text getKind()
          Get the token kind
 org.apache.hadoop.yarn.proto.YarnSecurityTokenProtos.AMRMTokenIdentifierProto getProto()
           
 org.apache.hadoop.security.UserGroupInformation getUser()
          Get the Ugi with the username encoded in the token identifier
 int hashCode()
           
 void readFields(DataInput in)
          Deserialize the fields of this object from in.
 String toString()
           
 void write(DataOutput out)
          Serialize the fields of this object to out.
 
Methods inherited from class org.apache.hadoop.security.token.TokenIdentifier
getBytes, getTrackingId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KIND_NAME

public static final Text KIND_NAME
Constructor Detail

AMRMTokenIdentifier

public AMRMTokenIdentifier()

AMRMTokenIdentifier

public AMRMTokenIdentifier(ApplicationAttemptId appAttemptId,
                           int masterKeyId)
Method Detail

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

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

getKind

public Text getKind()
Description copied from class: org.apache.hadoop.security.token.TokenIdentifier
Get the token kind

Specified by:
getKind in class org.apache.hadoop.security.token.TokenIdentifier
Returns:
the kind of the token

getUser

public org.apache.hadoop.security.UserGroupInformation getUser()
Description copied from class: org.apache.hadoop.security.token.TokenIdentifier
Get the Ugi with the username encoded in the token identifier

Specified by:
getUser in class org.apache.hadoop.security.token.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


Copyright © 2014 Apache Software Foundation. All Rights Reserved.