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
Modifier and TypeClassDescriptionstatic enum
static enum
static enum
-
Constructor Summary
ConstructorDescriptionNodeResources
(double vcpu, double memoryGb, double diskGb, double bandwidthGbps) NodeResources
(double vcpu, double memoryGb, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed) NodeResources
(double vcpu, double memoryGb, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed, NodeResources.StorageType storageType) NodeResources
(double vcpu, double memoryGb, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed, NodeResources.StorageType storageType, NodeResources.Architecture architecture) -
Method Summary
Modifier and TypeMethodDescriptionadd
(NodeResources other) Returns this.isUnspecified() ? Optional.empty() : Optional.of(this)double
boolean
compatibleWith
(NodeResources other) Returns true if all the resources of this are the same as or compatible with the given resourcesdouble
cost()
Returns the standard cost of these resources, in dollars per hourdouble
diskGb()
double
distanceTo
(NodeResources other) boolean
static NodeResources
fromLegacyName
(String name) Create this from serial form.int
hashCode()
boolean
Returns this with all numbers set to 0Returns this with disk speed and storage type set to anydouble
memoryGb()
boolean
satisfies
(NodeResources other) Returns true if all the resources of this are the same or larger than the given resourcessubtract
(NodeResources other) toString()
static NodeResources
double
vcpu()
with
(NodeResources.Architecture architecture) with
(NodeResources.DiskSpeed diskSpeed) with
(NodeResources.StorageType storageType) withBandwidthGbps
(double bandwidthGbps) withDiskGb
(double diskGb) withMemoryGb
(double memoryGb) withVcpu
(double vcpu) static NodeResources
zero()
-
Constructor Details
-
NodeResources
public NodeResources(double vcpu, double memoryGb, double diskGb, double bandwidthGbps) -
NodeResources
public NodeResources(double vcpu, double memoryGb, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed) -
NodeResources
public NodeResources(double vcpu, double memoryGb, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed, NodeResources.StorageType storageType) -
NodeResources
public NodeResources(double vcpu, double memoryGb, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed, NodeResources.StorageType storageType, NodeResources.Architecture architecture)
-
-
Method Details
-
vcpu
public double vcpu() -
memoryGb
public double memoryGb() -
diskGb
public double diskGb() -
bandwidthGbps
public double bandwidthGbps() -
diskSpeed
-
storageType
-
architecture
-
cost
public double cost()Returns the standard cost of these resources, in dollars per hour -
withVcpu
-
withMemoryGb
-
withDiskGb
-
withBandwidthGbps
-
with
-
with
-
with
-
justNumbers
Returns this with disk speed and storage type set to any -
justNonNumbers
Returns this with all numbers set to 0 -
subtract
-
add
-
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 given resources -
unspecified
-
isUnspecified
public boolean isUnspecified() -
distanceTo
-
asOptional
Returns this.isUnspecified() ? Optional.empty() : Optional.of(this) -
fromLegacyName
Create this from serial form.- Throws:
IllegalArgumentException
- if the given string cannot be parsed as a serial form of this
-
zero
-