org.apache.hadoop.mapred.gridmix.emulators.resourceusage
Class TotalHeapUsageEmulatorPlugin.DefaultHeapUsageEmulator
java.lang.Object
org.apache.hadoop.mapred.gridmix.emulators.resourceusage.TotalHeapUsageEmulatorPlugin.DefaultHeapUsageEmulator
- All Implemented Interfaces:
- TotalHeapUsageEmulatorPlugin.HeapUsageEmulatorCore
- Enclosing class:
- TotalHeapUsageEmulatorPlugin
public static class TotalHeapUsageEmulatorPlugin.DefaultHeapUsageEmulator
- extends Object
- implements TotalHeapUsageEmulatorPlugin.HeapUsageEmulatorCore
This is the core engine to emulate the heap usage. The only responsibility
of this class is to perform certain memory intensive operations to make
sure that some desired value of heap is used.
|
Method Summary |
void |
initialize(org.apache.hadoop.mapreduce.util.ResourceCalculatorPlugin monitor,
long totalHeapUsageInMB)
This will initialize the core and check if the core can emulate the
desired target on the underlying hardware. |
void |
load(long sizeInMB)
Increase heap usage by current process by the given amount. |
void |
reset()
Clear references to all the GridMix-allocated special objects so that
heap usage is reduced. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
heapSpace
protected static ArrayList<Object> heapSpace
TotalHeapUsageEmulatorPlugin.DefaultHeapUsageEmulator
public TotalHeapUsageEmulatorPlugin.DefaultHeapUsageEmulator()
load
public void load(long sizeInMB)
- Increase heap usage by current process by the given amount.
This is done by creating objects each of size 1MB.
- Specified by:
load in interface TotalHeapUsageEmulatorPlugin.HeapUsageEmulatorCore
initialize
public void initialize(org.apache.hadoop.mapreduce.util.ResourceCalculatorPlugin monitor,
long totalHeapUsageInMB)
- This will initialize the core and check if the core can emulate the
desired target on the underlying hardware.
- Specified by:
initialize in interface TotalHeapUsageEmulatorPlugin.HeapUsageEmulatorCore
reset
public void reset()
- Clear references to all the GridMix-allocated special objects so that
heap usage is reduced.
- Specified by:
reset in interface TotalHeapUsageEmulatorPlugin.HeapUsageEmulatorCore
Copyright © 2012 Apache Software Foundation. All Rights Reserved.