Class Capacity

java.lang.Object
com.yahoo.config.provision.Capacity

public final class Capacity extends Object
A capacity request.
Author:
Ulf Lilleengen, bratseth
  • Method Details

    • 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.
    • cloudAccount

      public Optional<CloudAccount> cloudAccount()
      Returns the cloud account where this capacity is requested
    • withLimits

      public Capacity withLimits(ClusterResources min, ClusterResources max)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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)
    • from

      public static Capacity from(ClusterResources min, ClusterResources max, boolean required, boolean canFail, Optional<CloudAccount> cloudAccount)
    • fromRequiredNodeType

      public static Capacity fromRequiredNodeType(NodeType type)
      Creates this from a node type