YARN-9468:Fix inaccurate documentations in Placement Constraints

This commit is contained in:
hunshenshi 2019-04-10 15:13:29 +08:00
parent 25c421bcc0
commit afdc1d1e3a

View File

@ -65,7 +65,7 @@ $ yarn org.apache.hadoop.yarn.applications.distributedshell.Client -jar share/ha
where **PlacementSpec** is of the form:
```
PlacementSpec => "" | PlacementExpr;PlacementSpec
PlacementSpec => "" | PlacementExpr:PlacementSpec
PlacementExpr => SourceTag,ConstraintExpr
SourceTag => String(NumContainers)
ConstraintExpr => SingleConstraint | CompositeConstraint
@ -92,7 +92,7 @@ zk(3),NOTIN,NODE,zk:hbase(5),IN,RACK,zk:spark(7),CARDINALITY,NODE,hbase,1,3
The above encodes three constraints:
* place 3 containers with tag "zk" (standing for ZooKeeper) with node anti-affinity to each other, i.e., do not place more than one container per node (notice that in this first constraint, the SourceTag and the TargetTag of the constraint coincide);
* place 5 containers with tag "hbase" with affinity to a rack on which containers with tag "zk" are running (i.e., an "hbase" container should not be placed at a rack where an "zk" container is running, given that "zk" is the TargetTag of the second constraint);
* place 5 containers with tag "hbase" with affinity to a rack on which containers with tag "zk" are running (i.e., an "hbase" container should be placed at a rack where an "zk" container is running, given that "zk" is the TargetTag of the second constraint);
* place 7 containers with tag "spark" in nodes that have at least one, but no more than three, containers with tag "hbase".
Another example below demonstrates a composite form of constraint: