diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-11-16 15:19:21 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-11-16 15:19:21 +0100 |
commit | e595c0cf98f1caecd70dbc5ed14ff03967a3ced0 (patch) | |
tree | 213362b289fe7bd260c69c5ad41d925b92d85db9 /node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeSpec.java | |
parent | b88c7d56c33166d7f77c68ca2d5d0d9c684c4017 (diff) |
Support autoscaling in dynamic shared zones
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeSpec.java')
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeSpec.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeSpec.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeSpec.java index a2f5eabf447..54c24977fef 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeSpec.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeSpec.java @@ -28,8 +28,8 @@ public interface NodeSpec { /** Returns whether the hosts running the nodes of this application can also run nodes of other applications. */ boolean isExclusive(); - /** Returns whether the given flavor is compatible with this spec */ - boolean isCompatible(Flavor flavor, NodeFlavors flavors); + /** Returns whether the given node resources is compatible with this spec */ + boolean isCompatible(NodeResources resources); /** Returns whether the given node count is sufficient to consider this spec fulfilled to the maximum amount */ boolean saturatedBy(int count); @@ -115,12 +115,8 @@ public interface NodeSpec { public NodeType type() { return NodeType.tenant; } @Override - public boolean isCompatible(Flavor flavor, NodeFlavors flavors) { - if (flavor.isDocker()) { // Docker nodes can satisfy a request for parts of their resources - return flavor.resources().compatibleWith(requestedNodeResources); - } else { // Other nodes must be matched exactly - return requestedNodeResources.equals(flavor.resources()); - } + public boolean isCompatible(NodeResources resources) { + return requestedNodeResources.compatibleWith(resources); } @Override @@ -208,7 +204,7 @@ public interface NodeSpec { public boolean isExclusive() { return false; } @Override - public boolean isCompatible(Flavor flavor, NodeFlavors flavors) { return true; } + public boolean isCompatible(NodeResources resources) { return true; } @Override public boolean saturatedBy(int count) { return false; } |