Package com.yahoo.config.provision
Class NodeResources
- java.lang.Object
-
- com.yahoo.config.provision.NodeResources
-
public class NodeResources extends java.lang.Object
The node resources required by an application cluster- Author:
- bratseth
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NodeResources.DiskSpeed
static class
NodeResources.StorageType
-
Constructor Summary
Constructors Constructor Description NodeResources(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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeResources
add(NodeResources other)
double
bandwidthGbps()
boolean
compatibleWith(NodeResources other)
Returns true if all the resources of this are the same as or compatible with the given resourcesdouble
diskGb()
NodeResources.DiskSpeed
diskSpeed()
boolean
equals(java.lang.Object o)
static NodeResources
fromLegacyName(java.lang.String name)
Create this from serial form.int
hashCode()
NodeResources
justNumbers()
Returns 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 resourcesNodeResources.StorageType
storageType()
NodeResources
subtract(NodeResources other)
java.lang.String
toString()
double
vcpu()
NodeResources
with(NodeResources.DiskSpeed speed)
NodeResources
with(NodeResources.StorageType storageType)
NodeResources
withBandwidthGbps(double bandwidthGbps)
NodeResources
withDiskGb(double diskGb)
NodeResources
withDiskSpeed(NodeResources.DiskSpeed speed)
NodeResources
withMemoryGb(double memoryGb)
NodeResources
withVcpu(double vcpu)
-
-
-
Constructor Detail
-
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)
-
-
Method Detail
-
vcpu
public double vcpu()
-
memoryGb
public double memoryGb()
-
diskGb
public double diskGb()
-
bandwidthGbps
public double bandwidthGbps()
-
diskSpeed
public NodeResources.DiskSpeed diskSpeed()
-
storageType
public NodeResources.StorageType storageType()
-
withVcpu
public NodeResources withVcpu(double vcpu)
-
withMemoryGb
public NodeResources withMemoryGb(double memoryGb)
-
withDiskGb
public NodeResources withDiskGb(double diskGb)
-
withBandwidthGbps
public NodeResources withBandwidthGbps(double bandwidthGbps)
-
withDiskSpeed
public NodeResources withDiskSpeed(NodeResources.DiskSpeed speed)
-
with
public NodeResources with(NodeResources.DiskSpeed speed)
-
with
public NodeResources with(NodeResources.StorageType storageType)
-
justNumbers
public NodeResources justNumbers()
Returns this with disk speed and storage type set to any
-
subtract
public NodeResources subtract(NodeResources other)
-
add
public NodeResources add(NodeResources other)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
satisfies
public boolean satisfies(NodeResources other)
Returns true if all the resources of this are the same or larger than the given resources
-
compatibleWith
public boolean compatibleWith(NodeResources other)
Returns true if all the resources of this are the same as or compatible with the given resources
-
fromLegacyName
public static NodeResources fromLegacyName(java.lang.String name)
Create this from serial form.- Throws:
java.lang.IllegalArgumentException
- if the given string cannot be parsed as a serial form of this
-
-