Package com.yahoo.config.provision
Class Flavor
java.lang.Object
com.yahoo.config.provision.Flavor
A host or node flavor.
*Host* flavors come from a configured set which corresponds to the actual flavors available in a zone.
Its resources are the real resources available on the host.
*Node* flavors are simply a wrapper of a NodeResources object.
Its resources are the advertised resources as specified or implied by the application package.
- Author:
- bratseth
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionFlavor(NodeResources resources) Creates a *node* flavor from a node resources specFlavor(FlavorsConfig.Flavor flavorConfig) Creates a *host* flavor from configurationFlavor(String name, NodeResources resources) Creates a *host* flavor for testingFlavor(String name, NodeResources resources, Optional<FlavorOverrides> flavorOverrides, Flavor.Type type, boolean configured, int cost) Flavor(String name, NodeResources resources, Optional<FlavorOverrides> flavorOverrides, Flavor.Type type, boolean configured, int cost, double cpuSpeedup) -
Method Summary
Modifier and TypeMethodDescriptionintcost()Get the monthly cost (total cost of ownership) in USD for this flavor, typically total cost divided by 36 months.booleangetType()inthashCode()booleanTrue if this is a configured flavor used for hosts, false if it is a virtual flavor created on the fly from node resourcesname()Returns the unique identity of this flavor if it is configured, or the resource spec string otherwisedoubleReturns cost adjusted for cpu speedup, suitable for comparing performance per dollar.toString()with(FlavorOverrides flavorOverrides) with(NodeResources resources)
-
Constructor Details
-
Flavor
Creates a *host* flavor from configuration -
Flavor
Creates a *node* flavor from a node resources spec -
Flavor
Creates a *host* flavor for testing -
Flavor
public Flavor(String name, NodeResources resources, Optional<FlavorOverrides> flavorOverrides, Flavor.Type type, boolean configured, int cost) -
Flavor
public Flavor(String name, NodeResources resources, Optional<FlavorOverrides> flavorOverrides, Flavor.Type type, boolean configured, int cost, double cpuSpeedup)
-
-
Method Details
-
with
-
with
-
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
-
performanceAdjustedCost
public double performanceAdjustedCost()Returns cost adjusted for cpu speedup, suitable for comparing performance per dollar. -
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
-
flavorOverrides
-
getType
-
hashCode
public int hashCode() -
equals
-
toString
-