Class NormalizedResourceRequest
java.lang.Object
org.apache.storm.scheduler.resource.normalization.NormalizedResourceRequest
- All Implemented Interfaces:
NormalizedResourcesWithMemory
A resource request with normalized resource names.
-
Constructor Summary
ConstructorDescriptionNormalizedResourceRequest
(Map<String, Object> topoConf, String componentId) NormalizedResourceRequest
(ComponentCommon component, Map<String, Object> topoConf, String componentId) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(WorkerResources value) Add the resources from a worker to those in this.void
add
(NormalizedResourceRequest other) Add the resources in other to this.void
addOffHeap
(double offHeap) void
addOnHeap
(double onHeap) boolean
Return true if any of the resources are > 0.void
clear()
Set all resources to 0.double
double
double
double
static void
Convert to a map that is used by configuration and the UI.toString()
-
Constructor Details
-
NormalizedResourceRequest
public NormalizedResourceRequest(ComponentCommon component, Map<String, Object> topoConf, String componentId) -
NormalizedResourceRequest
-
NormalizedResourceRequest
public NormalizedResourceRequest()
-
-
Method Details
-
toNormalizedMap
Convert to a map that is used by configuration and the UI.- Returns:
- a map with the key as the resource name and the value the resource amount.
-
removeNonGenericResources
-
addResourceMap
-
subtractResourceMap
-
getOnHeapMemoryMb
public double getOnHeapMemoryMb() -
addOnHeap
public void addOnHeap(double onHeap) -
getOffHeapMemoryMb
public double getOffHeapMemoryMb() -
addOffHeap
public void addOffHeap(double offHeap) -
add
Add the resources in other to this.- Parameters:
other
- the other Request to add to this.
-
add
Add the resources from a worker to those in this.- Parameters:
value
- the resources on the worker.
-
getTotalMemoryMb
public double getTotalMemoryMb()- Specified by:
getTotalMemoryMb
in interfaceNormalizedResourcesWithMemory
-
toString
-
getTotalCpu
public double getTotalCpu() -
getNormalizedResources
- Specified by:
getNormalizedResources
in interfaceNormalizedResourcesWithMemory
-
clear
public void clear()Description copied from interface:NormalizedResourcesWithMemory
Set all resources to 0.- Specified by:
clear
in interfaceNormalizedResourcesWithMemory
-
areAnyOverZero
public boolean areAnyOverZero()Description copied from interface:NormalizedResourcesWithMemory
Return true if any of the resources are > 0.- Specified by:
areAnyOverZero
in interfaceNormalizedResourcesWithMemory
-