YARN-8225. YARN precommit build failing in TestPlacementConstraintTransformations. Contributed by Shane Kumpf.

(cherry picked from commit 2c95eb8111)
This commit is contained in:
Weiwei Yang 2018-04-28 17:37:37 +08:00
parent 9923fa2490
commit 36fc9a6939
1 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.resource;
import java.util.ListIterator; import java.util.ListIterator;
import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.yarn.api.records.AllocationTagNamespaceType;
import org.apache.hadoop.yarn.api.resource.PlacementConstraint.AbstractConstraint; import org.apache.hadoop.yarn.api.resource.PlacementConstraint.AbstractConstraint;
import org.apache.hadoop.yarn.api.resource.PlacementConstraint.And; import org.apache.hadoop.yarn.api.resource.PlacementConstraint.And;
import org.apache.hadoop.yarn.api.resource.PlacementConstraint.CardinalityConstraint; import org.apache.hadoop.yarn.api.resource.PlacementConstraint.CardinalityConstraint;
@ -162,7 +163,8 @@ public class PlacementConstraintTransformations {
public AbstractConstraint visit(CardinalityConstraint constraint) { public AbstractConstraint visit(CardinalityConstraint constraint) {
return new SingleConstraint(constraint.getScope(), return new SingleConstraint(constraint.getScope(),
constraint.getMinCardinality(), constraint.getMaxCardinality(), constraint.getMinCardinality(), constraint.getMaxCardinality(),
new TargetExpression(TargetExpression.TargetType.ALLOCATION_TAG, null, new TargetExpression(TargetExpression.TargetType.ALLOCATION_TAG,
AllocationTagNamespaceType.SELF.toString(),
constraint.getAllocationTags())); constraint.getAllocationTags()));
} }
} }