Package org.apache.hadoop.yarn.security
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 -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault 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 TypeMethodDescriptionbooleanlongorg.apache.hadoop.yarn.api.records.ContainerIdorg.apache.hadoop.yarn.server.api.ContainerTypeGet the ContainerType of container to allocate.longorg.apache.hadoop.yarn.api.records.ExecutionTypeGet the ExecutionType of container to allocatelongorg.apache.hadoop.io.TextgetKind()org.apache.hadoop.yarn.api.records.LogAggregationContextintGet the node-label-expression in the original ResourceRequest.org.apache.hadoop.yarn.api.records.Priorityorg.apache.hadoop.yarn.proto.YarnSecurityTokenProtos.ContainerTokenIdentifierProtogetProto()org.apache.hadoop.yarn.api.records.ResourcelongGet the RMIdentifier of RM in which containers are allocated.org.apache.hadoop.security.UserGroupInformationgetUser()intGet the Container versioninthashCode()voidreadFields(DataInput in) toString()voidwrite(DataOutput out) Methods inherited from class org.apache.hadoop.security.token.TokenIdentifier
getBytes, getTrackingId
-
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- appSubmittercontainerID- container IDcreationTime- creation timeexpiryTimeStamp- expiry timestamphostName- hostnamelogAggregationContext- log aggregation contextmasterKeyId- master key IDpriority- priorityr- resource needed by the containerrmIdentifier- 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- containerIDcontainerVersion- containerVersionhostName- hostNameappSubmitter- appSubmitterr- resourceexpiryTimeStamp- expiryTimeStampmasterKeyId- masterKeyIdrmIdentifier- rmIdentifierpriority- prioritycreationTime- creationTimelogAggregationContext- logAggregationContextnodeLabelExpression- nodeLabelExpressioncontainerType- containerTypeexecutionType- executionTypeallocationRequestId- 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- containerIDcontainerVersion- containerVersionhostName- hostNameappSubmitter- appSubmitterr- resourceexpiryTimeStamp- expiryTimeStampmasterKeyId- masterKeyIdrmIdentifier- rmIdentifierpriority- prioritycreationTime- creationTimelogAggregationContext- logAggregationContextnodeLabelExpression- nodeLabelExpressioncontainerType- containerTypeexecutionType- executionTypeallocationRequestId- allocationRequestIdallocationTags- 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
-
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
- Throws:
IOException
-
readFields
- Throws:
IOException
-
getKind
public org.apache.hadoop.io.Text getKind()- Specified by:
getKindin classorg.apache.hadoop.security.token.TokenIdentifier
-
getUser
public org.apache.hadoop.security.UserGroupInformation getUser()- Specified by:
getUserin classorg.apache.hadoop.security.token.TokenIdentifier
-
getVersion
public int getVersion()Get the Container version- Returns:
- container version
-
getNodeLabelExpression
Get the node-label-expression in the original ResourceRequest.- Returns:
- node label expression.
-
getAllcationTags
-
hashCode
public int hashCode() -
equals
-
toString
-