Class PlacementConstraints.PlacementTargets

java.lang.Object
org.apache.hadoop.yarn.api.resource.PlacementConstraints.PlacementTargets
Enclosing class:
PlacementConstraints

public static class PlacementConstraints.PlacementTargets extends Object
Class with static methods for constructing target expressions to be used in placement constraints.
  • 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 attribute
      attributeValues - the set of values that the attribute should take values from
      Returns:
      the resulting expression on the node attribute
    • nodePartition

      public static PlacementConstraint.TargetExpression nodePartition(String... nodePartitions)
      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

      public static PlacementConstraint.TargetExpression allocationTag(String... allocationTags)
      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 is AllocationTagNamespaceType.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 tags
      allocationTags - allocation tags
      Returns:
      a target expression