Class PlacementConstraint
java.lang.Object
org.apache.hadoop.yarn.service.api.records.PlacementConstraint
- All Implemented Interfaces:
Serializable
Placement constraint details.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetName()getScope()getType()inthashCode()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.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.An optional name associated to this constraint.nodeAttributes(Map<String, List<String>> nodeAttributes) Node attributes are a set of key:value(s) pairs associated with nodes.nodePartitions(List<String> nodePartitions) Node partitions where the containers of this component can run.scope(PlacementScope scope) The scope of placement.voidsetMaxCardinality(Long maxCardinality) voidsetMinCardinality(Long minCardinality) voidvoidsetNodeAttributes(Map<String, List<String>> nodeAttributes) voidsetNodePartitions(List<String> nodePartitions) voidsetScope(PlacementScope scope) voidsetTargetTags(List<String> targetTags) voidsetType(PlacementType type) targetTags(List<String> targetTags) The name of the components that this component's placement policy is depending upon are added as target tags.toString()type(PlacementType type) The type of placement.
-
Constructor Details
-
PlacementConstraint
public PlacementConstraint()
-
-
Method Details
-
name
An optional name associated to this constraint. -
getName
-
setName
-
type
The type of placement. -
getType
-
setType
-
scope
The scope of placement. -
getScope
-
setScope
-
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
-
setTargetTags
-
nodeAttributes
Node attributes are a set of key:value(s) pairs associated with nodes. -
getNodeAttributes
-
setNodeAttributes
-
nodePartitions
Node partitions where the containers of this component can run. -
getNodePartitions
-
setNodePartitions
-
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
-
setMinCardinality
-
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
-
setMaxCardinality
-
equals
-
hashCode
public int hashCode() -
toString
-