aboutsummaryrefslogtreecommitdiffstats
path: root/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2023-01-16 15:41:26 +0100
committerjonmv <venstad@gmail.com>2023-01-17 15:49:42 +0100
commit12ef34b0204e5acee25655139e7f6e79cefe983b (patch)
tree96c497e68be57d41f62ba9ae00b60042cf2ce32d /config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
parent69d0f324263f0075a283b66bca6fab2a12b2b66e (diff)
Parse, validate and use new zone endpoint syntax
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.java28
1 files changed, 14 insertions, 14 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 153b305dc01..196255a8342 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
@@ -24,12 +24,12 @@ public final class ClusterSpec {
private final boolean exclusive;
private final Optional<Id> combinedId;
private final Optional<DockerImage> dockerImageRepo;
- private final LoadBalancerSettings loadBalancerSettings;
+ private final ZoneEndpoint zoneEndpoint;
private final boolean stateful;
private ClusterSpec(Type type, Id id, Optional<Group> groupId, Version vespaVersion, boolean exclusive,
Optional<Id> combinedId, Optional<DockerImage> dockerImageRepo,
- LoadBalancerSettings loadBalancerSettings, boolean stateful) {
+ ZoneEndpoint zoneEndpoint, boolean stateful) {
this.type = type;
this.id = id;
this.groupId = groupId;
@@ -47,7 +47,7 @@ public final class ClusterSpec {
if (type.isContent() && !stateful) {
throw new IllegalArgumentException("Cluster of type " + type + " must be stateful");
}
- this.loadBalancerSettings = Objects.requireNonNull(loadBalancerSettings);
+ this.zoneEndpoint = Objects.requireNonNull(zoneEndpoint);
this.stateful = stateful;
}
@@ -63,8 +63,8 @@ public final class ClusterSpec {
/** Returns the docker image (repository + vespa version) we want this cluster to run */
public Optional<String> dockerImage() { return dockerImageRepo.map(repo -> repo.withTag(vespaVersion).asString()); }
- /** Returns any additional load balancer settings for application container clusters. */
- public LoadBalancerSettings loadBalancerSettings() { return loadBalancerSettings; }
+ /** Returns any additional zone endpoint settings for application container clusters. */
+ public ZoneEndpoint zoneEndpoint() { return zoneEndpoint; }
/** Returns the version of Vespa that we want this cluster to run */
public Version vespaVersion() { return vespaVersion; }
@@ -87,15 +87,15 @@ public final class ClusterSpec {
public boolean isStateful() { return stateful; }
public ClusterSpec with(Optional<Group> newGroup) {
- return new ClusterSpec(type, id, newGroup, vespaVersion, exclusive, combinedId, dockerImageRepo, loadBalancerSettings, stateful);
+ return new ClusterSpec(type, id, newGroup, vespaVersion, exclusive, combinedId, dockerImageRepo, zoneEndpoint, stateful);
}
public ClusterSpec withExclusivity(boolean exclusive) {
- return new ClusterSpec(type, id, groupId, vespaVersion, exclusive, combinedId, dockerImageRepo, loadBalancerSettings, stateful);
+ return new ClusterSpec(type, id, groupId, vespaVersion, exclusive, combinedId, dockerImageRepo, zoneEndpoint, stateful);
}
public ClusterSpec exclusive(boolean exclusive) {
- return new ClusterSpec(type, id, groupId, vespaVersion, exclusive, combinedId, dockerImageRepo, loadBalancerSettings, stateful);
+ return new ClusterSpec(type, id, groupId, vespaVersion, exclusive, combinedId, dockerImageRepo, zoneEndpoint, stateful);
}
/** Creates a ClusterSpec when requesting a cluster */
@@ -119,7 +119,7 @@ public final class ClusterSpec {
private Version vespaVersion;
private boolean exclusive = false;
private Optional<Id> combinedId = Optional.empty();
- private LoadBalancerSettings loadBalancerSettings = LoadBalancerSettings.empty;
+ private ZoneEndpoint zoneEndpoint = ZoneEndpoint.defaultEndpoint;
private boolean stateful;
private Builder(Type type, Id id, boolean specification) {
@@ -135,7 +135,7 @@ public final class ClusterSpec {
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, loadBalancerSettings, stateful);
+ return new ClusterSpec(type, id, groupId, vespaVersion, exclusive, combinedId, dockerImageRepo, zoneEndpoint, stateful);
}
public Builder group(Group groupId) {
@@ -168,8 +168,8 @@ public final class ClusterSpec {
return this;
}
- public Builder loadBalancerSettings(LoadBalancerSettings loadBalancerSettings) {
- this.loadBalancerSettings = loadBalancerSettings;
+ public Builder loadBalancerSettings(ZoneEndpoint zoneEndpoint) {
+ this.zoneEndpoint = zoneEndpoint;
return this;
}
@@ -198,12 +198,12 @@ public final class ClusterSpec {
vespaVersion.equals(that.vespaVersion) &&
combinedId.equals(that.combinedId) &&
dockerImageRepo.equals(that.dockerImageRepo) &&
- loadBalancerSettings.equals(that.loadBalancerSettings);
+ zoneEndpoint.equals(that.zoneEndpoint);
}
@Override
public int hashCode() {
- return Objects.hash(type, id, groupId, vespaVersion, exclusive, combinedId, dockerImageRepo, loadBalancerSettings, stateful);
+ return Objects.hash(type, id, groupId, vespaVersion, exclusive, combinedId, dockerImageRepo, zoneEndpoint, stateful);
}
/**