org.apache.hadoop.yarn.security
Class ContainerTokenIdentifier

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

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

TokenIdentifier for a container. Encodes ContainerId, Resource needed by the container and the target NMs host-address.


Field Summary
static Text KIND
           
 
Constructor Summary
ContainerTokenIdentifier()
          Default constructor needed by RPC layer/SecretManager.
ContainerTokenIdentifier(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime)
           
 
Method Summary
 String getApplicationSubmitter()
           
 ContainerId getContainerID()
           
 long getCreationTime()
           
 long getExpiryTimeStamp()
           
 Text getKind()
          Get the token kind
 int getMasterKeyId()
           
 String getNmHostAddress()
           
 Priority getPriority()
           
 Resource getResource()
           
 long getRMIdentifer()
          Get the RMIdentifier of RM in which containers are allocated
 org.apache.hadoop.security.UserGroupInformation getUser()
          Get the Ugi with the username encoded in the token identifier
 void readFields(DataInput in)
          Deserialize the fields of this object from in.
 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KIND

public static final Text KIND
Constructor Detail

ContainerTokenIdentifier

public ContainerTokenIdentifier(ContainerId containerID,
                                String hostName,
                                String appSubmitter,
                                Resource r,
                                long expiryTimeStamp,
                                int masterKeyId,
                                long rmIdentifier,
                                Priority priority,
                                long creationTime)

ContainerTokenIdentifier

public ContainerTokenIdentifier()
Default constructor needed by RPC layer/SecretManager.

Method Detail

getContainerID

public ContainerId getContainerID()

getApplicationSubmitter

public String getApplicationSubmitter()

getNmHostAddress

public String getNmHostAddress()

getResource

public Resource getResource()

getExpiryTimeStamp

public long getExpiryTimeStamp()

getMasterKeyId

public int getMasterKeyId()

getPriority

public Priority getPriority()

getCreationTime

public long getCreationTime()

getRMIdentifer

public long getRMIdentifer()
Get the RMIdentifier of RM in which containers are allocated

Returns:
RMIdentifier

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.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.