summaryrefslogtreecommitdiffstats
path: root/node-repository/src/main
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2021-03-05 12:43:17 +0100
committerMartin Polden <mpolden@mpolden.no>2021-03-12 09:00:16 +0100
commit9c1226049adcebd16cf6a612596d180e1dbb2d65 (patch)
treef7c24f709e4d8b9177137a5b78c18c01807ba6d2 /node-repository/src/main
parentdd8c1a0e61639d0bd5bc3816f205420b5f187632 (diff)
Rename FlavorCount -> HostDeficit
Diffstat (limited to 'node-repository/src/main')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java4
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java26
2 files changed, 16 insertions, 14 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java
index 940c867dea5..597c4c1bd8c 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupPreparer.java
@@ -104,9 +104,9 @@ public class GroupPreparer {
HostSharing sharing = hostSharing(requestedNodes, hostType);
List<ProvisionedHost> provisionedHosts = allocation.hostDeficit()
.map(deficit -> {
- return hostProvisioner.get().provisionHosts(allocation.provisionIndices(deficit.getCount()),
+ return hostProvisioner.get().provisionHosts(allocation.provisionIndices(deficit.count()),
hostType,
- deficit.getFlavor(),
+ deficit.resources(),
application,
osVersion,
sharing);
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java
index a52d5c9444b..19c8d68963a 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java
@@ -290,18 +290,18 @@ class NodeAllocation {
}
/**
- * Returns {@link FlavorCount} describing the host deficit for the given {@link NodeSpec}.
+ * Returns {@link HostDeficit} describing the host deficit for the given {@link NodeSpec}.
*
- * @return empty if the requested spec is already fulfilled. Otherwise returns {@link FlavorCount} containing the
+ * @return empty if the requested spec is already fulfilled. Otherwise returns {@link HostDeficit} containing the
* flavor and host count required to cover the deficit.
*/
- Optional<FlavorCount> hostDeficit() {
+ Optional<HostDeficit> hostDeficit() {
if (nodeType() != NodeType.config && nodeType() != NodeType.tenant) {
return Optional.empty(); // Requests for these node types never have a deficit
}
- return Optional.of(new FlavorCount(requestedNodes.resources().orElseGet(NodeResources::unspecified),
+ return Optional.of(new HostDeficit(requestedNodes.resources().orElseGet(NodeResources::unspecified),
requestedNodes.fulfilledDeficitCount(accepted())))
- .filter(flavorCount -> flavorCount.getCount() > 0);
+ .filter(hostDeficit -> hostDeficit.count() > 0);
}
/** Returns the indices to use when provisioning hosts for this */
@@ -452,23 +452,25 @@ class NodeAllocation {
}
}
- static class FlavorCount {
+ /** A host deficit, the number of missing hosts, for a deployment */
+ static class HostDeficit {
- private final NodeResources flavor;
+ private final NodeResources resources;
private final int count;
- private FlavorCount(NodeResources flavor, int count) {
- this.flavor = flavor;
+ private HostDeficit(NodeResources resources, int count) {
+ this.resources = resources;
this.count = count;
}
- NodeResources getFlavor() {
- return flavor;
+ NodeResources resources() {
+ return resources;
}
- int getCount() {
+ int count() {
return count;
}
+
}
}