YARN-7807. Assume intra-app anti-affinity as default for scheduling request inside AppPlacementAllocator. (Wangda Tan via asuresh)

This commit is contained in:
Arun Suresh 2018-01-24 12:55:01 -08:00
parent a4c539fcdb
commit 644afe5fd8

View File

@ -334,14 +334,15 @@ private void validateAndSetSchedulingRequest(SchedulingRequest newSchedulingRequ
targetAllocationTags = new HashSet<>( targetAllocationTags = new HashSet<>(
targetExpression.getTargetValues()); targetExpression.getTargetValues());
if (targetExpression.getTargetKey() == null || !targetExpression if (targetExpression.getTargetKey() != null && !targetExpression
.getTargetKey().equals(APPLICATION_LABEL_INTRA_APPLICATION)) { .getTargetKey().equals(APPLICATION_LABEL_INTRA_APPLICATION)) {
throwExceptionWithMetaInfo( throwExceptionWithMetaInfo(
"As of now, the only accepted target key for targetKey of " "As of now, the only accepted target key for targetKey of "
+ "allocation_tag target expression is: [" + "allocation_tag target expression is: ["
+ APPLICATION_LABEL_INTRA_APPLICATION + APPLICATION_LABEL_INTRA_APPLICATION
+ "]. Please make changes to placement constraints " + "]. Please make changes to placement constraints "
+ "accordingly."); + "accordingly. If this is null, it will be set to "
+ APPLICATION_LABEL_INTRA_APPLICATION + " by default.");
} }
} }
} }