CumulativeCpuUsageEmulatorPlugin.CpuUsageEmulatorCorepublic static class CumulativeCpuUsageEmulatorPlugin.DefaultCpuUsageEmulator extends java.lang.Object implements CumulativeCpuUsageEmulatorPlugin.CpuUsageEmulatorCore
| Modifier and Type | Field | Description |
|---|---|---|
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 | Description |
|---|---|
DefaultCpuUsageEmulator() |
Initialized the
CumulativeCpuUsageEmulatorPlugin.DefaultCpuUsageEmulator with default values. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
calibrate(org.apache.hadoop.yarn.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() |
protected double returnValue
compute(). This will prevent
the JVM from optimizing the code.public DefaultCpuUsageEmulator()
CumulativeCpuUsageEmulatorPlugin.DefaultCpuUsageEmulator with default values.
Note that the CumulativeCpuUsageEmulatorPlugin.DefaultCpuUsageEmulator should be calibrated
(see calibrate(ResourceCalculatorPlugin, long)) when initialized
using this constructor.public void compute()
compute in interface CumulativeCpuUsageEmulatorPlugin.CpuUsageEmulatorCoreprotected void performUnitComputation()
public void calibrate(org.apache.hadoop.yarn.util.ResourceCalculatorPlugin monitor,
long totalCpuUsage)
compute() emulates roughly 1% of the total desired resource
usage value.calibrate in interface CumulativeCpuUsageEmulatorPlugin.CpuUsageEmulatorCoreCopyright © 2008–2025 Apache Software Foundation. All rights reserved.