YARN-7718. DistributedShell failed to specify resource other than memory/vcores 
from container_resources. Contributed by Wangda Tan.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/783a01eb
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/783a01eb
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/783a01eb

Branch: refs/heads/YARN-6592
Commit: 783a01eb4a155044a54a30a636b86b3ab2b33044
Parents: b3290c4
Author: Sunil G <sun...@apache.org>
Authored: Tue Jan 9 16:39:33 2018 +0530
Committer: Sunil G <sun...@apache.org>
Committed: Tue Jan 9 16:39:33 2018 +0530

----------------------------------------------------------------------
 .../distributedshell/ApplicationMaster.java     | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/783a01eb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java
index 85496d0..b35a2c9 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java
@@ -1602,17 +1602,15 @@ public class ApplicationMaster {
 
     Resource resourceCapability =
         Resource.newInstance(containerMemory, containerVirtualCores);
-    if (resourceProfiles == null) {
-      containerMemory = containerMemory == -1 ? DEFAULT_CONTAINER_MEMORY :
-          containerMemory;
-      containerVirtualCores =
-          containerVirtualCores == -1 ? DEFAULT_CONTAINER_VCORES :
-              containerVirtualCores;
-      resourceCapability.setMemorySize(containerMemory);
-      resourceCapability.setVirtualCores(containerVirtualCores);
-      for (Map.Entry<String, Long> entry : containerResources.entrySet()) {
-        resourceCapability.setResourceValue(entry.getKey(), entry.getValue());
-      }
+    containerMemory =
+        containerMemory == -1 ? DEFAULT_CONTAINER_MEMORY : containerMemory;
+    containerVirtualCores = containerVirtualCores == -1 ?
+        DEFAULT_CONTAINER_VCORES :
+        containerVirtualCores;
+    resourceCapability.setMemorySize(containerMemory);
+    resourceCapability.setVirtualCores(containerVirtualCores);
+    for (Map.Entry<String, Long> entry : containerResources.entrySet()) {
+      resourceCapability.setResourceValue(entry.getKey(), entry.getValue());
     }
 
     String profileName = containerResourceProfile;


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to