You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ji...@apache.org on 2015/03/09 21:26:06 UTC
[40/50] [abbrv] hadoop git commit: YARN-3296. Mark
ResourceCalculatorProcessTree class as Public for configurable resource
monitoring. Contributed by Hitesh Shah
YARN-3296. Mark ResourceCalculatorProcessTree class as Public for configurable resource monitoring. Contributed by Hitesh Shah
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7b912239
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7b912239
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7b912239
Branch: refs/heads/HDFS-7285
Commit: 7b912239d7590aff2dbd3e7e5f5f7c2bfdd23e3d
Parents: eed1645
Author: Junping Du <ju...@apache.org>
Authored: Sun Mar 8 14:47:35 2015 -0700
Committer: Jing Zhao <ji...@apache.org>
Committed: Mon Mar 9 13:11:27 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/7b912239/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 250fc1c..f28e932 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -366,6 +366,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/7b912239/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.