hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject svn commit: r1443796 - in /hadoop/common/trunk/hadoop-yarn-project: ./ hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ hadoop-yarn/hadoop-yarn-server/hadoop...
Date Thu, 07 Feb 2013 23:53:49 GMT
Author: szetszwo
Date: Thu Feb  7 23:53:49 2013
New Revision: 1443796

URL: http://svn.apache.org/r1443796
Log:
YARN-377. Use the new StringUtils methods added by HADOOP-9252 and fix TestContainersMonitor.
 Contributed by Chris Nauroth

Modified:
    hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt
    hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java
    hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainersMonitor.java

Modified: hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt?rev=1443796&r1=1443795&r2=1443796&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt Thu Feb  7 23:53:49 2013
@@ -32,6 +32,9 @@ Release 2.0.4-beta - UNRELEASED
     YARN-385. Add missing fields - location and #containers to
     ResourceRequestPBImpl's toString(). (Sandy Ryza via sseth)
 
+    YARN-377. Use the new StringUtils methods added by HADOOP-9252 and fix
+    TestContainersMonitor.  (Chris Nauroth via szetszwo)
+
 Release 2.0.3-alpha - 2013-02-06 
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java?rev=1443796&r1=1443795&r2=1443796&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java
(original)
+++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java
Thu Feb  7 23:53:49 2013
@@ -28,7 +28,7 @@ import java.util.Map.Entry;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.util.StringUtils;
+import org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
 import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.event.AsyncDispatcher;
@@ -125,10 +125,10 @@ public class ContainersMonitorImpl exten
         this.maxPmemAllottedForContainers >
         totalPhysicalMemoryOnNM * 0.80f) {
       LOG.warn("NodeManager configured with " +
-          StringUtils.humanReadableInt(maxPmemAllottedForContainers) +
+          TraditionalBinaryPrefix.long2String(maxPmemAllottedForContainers, "", 1) +
           " physical memory allocated to containers, which is more than " +
           "80% of the total physical memory available (" +
-          StringUtils.humanReadableInt(totalPhysicalMemoryOnNM) +
+          TraditionalBinaryPrefix.long2String(totalPhysicalMemoryOnNM, "", 1) +
           "). Thrashing might happen.");
     }
 
@@ -493,12 +493,12 @@ public class ContainersMonitorImpl exten
 
     private String formatUsageString(long currentVmemUsage, long vmemLimit,
         long currentPmemUsage, long pmemLimit) {
-      return String.format("%sb of %sb physical memory used; " +
-          "%sb of %sb virtual memory used",
-          StringUtils.humanReadableInt(currentPmemUsage),
-          StringUtils.humanReadableInt(pmemLimit),
-          StringUtils.humanReadableInt(currentVmemUsage),
-          StringUtils.humanReadableInt(vmemLimit));
+      return String.format("%sB of %sB physical memory used; " +
+          "%sB of %sB virtual memory used",
+          TraditionalBinaryPrefix.long2String(currentPmemUsage, "", 1),
+          TraditionalBinaryPrefix.long2String(pmemLimit, "", 1),
+          TraditionalBinaryPrefix.long2String(currentVmemUsage, "", 1),
+          TraditionalBinaryPrefix.long2String(vmemLimit, "", 1));
     }
   }
 

Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainersMonitor.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainersMonitor.java?rev=1443796&r1=1443795&r2=1443796&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainersMonitor.java
(original)
+++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainersMonitor.java
Thu Feb  7 23:53:49 2013
@@ -267,8 +267,8 @@ public class TestContainersMonitor exten
     String expectedMsgPattern =
         "Container \\[pid=" + pid + ",containerID=" + cId
             + "\\] is running beyond virtual memory limits. Current usage: "
-            + "[0-9.]+m?b of [0-9.]+m?b physical memory used; "
-            + "[0-9.]+m?b of [0-9.]+m?b virtual memory used. "
+            + "[0-9.]+ ?[KMGTPE]?B of [0-9.]+ ?[KMGTPE]?B physical memory used; "
+            + "[0-9.]+ ?[KMGTPE]?B of [0-9.]+ ?[KMGTPE]?B virtual memory used. "
             + "Killing container.\nDump of the process-tree for "
             + cId + " :\n";
     Pattern pat = Pattern.compile(expectedMsgPattern);



Mime
View raw message