public class NormalizedResourceRequest extends Object implements NormalizedResourcesWithMemory
A resource request with normalized resource names.
Constructor and Description |
---|
NormalizedResourceRequest() |
NormalizedResourceRequest(ComponentCommon component,
Map<String,Object> topoConf,
String componentId) |
NormalizedResourceRequest(Map<String,Object> topoConf,
String componentId) |
Modifier and Type | Method and Description |
---|---|
void |
add(NormalizedResourceRequest other)
Add the resources in other to this.
|
void |
add(WorkerResources value)
Add the resources from a worker to those in this.
|
void |
addOffHeap(double offHeap) |
void |
addOnHeap(double onHeap) |
boolean |
areAnyOverZero()
Return true if any of the resources are > 0.
|
void |
clear()
Set all resources to 0.
|
NormalizedResources |
getNormalizedResources() |
double |
getOffHeapMemoryMb() |
double |
getOnHeapMemoryMb() |
double |
getTotalCpu() |
double |
getTotalMemoryMb() |
Map<String,Double> |
toNormalizedMap()
Convert to a map that is used by configuration and the UI.
|
String |
toString() |
public NormalizedResourceRequest(ComponentCommon component, Map<String,Object> topoConf, String componentId)
public NormalizedResourceRequest(Map<String,Object> topoConf, String componentId)
public NormalizedResourceRequest()
public Map<String,Double> toNormalizedMap()
Convert to a map that is used by configuration and the UI.
public double getOnHeapMemoryMb()
public void addOnHeap(double onHeap)
public double getOffHeapMemoryMb()
public void addOffHeap(double offHeap)
public void add(NormalizedResourceRequest other)
Add the resources in other to this.
other
- the other Request to add to this.public void add(WorkerResources value)
Add the resources from a worker to those in this.
value
- the resources on the worker.public double getTotalMemoryMb()
getTotalMemoryMb
in interface NormalizedResourcesWithMemory
public double getTotalCpu()
public NormalizedResources getNormalizedResources()
getNormalizedResources
in interface NormalizedResourcesWithMemory
public void clear()
NormalizedResourcesWithMemory
Set all resources to 0.
clear
in interface NormalizedResourcesWithMemory
public boolean areAnyOverZero()
NormalizedResourcesWithMemory
Return true if any of the resources are > 0.
areAnyOverZero
in interface NormalizedResourcesWithMemory
Copyright © 2019 The Apache Software Foundation. All rights reserved.