hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From junping...@apache.org
Subject hadoop git commit: YARN-3296. Mark ResourceCalculatorProcessTree class as Public for configurable resource monitoring. Contributed by Hitesh Shah (cherry picked from commit 7ce3c7635392c32f0504191ddd8417fb20509caa)
Date Sun, 08 Mar 2015 21:33:49 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 b8a208795 -> b91e1b0fe


YARN-3296. Mark ResourceCalculatorProcessTree class as Public for configurable resource monitoring.
Contributed by Hitesh Shah
(cherry picked from commit 7ce3c7635392c32f0504191ddd8417fb20509caa)


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

Branch: refs/heads/branch-2
Commit: b91e1b0feb8f9f7913f5d9c09ad1b1cd8dcbeb49
Parents: b8a2087
Author: Junping Du <junping_du@apache.org>
Authored: Sun Mar 8 14:47:35 2015 -0700
Committer: Junping Du <junping_du@apache.org>
Committed: Sun Mar 8 14:48:42 2015 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                 |  3 +++
 .../util/ResourceCalculatorProcessTree.java     | 25 ++++++++++++++------
 2 files changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/b91e1b0f/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index d565db5..05c48d4 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -324,6 +324,9 @@ Release 2.7.0 - UNRELEASED
     YARN-2190. Added CPU and memory limit options to the default container
     executor for Windows containers. (Chuan Liu via jianhe)
 
+    YARN-3296. Mark ResourceCalculatorProcessTree class as Public for configurable
+    resource monitoring. (Hitesh Shah via junping_du)
+
   OPTIMIZATIONS
 
     YARN-2990. FairScheduler's delay-scheduling always waits for node-local and 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/b91e1b0f/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ResourceCalculatorProcessTree.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ResourceCalculatorProcessTree.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ResourceCalculatorProcessTree.java
index 8c22c9e..6ee8834 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ResourceCalculatorProcessTree.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ResourceCalculatorProcessTree.java
@@ -22,7 +22,8 @@ import java.lang.reflect.Constructor;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.classification.InterfaceAudience.Private;
+import org.apache.hadoop.classification.InterfaceAudience.Public;
+import org.apache.hadoop.classification.InterfaceStability.Evolving;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.conf.Configured;
 
@@ -30,7 +31,8 @@ import org.apache.hadoop.conf.Configured;
  * Interface class to obtain process resource usage
  *
  */
-@Private
+@Public
+@Evolving
 public abstract class ResourceCalculatorProcessTree extends Configured {
   static final Log LOG = LogFactory
       .getLog(ResourceCalculatorProcessTree.class);
@@ -90,9 +92,12 @@ public abstract class ResourceCalculatorProcessTree extends Configured
{
    * @param olderThanAge processes above this age are included in the
    *                      memory addition
    * @return cumulative virtual memory used by the process-tree in bytes,
-   *          for processes older than this age.
+   *          for processes older than this age. return 0 if it cannot be
+   *          calculated
    */
-  public abstract long getCumulativeVmem(int olderThanAge);
+  public long getCumulativeVmem(int olderThanAge) {
+    return 0;
+  }
 
   /**
    * Get the cumulative resident set size (rss) memory used by all the processes
@@ -104,7 +109,9 @@ public abstract class ResourceCalculatorProcessTree extends Configured
{
    *          for processes older than this age. return 0 if it cannot be
    *          calculated
    */
-  public abstract long getCumulativeRssmem(int olderThanAge);
+  public long getCumulativeRssmem(int olderThanAge) {
+    return 0;
+  }
 
   /**
    * Get the CPU time in millisecond used by all the processes in the
@@ -113,7 +120,9 @@ public abstract class ResourceCalculatorProcessTree extends Configured
{
    * @return cumulative CPU time in millisecond since the process-tree created
    *         return 0 if it cannot be calculated
    */
-  public abstract long getCumulativeCpuTime();
+  public long getCumulativeCpuTime() {
+    return 0;
+  }
 
   /**
    * Get the CPU usage by all the processes in the process-tree based on
@@ -123,7 +132,9 @@ public abstract class ResourceCalculatorProcessTree extends Configured
{
    * @return percentage CPU usage since the process-tree was created
    *         return {@link CpuTimeTracker#UNAVAILABLE} if it cannot be calculated
    */
-  public abstract float getCpuUsagePercent();
+  public float getCpuUsagePercent() {
+    return -1;
+  }
 
   /** Verify that the tree process id is same as its process group id.
    * @return true if the process id matches else return false.


Mime
View raw message