Class ContainerTokenIdentifier

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

@Public @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.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.hadoop.io.Text
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor needed by RPC layer/SecretManager.
    ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, int containerVersion, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, org.apache.hadoop.yarn.api.records.ExecutionType executionType)
     
    ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, int containerVersion, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, org.apache.hadoop.yarn.api.records.ExecutionType executionType, long allocationRequestId)
    Convenience Constructor for existing clients.
    ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, int containerVersion, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, org.apache.hadoop.yarn.api.records.ExecutionType executionType, long allocationRequestId, Set<String> allocationTags)
    Create a Container Token Identifier.
    ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime)
     
    ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext)
    Deprecated.
    Use one of the other constructors instead.
    ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext, String nodeLabelExpression)
     
    ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
     
     
    long
     
     
    org.apache.hadoop.yarn.api.records.ContainerId
     
    org.apache.hadoop.yarn.server.api.ContainerType
    Get the ContainerType of container to allocate.
    long
     
    org.apache.hadoop.yarn.api.records.ExecutionType
    Get the ExecutionType of container to allocate
    long
     
    org.apache.hadoop.io.Text
     
    org.apache.hadoop.yarn.api.records.LogAggregationContext
     
    int
     
     
    Get the node-label-expression in the original ResourceRequest.
    org.apache.hadoop.yarn.api.records.Priority
     
    org.apache.hadoop.yarn.proto.YarnSecurityTokenProtos.ContainerTokenIdentifierProto
     
    org.apache.hadoop.yarn.api.records.Resource
     
    long
    Get the RMIdentifier of RM in which containers are allocated.
    org.apache.hadoop.security.UserGroupInformation
     
    int
    Get the Container version
    int
     
    void
     
     
    void
     

    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 Details

    • KIND

      public static final org.apache.hadoop.io.Text KIND
  • Constructor Details

    • ContainerTokenIdentifier

      public ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime)
    • ContainerTokenIdentifier

      @Deprecated public ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext)
      Deprecated.
      Use one of the other constructors instead.
      Creates a instance.
      Parameters:
      appSubmitter - appSubmitter
      containerID - container ID
      creationTime - creation time
      expiryTimeStamp - expiry timestamp
      hostName - hostname
      logAggregationContext - log aggregation context
      masterKeyId - master key ID
      priority - priority
      r - resource needed by the container
      rmIdentifier - ResourceManager identifier
    • ContainerTokenIdentifier

      public ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext, String nodeLabelExpression)
    • ContainerTokenIdentifier

      public ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType)
    • ContainerTokenIdentifier

      public ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, int containerVersion, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, org.apache.hadoop.yarn.api.records.ExecutionType executionType)
    • ContainerTokenIdentifier

      public ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, int containerVersion, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, org.apache.hadoop.yarn.api.records.ExecutionType executionType, long allocationRequestId)
      Convenience Constructor for existing clients.
      Parameters:
      containerID - containerID
      containerVersion - containerVersion
      hostName - hostName
      appSubmitter - appSubmitter
      r - resource
      expiryTimeStamp - expiryTimeStamp
      masterKeyId - masterKeyId
      rmIdentifier - rmIdentifier
      priority - priority
      creationTime - creationTime
      logAggregationContext - logAggregationContext
      nodeLabelExpression - nodeLabelExpression
      containerType - containerType
      executionType - executionType
      allocationRequestId - allocationRequestId
    • ContainerTokenIdentifier

      public ContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.ContainerId containerID, int containerVersion, String hostName, String appSubmitter, org.apache.hadoop.yarn.api.records.Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, org.apache.hadoop.yarn.api.records.Priority priority, long creationTime, org.apache.hadoop.yarn.api.records.LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, org.apache.hadoop.yarn.api.records.ExecutionType executionType, long allocationRequestId, Set<String> allocationTags)
      Create a Container Token Identifier.
      Parameters:
      containerID - containerID
      containerVersion - containerVersion
      hostName - hostName
      appSubmitter - appSubmitter
      r - resource
      expiryTimeStamp - expiryTimeStamp
      masterKeyId - masterKeyId
      rmIdentifier - rmIdentifier
      priority - priority
      creationTime - creationTime
      logAggregationContext - logAggregationContext
      nodeLabelExpression - nodeLabelExpression
      containerType - containerType
      executionType - executionType
      allocationRequestId - allocationRequestId
      allocationTags - Set of allocation Tags.
    • ContainerTokenIdentifier

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

    • getContainerID

      public org.apache.hadoop.yarn.api.records.ContainerId getContainerID()
    • getApplicationSubmitter

      public String getApplicationSubmitter()
    • getNmHostAddress

      public String getNmHostAddress()
    • getResource

      public org.apache.hadoop.yarn.api.records.Resource getResource()
    • getExpiryTimeStamp

      public long getExpiryTimeStamp()
    • getMasterKeyId

      public int getMasterKeyId()
    • getPriority

      public org.apache.hadoop.yarn.api.records.Priority getPriority()
    • getCreationTime

      public long getCreationTime()
    • getRMIdentifier

      public long getRMIdentifier()
      Get the RMIdentifier of RM in which containers are allocated.
      Returns:
      RMIdentifier
    • getContainerType

      public org.apache.hadoop.yarn.server.api.ContainerType getContainerType()
      Get the ContainerType of container to allocate.
      Returns:
      ContainerType
    • getExecutionType

      public org.apache.hadoop.yarn.api.records.ExecutionType getExecutionType()
      Get the ExecutionType of container to allocate
      Returns:
      ExecutionType
    • getProto

      public org.apache.hadoop.yarn.proto.YarnSecurityTokenProtos.ContainerTokenIdentifierProto getProto()
    • getLogAggregationContext

      public org.apache.hadoop.yarn.api.records.LogAggregationContext getLogAggregationContext()
    • getAllocationRequestId

      public long getAllocationRequestId()
    • write

      public void write(DataOutput out) throws IOException
      Throws:
      IOException
    • readFields

      public void readFields(DataInput in) throws IOException
      Throws:
      IOException
    • getKind

      public org.apache.hadoop.io.Text getKind()
      Specified by:
      getKind in class org.apache.hadoop.security.token.TokenIdentifier
    • getUser

      public org.apache.hadoop.security.UserGroupInformation getUser()
      Specified by:
      getUser in class org.apache.hadoop.security.token.TokenIdentifier
    • getVersion

      public int getVersion()
      Get the Container version
      Returns:
      container version
    • getNodeLabelExpression

      public String getNodeLabelExpression()
      Get the node-label-expression in the original ResourceRequest.
      Returns:
      node label expression.
    • getAllcationTags

      public Set<String> getAllcationTags()
    • 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