Package com.yahoo.config.provision
Class Flavor
- java.lang.Object
-
- com.yahoo.config.provision.Flavor
-
public class Flavor extends java.lang.Object
A host or node flavor. *Host* flavors come from a configured set which corresponds to the actual flavors available in a zone. *Node* flavors are simply a wrapper of a NodeResources object.- Author:
- bratseth
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Flavor.Type
-
Constructor Summary
Constructors Constructor Description Flavor(NodeResources resources)
Creates a *node* flavor from a node resources specFlavor(com.yahoo.config.provisioning.FlavorsConfig.Flavor flavorConfig)
Creates a *host* flavor from configuration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
canonicalName()
int
cost()
Get the monthly cost (total cost of ownership) in USD for this flavor, typically total cost divided by 36 months.boolean
equals(java.lang.Object o)
java.util.Optional<com.yahoo.config.provision.host.FlavorOverrides>
flavorOverrides()
double
getBandwidthGbps()
double
getMinCpuCores()
double
getMinDiskAvailableGb()
double
getMinMainMemoryAvailableGb()
Flavor.Type
getType()
boolean
hasFastDisk()
int
hashCode()
boolean
isConfigured()
True if this is a configured flavor used for hosts, false if it is a virtual flavor created on the fly from node resourcesboolean
isDocker()
Convenience, returns getType() == Type.DOCKER_CONTAINERjava.lang.String
name()
Returns the unique identity of this flavor if it is configured, or the resource spec string otherwiseNodeResources
resources()
java.lang.String
toString()
Flavor
with(com.yahoo.config.provision.host.FlavorOverrides flavorOverrides)
Flavor
with(NodeResources resources)
-
-
-
Constructor Detail
-
Flavor
public Flavor(com.yahoo.config.provisioning.FlavorsConfig.Flavor flavorConfig)
Creates a *host* flavor from configuration
-
Flavor
public Flavor(NodeResources resources)
Creates a *node* flavor from a node resources spec
-
-
Method Detail
-
with
public Flavor with(com.yahoo.config.provision.host.FlavorOverrides flavorOverrides)
-
with
public Flavor with(NodeResources resources)
-
name
public java.lang.String name()
Returns the unique identity of this flavor if it is configured, or the resource spec string otherwise
-
cost
public int cost()
Get the monthly cost (total cost of ownership) in USD for this flavor, typically total cost divided by 36 months.- Returns:
- monthly cost in USD
-
isConfigured
public boolean isConfigured()
True if this is a configured flavor used for hosts, false if it is a virtual flavor created on the fly from node resources
-
resources
public NodeResources resources()
-
flavorOverrides
public java.util.Optional<com.yahoo.config.provision.host.FlavorOverrides> flavorOverrides()
-
getMinMainMemoryAvailableGb
public double getMinMainMemoryAvailableGb()
-
getMinDiskAvailableGb
public double getMinDiskAvailableGb()
-
hasFastDisk
public boolean hasFastDisk()
-
getBandwidthGbps
public double getBandwidthGbps()
-
getMinCpuCores
public double getMinCpuCores()
-
getType
public Flavor.Type getType()
-
isDocker
public boolean isDocker()
Convenience, returns getType() == Type.DOCKER_CONTAINER
-
canonicalName
public java.lang.String canonicalName()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-