Package com.yahoo.config.provision
Class NodeResources
java.lang.Object
com.yahoo.config.provision.NodeResources
The node resources required by an application cluster
- Author:
- bratseth
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic final recordstatic enumstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionNodeResources(double vcpu, double memoryGiB, double diskGb, double bandwidthGbps) NodeResources(double vcpu, double memoryGiB, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed) NodeResources(double vcpu, double memoryGiB, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed, NodeResources.StorageType storageType) NodeResources(double vcpu, double memoryGiB, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed, NodeResources.StorageType storageType, NodeResources.Architecture architecture) NodeResources(double vcpu, double memoryGiB, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed, NodeResources.StorageType storageType, NodeResources.Architecture architecture, NodeResources.GpuResources gpuResources) -
Method Summary
Modifier and TypeMethodDescriptionadd(NodeResources other) Returns this.isUnspecified() ?doublebooleanbooleancompatibleWith(NodeResources requested) Returns true if all the resources of this are the same as or compatible with the requested resources: - Equal numbers only where request implies it (i.e not for disk if storage is any/remote, and not for bandwidth where we don't enforce constraints), - Compatible non-numbers.doublecost()Returns the standard cost of these resources, in dollars per hourdoublediskGb()booleandoubledistanceTo(NodeResources other) booleanbooleanReturns true if all the resources of this are the same as or compatible with the given resources: - Equal numbersinthashCode()booleanbooleanisZero()Returns this with all numbers set to 0Returns this with disk speed, storage type and architecture set to anydoublebooleanmultipliedBy(double factor) booleansatisfies(NodeResources other) Returns true if all the resources of this are the same or larger than the given resourcessubtract(NodeResources other) toString()static NodeResourcesdoublevcpu()booleanwith(NodeResources.Architecture architecture) with(NodeResources.DiskSpeed diskSpeed) with(NodeResources.GpuResources gpuResources) with(NodeResources.StorageType storageType) withBandwidthGbps(double bandwidthGbps) withDiskGb(double diskGb) withMemoryGiB(double memoryGiB) withUnspecifiedFieldsFrom(NodeResources fullySpecified) withVcpu(double vcpu) static NodeResourceszero()
-
Constructor Details
-
NodeResources
public NodeResources(double vcpu, double memoryGiB, double diskGb, double bandwidthGbps) -
NodeResources
public NodeResources(double vcpu, double memoryGiB, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed) -
NodeResources
public NodeResources(double vcpu, double memoryGiB, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed, NodeResources.StorageType storageType) -
NodeResources
public NodeResources(double vcpu, double memoryGiB, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed, NodeResources.StorageType storageType, NodeResources.Architecture architecture) -
NodeResources
public NodeResources(double vcpu, double memoryGiB, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed, NodeResources.StorageType storageType, NodeResources.Architecture architecture, NodeResources.GpuResources gpuResources)
-
-
Method Details
-
vcpu
public double vcpu() -
memoryGiB
public double memoryGiB() -
diskGb
public double diskGb() -
bandwidthGbps
public double bandwidthGbps() -
diskSpeed
-
storageType
-
architecture
-
gpuResources
-
vcpuIsUnspecified
public boolean vcpuIsUnspecified() -
memoryIsUnspecified
public boolean memoryIsUnspecified() -
diskIsUnspecified
public boolean diskIsUnspecified() -
bandwidthGbpsIsUnspecified
public boolean bandwidthGbpsIsUnspecified() -
cost
public double cost()Returns the standard cost of these resources, in dollars per hour -
withVcpu
-
withMemoryGiB
-
withDiskGb
-
withBandwidthGbps
-
with
-
with
-
with
-
with
-
withUnspecifiedFieldsFrom
-
justNumbers
Returns this with disk speed, storage type and architecture set to any -
justNonNumbers
Returns this with all numbers set to 0 -
subtract
-
add
-
multipliedBy
-
equals
-
hashCode
public int hashCode() -
toString
-
satisfies
Returns true if all the resources of this are the same or larger than the given resources -
compatibleWith
Returns true if all the resources of this are the same as or compatible with the requested resources: - Equal numbers only where request implies it (i.e not for disk if storage is any/remote, and not for bandwidth where we don't enforce constraints), - Compatible non-numbers. -
equalsWhereSpecified
Returns true if all the resources of this are the same as or compatible with the given resources: - Equal numbers. - Compatible non-numbers. -
unspecified
-
isUnspecified
public boolean isUnspecified() -
distanceTo
-
asOptional
Returns this.isUnspecified() ? Optional.empty() : Optional.of(this) -
isZero
public boolean isZero() -
zero
-