|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.mapred.gridmix.emulators.resourceusage.CumulativeCpuUsageEmulatorPlugin.DefaultCpuUsageEmulator
public static class CumulativeCpuUsageEmulatorPlugin.DefaultCpuUsageEmulator
This is the core engine to emulate the CPU usage. The only responsibility of this class is to perform certain math intensive operations to make sure that some desired value of CPU is used.
| Field Summary | |
|---|---|
protected double |
returnValue
This is to fool the JVM and make it think that we need the value stored in the unit computation i.e compute(). |
| Constructor Summary | |
|---|---|
CumulativeCpuUsageEmulatorPlugin.DefaultCpuUsageEmulator()
Initialized the CumulativeCpuUsageEmulatorPlugin.DefaultCpuUsageEmulator with default values. |
|
| Method Summary | |
|---|---|
void |
calibrate(org.apache.hadoop.mapreduce.util.ResourceCalculatorPlugin monitor,
long totalCpuUsage)
This will calibrate the algorithm such that a single invocation of compute() emulates roughly 1% of the total desired resource
usage value. |
void |
compute()
This will consume some desired level of CPU. |
protected void |
performUnitComputation()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected double returnValue
compute(). This will prevent
the JVM from optimizing the code.
| Constructor Detail |
|---|
public CumulativeCpuUsageEmulatorPlugin.DefaultCpuUsageEmulator()
CumulativeCpuUsageEmulatorPlugin.DefaultCpuUsageEmulator with default values.
Note that the CumulativeCpuUsageEmulatorPlugin.DefaultCpuUsageEmulator should be calibrated
(see calibrate(ResourceCalculatorPlugin, long)) when initialized
using this constructor.
| Method Detail |
|---|
public void compute()
compute in interface CumulativeCpuUsageEmulatorPlugin.CpuUsageEmulatorCoreprotected void performUnitComputation()
public void calibrate(org.apache.hadoop.mapreduce.util.ResourceCalculatorPlugin monitor,
long totalCpuUsage)
compute() emulates roughly 1% of the total desired resource
usage value.
calibrate in interface CumulativeCpuUsageEmulatorPlugin.CpuUsageEmulatorCore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||