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:
Writable
TokenIdentifier for a container. Encodes
ContainerId,
Resource needed by the container and the target NMs host-address.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classorg.apache.hadoop.yarn.security.ContainerTokenIdentifier.Renewer -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor needed by RPC layer/SecretManager.ContainerTokenIdentifier(ContainerId containerID, int containerVersion, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, ExecutionType executionType) ContainerTokenIdentifier(ContainerId containerID, int containerVersion, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, ExecutionType executionType, long allocationRequestId) Convenience Constructor for existing clients.ContainerTokenIdentifier(ContainerId containerID, int containerVersion, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, ExecutionType executionType, long allocationRequestId, Set<String> allocationTags) Create a Container Token Identifier.ContainerTokenIdentifier(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime) ContainerTokenIdentifier(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext) Deprecated.Use one of the other constructors instead.ContainerTokenIdentifier(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression) ContainerTokenIdentifier(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType) -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongorg.apache.hadoop.yarn.server.api.ContainerTypeGet the ContainerType of container to allocate.longGet the ExecutionType of container to allocatelonggetKind()Get the token kindintGet the node-label-expression in the original ResourceRequest.org.apache.hadoop.yarn.proto.YarnSecurityTokenProtos.ContainerTokenIdentifierProtogetProto()longGet the RMIdentifier of RM in which containers are allocated.getUser()Get the Ugi with the username encoded in the token identifierintGet the Container versioninthashCode()voidreadFields(DataInput in) Deserialize the fields of this object fromin.toString()voidwrite(DataOutput out) Serialize the fields of this object toout.Methods inherited from class org.apache.hadoop.security.token.TokenIdentifier
getBytes, getTrackingId
-
Field Details
-
KIND
-
-
Constructor Details
-
ContainerTokenIdentifier
public ContainerTokenIdentifier(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime) -
ContainerTokenIdentifier
@Deprecated public ContainerTokenIdentifier(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, 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(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression) -
ContainerTokenIdentifier
public ContainerTokenIdentifier(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType) -
ContainerTokenIdentifier
public ContainerTokenIdentifier(ContainerId containerID, int containerVersion, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, ExecutionType executionType) -
ContainerTokenIdentifier
public ContainerTokenIdentifier(ContainerId containerID, int containerVersion, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, 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(ContainerId containerID, int containerVersion, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression, org.apache.hadoop.yarn.server.api.ContainerType containerType, 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
-
getApplicationSubmitter
-
getNmHostAddress
-
getResource
-
getExpiryTimeStamp
public long getExpiryTimeStamp() -
getMasterKeyId
public int getMasterKeyId() -
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
Get the ExecutionType of container to allocate- Returns:
- ExecutionType
-
getProto
public org.apache.hadoop.yarn.proto.YarnSecurityTokenProtos.ContainerTokenIdentifierProto getProto() -
getLogAggregationContext
-
getAllocationRequestId
public long getAllocationRequestId() -
write
Description copied from interface:WritableSerialize the fields of this object toout.- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
readFields
Description copied from interface:WritableDeserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- any other problem for readFields.
-
getKind
Description copied from class:TokenIdentifierGet the token kind- Specified by:
getKindin classTokenIdentifier- Returns:
- the kind of the token
-
getUser
Description copied from class:TokenIdentifierGet the Ugi with the username encoded in the token identifier- Specified by:
getUserin classTokenIdentifier- Returns:
- the username. null is returned if username in the identifier is empty or null.
-
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
-