Package com.yahoo.config.provision
Class Capacity
- java.lang.Object
-
- com.yahoo.config.provision.Capacity
-
public final class Capacity extends Object
A capacity request.- Author:
- Ulf Lilleengen, bratseth
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canFail()
Returns true if an exception should be thrown if the specified capacity can not be satisfied (to whatever policies are applied and taking required true/false into account).static Capacity
from(ClusterResources resources)
Create a non-required, failable capacity requeststatic Capacity
from(ClusterResources resources, boolean required, boolean canFail)
static Capacity
from(ClusterResources min, ClusterResources max)
Create a non-required, failable capacity requeststatic Capacity
from(ClusterResources min, ClusterResources max, boolean required, boolean canFail)
static Capacity
fromRequiredNodeType(NodeType type)
Creates this from a node typeboolean
isRequired()
Returns whether the requested number of nodes must be met exactly for a request for this to succeedClusterResources
maxResources()
ClusterResources
minResources()
String
toString()
NodeType
type()
Returns the node type (role) requested.Capacity
withLimits(ClusterResources min, ClusterResources max)
-
-
-
Method Detail
-
minResources
public ClusterResources minResources()
-
maxResources
public ClusterResources maxResources()
-
isRequired
public boolean isRequired()
Returns whether the requested number of nodes must be met exactly for a request for this to succeed
-
canFail
public boolean canFail()
Returns true if an exception should be thrown if the specified capacity can not be satisfied (to whatever policies are applied and taking required true/false into account). Returns false if it is preferable to still succeed with partially satisfied capacity.
-
type
public NodeType type()
Returns the node type (role) requested. This is tenant nodes by default. If some other type is requested the node count and flavor may be ignored and all nodes of the requested type returned instead.
-
withLimits
public Capacity withLimits(ClusterResources min, ClusterResources max)
-
from
public static Capacity from(ClusterResources resources)
Create a non-required, failable capacity request
-
from
public static Capacity from(ClusterResources min, ClusterResources max)
Create a non-required, failable capacity request
-
from
public static Capacity from(ClusterResources resources, boolean required, boolean canFail)
-
from
public static Capacity from(ClusterResources min, ClusterResources max, boolean required, boolean canFail)
-
-