Package com.yahoo.config.provision
Class Flavor
- java.lang.Object
-
- com.yahoo.config.provision.Flavor
-
public class Flavor extends 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(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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
cost()
Get the monthly cost (total cost of ownership) in USD for this flavor, typically total cost divided by 36 months.boolean
equals(Object o)
Optional<FlavorOverrides>
flavorOverrides()
Flavor.Type
getType()
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_CONTAINERString
name()
Returns the unique identity of this flavor if it is configured, or the resource spec string otherwiseNodeResources
resources()
String
toString()
Flavor
with(FlavorOverrides flavorOverrides)
Flavor
with(NodeResources resources)
-
-
-
Constructor Detail
-
Flavor
public Flavor(FlavorsConfig.Flavor flavorConfig)
Creates a *host* flavor from configuration
-
Flavor
public Flavor(NodeResources resources)
Creates a *node* flavor from a node resources spec
-
Flavor
public Flavor(String name, NodeResources resources)
Creates a *host* flavor for testing
-
Flavor
public Flavor(String name, NodeResources resources, Optional<FlavorOverrides> flavorOverrides, Flavor.Type type, boolean configured, int cost)
-
-
Method Detail
-
with
public Flavor with(FlavorOverrides flavorOverrides)
-
with
public Flavor with(NodeResources resources)
-
name
public 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 Optional<FlavorOverrides> flavorOverrides()
-
getType
public Flavor.Type getType()
-
isDocker
public boolean isDocker()
Convenience, returns getType() == Type.DOCKER_CONTAINER
-
-