Class ResourceAllocation
- java.lang.Object
-
- com.yahoo.vespa.hosted.controller.api.integration.resource.ResourceAllocation
-
public class ResourceAllocation extends Object
An 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(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
-
-