Package com.yahoo.config.provision
Class ClusterResources
- java.lang.Object
-
- com.yahoo.config.provision.ClusterResources
-
public class ClusterResources extends Object
The resources of a cluster- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description ClusterResources(int nodes, int groups, NodeResources nodeResources)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
cost()
Returns the standard cost of these resources, in dollars per hourboolean
equals(Object o)
int
groups()
int
hashCode()
boolean
isWithin(ClusterResources min, ClusterResources max)
Returns true if this is within the given limits (inclusive) and is compatible with themClusterResources
justNumbers()
NodeResources
nodeResources()
int
nodes()
Returns the total number of allocated nodes (over all groups)boolean
smallerThan(ClusterResources other)
Returns true if this is smaller than the given resources in any dimensionString
toString()
NodeResources
totalResources()
Returns the total resources of this, that is the number of nodes times the node resourcesClusterResources
with(NodeResources resources)
ClusterResources
withGroups(int groups)
ClusterResources
withNodes(int nodes)
-
-
-
Constructor Detail
-
ClusterResources
public ClusterResources(int nodes, int groups, NodeResources nodeResources)
-
-
Method Detail
-
nodes
public int nodes()
Returns the total number of allocated nodes (over all groups)
-
groups
public int groups()
-
nodeResources
public NodeResources nodeResources()
-
with
public ClusterResources with(NodeResources resources)
-
withNodes
public ClusterResources withNodes(int nodes)
-
withGroups
public ClusterResources withGroups(int groups)
-
smallerThan
public boolean smallerThan(ClusterResources other)
Returns true if this is smaller than the given resources in any dimension
-
isWithin
public boolean isWithin(ClusterResources min, ClusterResources max)
Returns true if this is within the given limits (inclusive) and is compatible with them
-
totalResources
public NodeResources totalResources()
Returns the total resources of this, that is the number of nodes times the node resources
-
justNumbers
public ClusterResources justNumbers()
-
cost
public double cost()
Returns the standard cost of these resources, in dollars per hour
-
-