hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject [02/41] hadoop git commit: YARN-4778. Support specifying resources for task containers in SLS. Contributed by Wangda Tan
Date Fri, 13 May 2016 18:00:39 GMT
YARN-4778. Support specifying resources for task containers in SLS. 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/996a210a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/996a210a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/996a210a

Branch: refs/heads/HDFS-1312
Commit: 996a210ab0131606639ba87fd5daab14bf05b35f
Parents: b9e5a32
Author: Jian He <jianhe@apache.org>
Authored: Mon May 9 14:49:10 2016 -0700
Committer: Jian He <jianhe@apache.org>
Committed: Mon May 9 14:49:41 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/yarn/sls/SLSRunner.java     | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/996a210a/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java
b/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java
index c792335..3be8ff1 100644
--- a/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java
+++ b/hadoop-tools/hadoop-sls/src/main/java/org/apache/hadoop/yarn/sls/SLSRunner.java
@@ -64,6 +64,7 @@ import org.apache.hadoop.yarn.sls.scheduler.SLSCapacityScheduler;
 import org.apache.hadoop.yarn.sls.scheduler.SchedulerWrapper;
 import org.apache.hadoop.yarn.sls.scheduler.TaskRunner;
 import org.apache.hadoop.yarn.sls.utils.SLSUtils;
+import org.apache.hadoop.yarn.util.resource.Resources;
 import org.apache.log4j.Logger;
 import org.codehaus.jackson.JsonFactory;
 import org.codehaus.jackson.map.ObjectMapper;
@@ -316,10 +317,25 @@ public class SLSRunner {
             long taskFinish = Long.parseLong(
                     jsonTask.get("container.end.ms").toString());
             long lifeTime = taskFinish - taskStart;
+
+            // Set memory and vcores from job trace file
+            Resource res = Resources.clone(containerResource);
+            if (jsonTask.containsKey("container.memory")) {
+              int containerMemory = Integer.parseInt(
+                  jsonTask.get("container.memory").toString());
+              res.setMemory(containerMemory);
+            }
+
+            if (jsonTask.containsKey("container.vcores")) {
+              int containerVCores = Integer.parseInt(
+                  jsonTask.get("container.vcores").toString());
+              res.setVirtualCores(containerVCores);
+            }
+
             int priority = Integer.parseInt(
                     jsonTask.get("container.priority").toString());
             String type = jsonTask.get("container.type").toString();
-            containerList.add(new ContainerSimulator(containerResource,
+            containerList.add(new ContainerSimulator(res,
                     lifeTime, hostname, priority, type));
           }
 


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


Mime
View raw message