Class NormalizedResourceRequest
java.lang.Object
org.apache.storm.scheduler.resource.normalization.NormalizedResourceRequest
- All Implemented Interfaces:
- NormalizedResourcesWithMemory
A resource request with normalized resource names.
- 
Constructor SummaryConstructorsConstructorDescriptionNormalizedResourceRequest(Map<String, Object> topoConf, String componentId) NormalizedResourceRequest(ComponentCommon component, Map<String, Object> topoConf, String componentId) 
- 
Method SummaryModifier 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- 
NormalizedResourceRequestpublic NormalizedResourceRequest(ComponentCommon component, Map<String, Object> topoConf, String componentId) 
- 
NormalizedResourceRequest
- 
NormalizedResourceRequestpublic NormalizedResourceRequest()
 
- 
- 
Method Details- 
toNormalizedMapConvert 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
- 
getOnHeapMemoryMbpublic double getOnHeapMemoryMb()
- 
addOnHeappublic void addOnHeap(double onHeap) 
- 
getOffHeapMemoryMbpublic double getOffHeapMemoryMb()
- 
addOffHeappublic void addOffHeap(double offHeap) 
- 
addAdd the resources in other to this.- Parameters:
- other- the other Request to add to this.
 
- 
addAdd the resources from a worker to those in this.- Parameters:
- value- the resources on the worker.
 
- 
getTotalMemoryMbpublic double getTotalMemoryMb()- Specified by:
- getTotalMemoryMbin interface- NormalizedResourcesWithMemory
 
- 
toString
- 
getTotalCpupublic double getTotalCpu()
- 
getNormalizedResources- Specified by:
- getNormalizedResourcesin interface- NormalizedResourcesWithMemory
 
- 
clearpublic void clear()Description copied from interface:NormalizedResourcesWithMemorySet all resources to 0.- Specified by:
- clearin interface- NormalizedResourcesWithMemory
 
- 
areAnyOverZeropublic boolean areAnyOverZero()Description copied from interface:NormalizedResourcesWithMemoryReturn true if any of the resources are > 0.- Specified by:
- areAnyOverZeroin interface- NormalizedResourcesWithMemory
 
 
-