@InterfaceAudience.Public @InterfaceStability.Unstable public abstract class ResourceUtilization extends Object implements Comparable<ResourceUtilization>
ResourceUtilization
models the utilization of a set of computer
resources in the cluster.
Constructor and Description |
---|
ResourceUtilization() |
Modifier and Type | Method and Description |
---|---|
void |
addTo(int pmem,
int vmem,
float cpu)
Add utilization to the current one.
|
void |
addTo(int pmem,
int vmem,
float cpu,
String resourceName,
float utilization)
Add utilization to the current one.
|
boolean |
equals(Object obj) |
abstract float |
getCPU()
Get CPU utilization (The amount of vcores used).
|
float |
getCustomResource(String resourceName)
Get custom resource utilization
(The amount of custom resource used).
|
Map<String,Float> |
getCustomResources() |
abstract int |
getPhysicalMemory()
Get physical memory.
|
abstract int |
getVirtualMemory()
Get used virtual memory.
|
int |
hashCode() |
static ResourceUtilization |
newInstance(int pmem,
int vmem,
float cpu) |
static ResourceUtilization |
newInstance(int pmem,
int vmem,
float cpu,
Map<String,Float> customResources) |
static ResourceUtilization |
newInstance(ResourceUtilization resourceUtil) |
abstract void |
setCPU(float cpu)
Set CPU utilization (The amount of vcores used).
|
void |
setCustomResource(String resourceName,
float utilization)
Set custom resource utilization
(The amount of custom resource used).
|
void |
setCustomResources(Map<String,Float> customResources) |
abstract void |
setPhysicalMemory(int pmem)
Set physical memory.
|
abstract void |
setVirtualMemory(int vmem)
Set used virtual memory.
|
void |
subtractFrom(int pmem,
int vmem,
float cpu)
Subtract utilization from the current one.
|
void |
subtractFrom(int pmem,
int vmem,
float cpu,
String resourceName,
float utilization)
Subtract utilization from the current one.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compareTo
@InterfaceAudience.Public @InterfaceStability.Unstable public static ResourceUtilization newInstance(int pmem, int vmem, float cpu)
@InterfaceAudience.Public @InterfaceStability.Unstable public static ResourceUtilization newInstance(int pmem, int vmem, float cpu, Map<String,Float> customResources)
@InterfaceAudience.Public @InterfaceStability.Unstable public static ResourceUtilization newInstance(ResourceUtilization resourceUtil)
@InterfaceAudience.Public @InterfaceStability.Unstable public abstract int getVirtualMemory()
@InterfaceAudience.Public @InterfaceStability.Unstable public abstract void setVirtualMemory(int vmem)
vmem
- virtual memory in MB@InterfaceAudience.Public @InterfaceStability.Unstable public abstract int getPhysicalMemory()
@InterfaceAudience.Public @InterfaceStability.Unstable public abstract void setPhysicalMemory(int pmem)
pmem
- physical memory in MB@InterfaceAudience.Public @InterfaceStability.Unstable public abstract float getCPU()
@InterfaceAudience.Public @InterfaceStability.Unstable public abstract void setCPU(float cpu)
cpu
- CPU utilization@InterfaceAudience.Public @InterfaceStability.Unstable public float getCustomResource(String resourceName)
resourceName
- resourceName of custom resource@InterfaceAudience.Public @InterfaceStability.Unstable public Map<String,Float> getCustomResources()
@InterfaceAudience.Public @InterfaceStability.Unstable public void setCustomResources(Map<String,Float> customResources)
@InterfaceAudience.Public @InterfaceStability.Unstable public void setCustomResource(String resourceName, float utilization)
resourceName
- resourceNameutilization
- utilization of custom resource@InterfaceAudience.Public @InterfaceStability.Unstable public void addTo(int pmem, int vmem, float cpu)
pmem
- Physical memory used to add.vmem
- Virtual memory used to add.cpu
- CPU utilization to add.@InterfaceAudience.Public @InterfaceStability.Unstable public void addTo(int pmem, int vmem, float cpu, String resourceName, float utilization)
pmem
- Physical memory used to add.vmem
- Virtual memory used to add.cpu
- CPU utilization to add.resourceName
- of custom resource to add.utilization
- of custom resource to add.@InterfaceAudience.Public @InterfaceStability.Unstable public void subtractFrom(int pmem, int vmem, float cpu)
pmem
- Physical memory to be subtracted.vmem
- Virtual memory to be subtracted.cpu
- CPU utilization to be subtracted.@InterfaceAudience.Public @InterfaceStability.Unstable public void subtractFrom(int pmem, int vmem, float cpu, String resourceName, float utilization)
pmem
- Physical memory to be subtracted.vmem
- Virtual memory to be subtracted.cpu
- CPU utilization to be subtracted.resourceName
- of custom resource to be subtracted.utilization
- of custom resource to be subtracted.Copyright © 2024 Apache Software Foundation. All rights reserved.