Class ResourceAllocation
- java.lang.Object
-
- com.yahoo.vespa.hosted.controller.api.integration.resource.ResourceAllocation
-
public class ResourceAllocation extends java.lang.ObjectAn allocation of node resources.- Author:
- ldalves
-
-
Field Summary
Fields Modifier and Type Field Description static ResourceAllocationZERO
-
Constructor Summary
Constructors Constructor Description ResourceAllocation(double cpuCores, double memoryGb, double diskGb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)doublegetCpuCores()doublegetDiskGb()doublegetMemoryGb()inthashCode()ResourceAllocationmultiply(double multiplicand)Returns a copy of this with each resource multiplied by given factorResourceAllocationplus(ResourceAllocation allocation)Returns a copy of this with the given allocation addeddoubleusageFraction(ResourceAllocation total)
-
-
-
Field Detail
-
ZERO
public static final ResourceAllocation ZERO
-
-
Method Detail
-
usageFraction
public double usageFraction(ResourceAllocation total)
-
getCpuCores
public double getCpuCores()
-
getMemoryGb
public double getMemoryGb()
-
getDiskGb
public double getDiskGb()
-
plus
public ResourceAllocation plus(ResourceAllocation allocation)
Returns a copy of this with the given allocation added
-
multiply
public ResourceAllocation multiply(double multiplicand)
Returns a copy of this with each resource multiplied by given factor
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-