PlacementConstraint (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.service.api.records, class: PlacementConstraint

Package org.apache.hadoop.yarn.service.api.records

# 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:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PlacementConstraint()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `Long`
  `getMaxCardinality()`
  `Long`
  `getMinCardinality()`
  `String`
  `getName()`
  `Map<String,List<String>>`
  `getNodeAttributes()`
  `List<String>`
  `getNodePartitions()`
  `PlacementScope`
  `getScope()`
  `List<String>`
  `getTargetTags()`
  `PlacementType`
  `getType()`
  `int`
  `hashCode()`
  `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.
  `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.
  `PlacementConstraint`
  `name(String name)`
  An optional name associated to this constraint.
  `PlacementConstraint`
  `nodeAttributes(Map<String,List<String>> nodeAttributes)`
  Node attributes are a set of key:value(s) pairs associated with nodes.
  `PlacementConstraint`
  `nodePartitions(List<String> nodePartitions)`
  Node partitions where the containers of this component can run.
  `PlacementConstraint`
  `scope(PlacementScope scope)`
  The scope of placement.
  `void`
  `setMaxCardinality(Long maxCardinality)`
  `void`
  `setMinCardinality(Long minCardinality)`
  `void`
  `setName(String name)`
  `void`
  `setNodeAttributes(Map<String,List<String>> nodeAttributes)`
  `void`
  `setNodePartitions(List<String> nodePartitions)`
  `void`
  `setScope(PlacementScope scope)`
  `void`
  `setTargetTags(List<String> targetTags)`
  `void`
  `setType(PlacementType type)`
  `PlacementConstraint`
  `targetTags(List<String> targetTags)`
  The name of the components that this component's placement policy is depending upon are added as target tags.
  `String`
  `toString()`
  `PlacementConstraint`
  `type(PlacementType type)`
  The type of placement.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## 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`