YARN-3296. Mark ResourceCalculatorProcessTree class as Public for configurable resource monitoring. Contributed by Hitesh Shah

This commit is contained in:
Junping Du 2015-03-08 14:47:35 -07:00
parent 64443490d7
commit 7ce3c76353
2 changed files with 21 additions and 7 deletions

View File

@ -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

View File

@ -22,7 +22,8 @@
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 @@
* 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 long getCumulativeRssmem() {
* @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 long getCumulativeRssmem() {
* 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 long getCumulativeRssmem() {
* @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 long getCumulativeRssmem() {
* @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.