From 644afe5fd800ac4f2b873a99f9b3868c3a8c5c40 Mon Sep 17 00:00:00 2001 From: Arun Suresh Date: Wed, 24 Jan 2018 12:55:01 -0800 Subject: [PATCH] YARN-7807. Assume intra-app anti-affinity as default for scheduling request inside AppPlacementAllocator. (Wangda Tan via asuresh) --- .../placement/SingleConstraintAppPlacementAllocator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/SingleConstraintAppPlacementAllocator.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/SingleConstraintAppPlacementAllocator.java index 9e7d71cfaa..b02cb00312 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/SingleConstraintAppPlacementAllocator.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/placement/SingleConstraintAppPlacementAllocator.java @@ -334,14 +334,15 @@ private void validateAndSetSchedulingRequest(SchedulingRequest newSchedulingRequ targetAllocationTags = new HashSet<>( targetExpression.getTargetValues()); - if (targetExpression.getTargetKey() == null || !targetExpression + if (targetExpression.getTargetKey() != null && !targetExpression .getTargetKey().equals(APPLICATION_LABEL_INTRA_APPLICATION)) { throwExceptionWithMetaInfo( "As of now, the only accepted target key for targetKey of " + "allocation_tag target expression is: [" + APPLICATION_LABEL_INTRA_APPLICATION + "]. Please make changes to placement constraints " - + "accordingly."); + + "accordingly. If this is null, it will be set to " + + APPLICATION_LABEL_INTRA_APPLICATION + " by default."); } } }