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
-
Constructor Summary
Constructors Constructor Description NodeResources(double vcpu, double memoryGb, double diskGb)
Deprecated.NodeResources(double vcpu, double memoryGb, double diskGb, double bandwidthGbps)
Create node resources requiring fast diskNodeResources(double vcpu, double memoryGb, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed)
NodeResources(double vcpu, double memoryGb, double diskGb, NodeResources.DiskSpeed diskSpeed)
Deprecated.
-
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()
double
memoryGb()
boolean
satisfies(NodeResources other)
Returns true if all the resources of this are the same or larger than the given resourcesNodeResources
subtract(NodeResources other)
java.lang.String
toString()
double
vcpu()
NodeResources
withBandwidthGbps(double bandwidthGbps)
NodeResources
withDiskGb(double diskGb)
NodeResources
withDiskSpeed(NodeResources.DiskSpeed speed)
NodeResources
withMemoryGb(double memoryGb)
NodeResources
withVcpu(double vcpu)
-
-
-
Constructor Detail
-
NodeResources
@Deprecated public NodeResources(double vcpu, double memoryGb, double diskGb)
Deprecated.Create node resources requiring fast disk and no bandwidth
-
NodeResources
@Deprecated public NodeResources(double vcpu, double memoryGb, double diskGb, NodeResources.DiskSpeed diskSpeed)
Deprecated.Create node resources requiring no bandwidth
-
NodeResources
public NodeResources(double vcpu, double memoryGb, double diskGb, double bandwidthGbps)
Create node resources requiring fast disk
-
NodeResources
public NodeResources(double vcpu, double memoryGb, double diskGb, double bandwidthGbps, NodeResources.DiskSpeed diskSpeed)
-
-
Method Detail
-
vcpu
public double vcpu()
-
memoryGb
public double memoryGb()
-
diskGb
public double diskGb()
-
bandwidthGbps
public double bandwidthGbps()
-
diskSpeed
public NodeResources.DiskSpeed diskSpeed()
-
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)
-
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
-
-