aboutsummaryrefslogtreecommitdiffstats
path: root/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@vespa.ai>2023-07-09 19:14:43 +0200
committerJon Bratseth <bratseth@vespa.ai>2023-07-09 19:14:43 +0200
commitc6a0d441b4493f4cdc8a8d3e8cb221f070dfc305 (patch)
tree7ff24788826b5a5a166b4c5c2759f764165a17f6 /config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
parent3168abdd33e16054275719f1c33f3fd474413eac (diff)
Allocate all groups in one go
With many groups and dynamic allocation allocating group by group is too slow.
Diffstat (limited to 'config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java')
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java b/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
index ccc24e60edf..4a3045c9cdd 100644
--- a/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
+++ b/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
@@ -102,19 +102,18 @@ public final class ClusterSpec {
/** Creates a ClusterSpec when requesting a cluster */
public static Builder request(Type type, Id id) {
- return new Builder(type, id, false);
+ return new Builder(type, id);
}
/** Creates a ClusterSpec for an existing cluster, group id and Vespa version needs to be set */
public static Builder specification(Type type, Id id) {
- return new Builder(type, id, true);
+ return new Builder(type, id);
}
public static class Builder {
private final Type type;
private final Id id;
- private final boolean specification;
private Optional<Group> groupId = Optional.empty();
private Optional<DockerImage> dockerImageRepo = Optional.empty();
@@ -124,19 +123,13 @@ public final class ClusterSpec {
private ZoneEndpoint zoneEndpoint = ZoneEndpoint.defaultEndpoint;
private boolean stateful;
- private Builder(Type type, Id id, boolean specification) {
+ private Builder(Type type, Id id) {
this.type = type;
this.id = id;
- this.specification = specification;
this.stateful = type.isContent(); // Default to true for content clusters
}
public ClusterSpec build() {
- if (specification) {
- if (groupId.isEmpty()) throw new IllegalArgumentException("groupId is required to be set when creating a ClusterSpec with specification()");
- if (vespaVersion == null) throw new IllegalArgumentException("vespaVersion is required to be set when creating a ClusterSpec with specification()");
- } else
- if (groupId.isPresent()) throw new IllegalArgumentException("groupId is not allowed to be set when creating a ClusterSpec with request()");
return new ClusterSpec(type, id, groupId, vespaVersion, exclusive, combinedId, dockerImageRepo, zoneEndpoint, stateful);
}