Class PlacementConstraints.PlacementTargets
java.lang.Object
org.apache.hadoop.yarn.api.resource.PlacementConstraints.PlacementTargets
- Enclosing class:
- PlacementConstraints
Class with static methods for constructing target expressions to be used in
placement constraints.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocationTag(String... allocationTags) Constructs a target expression on an allocation tag.allocationTagWithNamespace(String namespace, String... allocationTags) Constructs a target expression on a set of allocation tags under a certain namespace.nodeAttribute(String attributeKey, String... attributeValues) Constructs a target expression on a node attribute.nodePartition(String... nodePartitions) Constructs a target expression on a node partition.
-
Constructor Details
-
PlacementTargets
public PlacementTargets()
-
-
Method Details
-
nodeAttribute
public static PlacementConstraint.TargetExpression nodeAttribute(String attributeKey, String... attributeValues) Constructs a target expression on a node attribute. It is satisfied if the specified node attribute has one of the specified values.- Parameters:
attributeKey- the name of the node attributeattributeValues- the set of values that the attribute should take values from- Returns:
- the resulting expression on the node attribute
-
nodePartition
Constructs a target expression on a node partition. It is satisfied if the specified node partition has one of the specified nodePartitions.- Parameters:
nodePartitions- the set of values that the attribute should take values from- Returns:
- the resulting expression on the node attribute
-
allocationTag
Constructs a target expression on an allocation tag. It is satisfied if there are allocations with one of the given tags. The default namespace for these tags isAllocationTagNamespaceType.SELF, this only checks tags within the application.- Parameters:
allocationTags- the set of tags that the attribute should take values from- Returns:
- the resulting expression on the allocation tags
-
allocationTagWithNamespace
public static PlacementConstraint.TargetExpression allocationTagWithNamespace(String namespace, String... allocationTags) Constructs a target expression on a set of allocation tags under a certain namespace.- Parameters:
namespace- namespace of the allocation tagsallocationTags- allocation tags- Returns:
- a target expression
-