diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-05-26 11:26:38 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2020-05-26 11:26:38 +0200 |
commit | c2f6a3263989d0d4943e7b42af515d152b125a3c (patch) | |
tree | 54eb3c0d920984e27c13ff9d323acc43a97a5b26 /node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications | |
parent | 2269faa4bccda5e42fb6c9cc50eabf63873388f2 (diff) |
Consider the lowest real resources we'll get when allocating
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications')
2 files changed, 13 insertions, 7 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Application.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Application.java index 3a3d3e4ec2e..e9e91910281 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Application.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Application.java @@ -53,12 +53,12 @@ public class Application { * Returns an application with the given cluster having the min and max resource limits of the given cluster. * If the cluster has a target which is not inside the new limits, the target is removed. */ - public Application withClusterLimits(ClusterSpec.Id id, ClusterResources min, ClusterResources max) { + public Application withCluster(ClusterSpec.Id id, boolean exclusive, ClusterResources min, ClusterResources max) { Cluster cluster = clusters.get(id); if (cluster == null) - cluster = new Cluster(id, min, max, Optional.empty(), Optional.empty()); + cluster = new Cluster(id, exclusive, min, max, Optional.empty(), Optional.empty()); else - cluster = cluster.withLimits(min, max); + cluster = cluster.withConfiguration(exclusive, min, max); return with(cluster); } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java index 847ec1290f6..3aae47a9088 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java @@ -19,16 +19,19 @@ import java.util.Optional; public class Cluster { private final ClusterSpec.Id id; + private final boolean exclusive; private final ClusterResources min, max; private final Optional<ClusterResources> suggested; private final Optional<ClusterResources> target; public Cluster(ClusterSpec.Id id, + boolean exclusive, ClusterResources minResources, ClusterResources maxResources, Optional<ClusterResources> suggestedResources, Optional<ClusterResources> targetResources) { this.id = Objects.requireNonNull(id); + this.exclusive = exclusive; this.min = Objects.requireNonNull(minResources); this.max = Objects.requireNonNull(maxResources); this.suggested = Objects.requireNonNull(suggestedResources); @@ -47,6 +50,9 @@ public class Cluster { /** Returns the configured maximal resources in this cluster */ public ClusterResources maxResources() { return max; } + /** Returns whether the nodes allocated to this cluster must be on host exclusively dedicated to this application */ + public boolean exclusive() { return exclusive; } + /** * Returns the computed resources (between min and max, inclusive) this cluster should * have allocated at the moment (whether or not it actually has it), @@ -60,16 +66,16 @@ public class Cluster { */ public Optional<ClusterResources> suggestedResources() { return suggested; } - public Cluster withLimits(ClusterResources min, ClusterResources max) { - return new Cluster(id, min, max, suggested, target); + public Cluster withConfiguration(boolean exclusive, ClusterResources min, ClusterResources max) { + return new Cluster(id, exclusive, min, max, suggested, target); } public Cluster withSuggested(Optional<ClusterResources> suggested) { - return new Cluster(id, min, max, suggested, target); + return new Cluster(id, exclusive, min, max, suggested, target); } public Cluster withTarget(Optional<ClusterResources> target) { - return new Cluster(id, min, max, suggested, target); + return new Cluster(id, exclusive, min, max, suggested, target); } @Override |