Class PlacementConstraint

java.lang.Object
org.apache.hadoop.yarn.service.api.records.PlacementConstraint
All Implemented Interfaces:
Serializable

@Public @Unstable public class PlacementConstraint extends Object implements Serializable
Placement constraint details.
See Also:
  • Constructor Details

    • PlacementConstraint

      public PlacementConstraint()
  • Method Details

    • name

      public PlacementConstraint name(String name)
      An optional name associated to this constraint.
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • type

      public PlacementConstraint type(PlacementType type)
      The type of placement.
    • getType

      public PlacementType getType()
    • setType

      public void setType(PlacementType type)
    • scope

      public PlacementConstraint scope(PlacementScope scope)
      The scope of placement.
    • getScope

      public PlacementScope getScope()
    • setScope

      public void setScope(PlacementScope scope)
    • targetTags

      public PlacementConstraint targetTags(List<String> targetTags)
      The name of the components that this component's placement policy is depending upon are added as target tags. So for affinity say, this component's containers are requesting to be placed on hosts where containers of the target tag component(s) are running on. Target tags can also contain the name of this component, in which case it implies that for anti-affinity say, no more than one container of this component can be placed on a host. Similarly, for cardinality, it would mean that containers of this component is requesting to be placed on hosts where at least minCardinality but no more than maxCardinality containers of the target tag component(s) are running.
    • getTargetTags

      public List<String> getTargetTags()
    • setTargetTags

      public void setTargetTags(List<String> targetTags)
    • nodeAttributes

      public PlacementConstraint nodeAttributes(Map<String,List<String>> nodeAttributes)
      Node attributes are a set of key:value(s) pairs associated with nodes.
    • getNodeAttributes

      public Map<String,List<String>> getNodeAttributes()
    • setNodeAttributes

      public void setNodeAttributes(Map<String,List<String>> nodeAttributes)
    • nodePartitions

      public PlacementConstraint nodePartitions(List<String> nodePartitions)
      Node partitions where the containers of this component can run.
    • getNodePartitions

      public List<String> getNodePartitions()
    • setNodePartitions

      public void setNodePartitions(List<String> nodePartitions)
    • minCardinality

      public PlacementConstraint minCardinality(Long minCardinality)
      When placement type is cardinality, the minimum number of containers of the depending component that a host should have, where containers of this component can be allocated on.
    • getMinCardinality

      public Long getMinCardinality()
    • setMinCardinality

      public void setMinCardinality(Long minCardinality)
    • maxCardinality

      public PlacementConstraint maxCardinality(Long maxCardinality)
      When placement type is cardinality, the maximum number of containers of the depending component that a host should have, where containers of this component can be allocated on.
    • getMaxCardinality

      public Long getMaxCardinality()
    • setMaxCardinality

      public void setMaxCardinality(Long maxCardinality)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object