hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1492366 - in /hadoop/common/branches/branch-2/hadoop-yarn-project: CHANGES.txt hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/util/CgroupsLCEResourcesHandler.java
Date Wed, 12 Jun 2013 19:00:01 GMT
Author: tucu
Date: Wed Jun 12 19:00:00 2013
New Revision: 1492366

URL: http://svn.apache.org/r1492366
Log:
YARN-600. Hook up cgroups CPU settings to the number of virtual cores allocated. (sandyr via
tucu)

Modified:
    hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/util/CgroupsLCEResourcesHandler.java

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt?rev=1492366&r1=1492365&r2=1492366&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/CHANGES.txt Wed Jun 12 19:00:00 2013
@@ -295,6 +295,9 @@ Release 2.1.0-beta - UNRELEASED
     YARN-731. RPCUtil.unwrapAndThrowException should unwrap remote
     RuntimeExceptions. (Zhijie Shen via sseth)
 
+    YARN-600. Hook up cgroups CPU settings to the number of virtual cores 
+    allocated. (sandyr via tucu)
+
   OPTIMIZATIONS
 
     YARN-512. Log aggregation root directory check is more expensive than it

Modified: hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/util/CgroupsLCEResourcesHandler.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/util/CgroupsLCEResourcesHandler.java?rev=1492366&r1=1492365&r2=1492366&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/util/CgroupsLCEResourcesHandler.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/util/CgroupsLCEResourcesHandler.java
Wed Jun 12 19:00:00 2013
@@ -172,18 +172,15 @@ public class CgroupsLCEResourcesHandler 
    * Next three functions operate on all the resources we are enforcing.
    */
 
-  /*
-   * TODO: After YARN-2 is committed, we should call containerResource.getCpus()
-   * (or equivalent) to multiply the weight by the number of requested cpus.
-   */
   private void setupLimits(ContainerId containerId,
                            Resource containerResource) throws IOException {
     String containerName = containerId.toString();
 
     if (isCpuWeightEnabled()) {
       createCgroup(CONTROLLER_CPU, containerName);
+      int cpuShares = CPU_DEFAULT_WEIGHT * containerResource.getVirtualCores();
       updateCgroup(CONTROLLER_CPU, containerName, "shares",
-          String.valueOf(CPU_DEFAULT_WEIGHT));
+          String.valueOf(cpuShares));
     }
   }
 



Mime
View raw message