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
ConstructorsConstructorDescriptionNormalizedResourceRequest(Map<String, Object> topoConf, String componentId) NormalizedResourceRequest(ComponentCommon component, Map<String, Object> topoConf, String componentId) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(WorkerResources value) Add the resources from a worker to those in this.voidadd(NormalizedResourceRequest other) Add the resources in other to this.voidaddOffHeap(double offHeap) voidaddOnHeap(double onHeap) booleanReturn true if any of the resources are > 0.voidclear()Set all resources to 0.doubledoubledoubledoublestatic voidConvert 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:
getTotalMemoryMbin interfaceNormalizedResourcesWithMemory
-
toString
-
getTotalCpu
public double getTotalCpu() -
getNormalizedResources
- Specified by:
getNormalizedResourcesin interfaceNormalizedResourcesWithMemory
-
clear
public void clear()Description copied from interface:NormalizedResourcesWithMemorySet all resources to 0.- Specified by:
clearin interfaceNormalizedResourcesWithMemory
-
areAnyOverZero
public boolean areAnyOverZero()Description copied from interface:NormalizedResourcesWithMemoryReturn true if any of the resources are > 0.- Specified by:
areAnyOverZeroin interfaceNormalizedResourcesWithMemory
-