summaryrefslogtreecommitdiffstats
path: root/flags
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2020-05-28 15:04:26 +0200
committerGitHub <noreply@github.com>2020-05-28 15:04:26 +0200
commit4552075772789e0db6d4ab0e21157b393274432b (patch)
tree1c33f2c1ff2897d0e3dadbc2bfa96b2385bdcaf8 /flags
parent13d1a3491b1daac7a6058300e83014200e30386c (diff)
parent8903332a7a6ce57c7777b2f6976c1da781d8b52e (diff)
Merge pull request #13401 from vespa-engine/mpolden/provision-exact-capacity
Support provisioning exact capacity
Diffstat (limited to 'flags')
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/Flags.java13
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/custom/HostCapacity.java (renamed from flags/src/main/java/com/yahoo/vespa/flags/custom/PreprovisionCapacity.java)14
2 files changed, 14 insertions, 13 deletions
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
index 944f02a62a4..386a169acb0 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
@@ -3,7 +3,7 @@ package com.yahoo.vespa.flags;
import com.yahoo.component.Vtag;
import com.yahoo.vespa.defaults.Defaults;
-import com.yahoo.vespa.flags.custom.PreprovisionCapacity;
+import com.yahoo.vespa.flags.custom.HostCapacity;
import java.util.List;
import java.util.Optional;
@@ -122,11 +122,12 @@ public class Flags {
"Takes effect on the next run of RetiredExpirer.",
HOSTNAME);
- public static final UnboundListFlag<PreprovisionCapacity> PREPROVISION_CAPACITY = defineListFlag(
- "preprovision-capacity", List.of(), PreprovisionCapacity.class,
- "List of node resources and their count that should be present in zone to receive new deployments. When a " +
- "preprovisioned is taken, new will be provisioned within next iteration of maintainer.",
- "Takes effect on next iteration of HostProvisionMaintainer.");
+ public static final UnboundListFlag<HostCapacity> TARGET_CAPACITY = defineListFlag(
+ "preprovision-capacity", List.of(), HostCapacity.class,
+ "List of node resources and their count that should be provisioned." +
+ "In a dynamically provisioned zone this specifies the unallocated (i.e. pre-provisioned) capacity. " +
+ "Otherwise it specifies the total (unallocated or not) capacity.",
+ "Takes effect on next iteration of DynamicProvisioningMaintainer.");
public static final UnboundDoubleFlag DEFAULT_TERM_WISE_LIMIT = defineDoubleFlag(
"default-term-wise-limit", 1.0,
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/custom/PreprovisionCapacity.java b/flags/src/main/java/com/yahoo/vespa/flags/custom/HostCapacity.java
index 01eab8dfb9c..947520ca2d7 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/custom/PreprovisionCapacity.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/custom/HostCapacity.java
@@ -10,7 +10,7 @@ import java.util.Objects;
* @author freva
*/
@JsonIgnoreProperties(ignoreUnknown = true)
-public class PreprovisionCapacity {
+public class HostCapacity {
@JsonProperty("vcpu")
private final double vcpu;
@@ -23,10 +23,10 @@ public class PreprovisionCapacity {
@JsonProperty("count")
private final int count;
- public PreprovisionCapacity(@JsonProperty("vcpu") double vcpu,
- @JsonProperty("memoryGb") double memoryGb,
- @JsonProperty("diskGb") double diskGb,
- @JsonProperty("count") int count) {
+ public HostCapacity(@JsonProperty("vcpu") double vcpu,
+ @JsonProperty("memoryGb") double memoryGb,
+ @JsonProperty("diskGb") double diskGb,
+ @JsonProperty("count") int count) {
this.vcpu = requirePositive("vcpu", vcpu);
this.memoryGb = requirePositive("memoryGb", memoryGb);
this.diskGb = requirePositive("diskGb", diskGb);
@@ -59,7 +59,7 @@ public class PreprovisionCapacity {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
- PreprovisionCapacity that = (PreprovisionCapacity) o;
+ HostCapacity that = (HostCapacity) o;
return Double.compare(that.vcpu, vcpu) == 0 &&
Double.compare(that.memoryGb, memoryGb) == 0 &&
Double.compare(that.diskGb, diskGb) == 0 &&
@@ -70,4 +70,4 @@ public class PreprovisionCapacity {
public int hashCode() {
return Objects.hash(vcpu, memoryGb, diskGb, count);
}
-} \ No newline at end of file
+}