Class NodesSpecification
- java.lang.Object
-
- com.yahoo.vespa.model.builder.xml.dom.NodesSpecification
-
public class NodesSpecification extends java.lang.Object
A common utility class to represent a requirement for nodes during model building. Such a requirement is commonly specified in services.xml as anodes
element.- Author:
- bratseth
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NodesSpecification
dedicated(int count, ConfigModelContext context)
Returns a requirement fromcount
dedicated nodes in one groupstatic NodesSpecification
from(ModelElement nodesElement, ConfigModelContext context)
Returns a requirement for dedicated nodes taken from the givennodes
elementstatic java.util.Optional<NodesSpecification>
fromParent(ModelElement parentElement, ConfigModelContext context)
Returns a requirement for dedicated nodes taken from thenodes
element contained in the given parent element, or empty if the parent element is null, or the nodes elements is not present.boolean
isDedicated()
Returns whether this requires dedicated nodes.boolean
isExclusive()
Returns whether the physical hosts running the nodes of this application can also run nodes of other applications.com.yahoo.config.provision.ClusterResources
maxResources()
com.yahoo.config.provision.ClusterResources
minResources()
static NodesSpecification
nonDedicated(int count, ConfigModelContext context)
Returns a requirement fromcount
non-dedicated nodes in one groupstatic java.util.Optional<NodesSpecification>
optionalDedicatedFromParent(ModelElement parentElement, ConfigModelContext context)
Returns a requirement for non-dedicated or dedicated nodes taken from thenodes
element contained in the given parent element, or empty if the parent element is null, or the nodes elements is not present.java.util.Map<HostResource,com.yahoo.config.provision.ClusterMembership>
provision(HostSystem hostSystem, com.yahoo.config.provision.ClusterSpec.Type clusterType, com.yahoo.config.provision.ClusterSpec.Id clusterId, com.yahoo.config.application.api.DeployLogger logger)
java.lang.String
toString()
-
-
-
Method Detail
-
from
public static NodesSpecification from(ModelElement nodesElement, ConfigModelContext context)
Returns a requirement for dedicated nodes taken from the givennodes
element
-
fromParent
public static java.util.Optional<NodesSpecification> fromParent(ModelElement parentElement, ConfigModelContext context)
Returns a requirement for dedicated nodes taken from thenodes
element contained in the given parent element, or empty if the parent element is null, or the nodes elements is not present.
-
optionalDedicatedFromParent
public static java.util.Optional<NodesSpecification> optionalDedicatedFromParent(ModelElement parentElement, ConfigModelContext context)
Returns a requirement for non-dedicated or dedicated nodes taken from thenodes
element contained in the given parent element, or empty if the parent element is null, or the nodes elements is not present.
-
nonDedicated
public static NodesSpecification nonDedicated(int count, ConfigModelContext context)
Returns a requirement fromcount
non-dedicated nodes in one group
-
dedicated
public static NodesSpecification dedicated(int count, ConfigModelContext context)
Returns a requirement fromcount
dedicated nodes in one group
-
minResources
public com.yahoo.config.provision.ClusterResources minResources()
-
maxResources
public com.yahoo.config.provision.ClusterResources maxResources()
-
isDedicated
public boolean isDedicated()
Returns whether this requires dedicated nodes. Otherwise the model encountering this request should reuse nodes requested for other purposes whenever possible.
-
isExclusive
public boolean isExclusive()
Returns whether the physical hosts running the nodes of this application can also run nodes of other applications. Using exclusive nodes for containers increases security and increases cost.
-
provision
public java.util.Map<HostResource,com.yahoo.config.provision.ClusterMembership> provision(HostSystem hostSystem, com.yahoo.config.provision.ClusterSpec.Type clusterType, com.yahoo.config.provision.ClusterSpec.Id clusterId, com.yahoo.config.application.api.DeployLogger logger)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-