summaryrefslogtreecommitdiffstats
path: root/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java
diff options
context:
space:
mode:
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.java26
1 files changed, 7 insertions, 19 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 35ee538178a..8ed56b98705 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
@@ -1,7 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.provision;
-import com.google.common.collect.ImmutableSortedSet;
import com.yahoo.component.Version;
import java.util.Objects;
@@ -23,19 +22,13 @@ public final class ClusterSpec {
private final Optional<Group> groupId;
private final Version vespaVersion;
private boolean exclusive;
- private final Set<RotationName> rotations;
- private ClusterSpec(Type type, Id id, Optional<Group> groupId, Version vespaVersion, boolean exclusive,
- Set<RotationName> rotations) {
- if (type != Type.container && !rotations.isEmpty()) {
- throw new IllegalArgumentException("Rotations can only be declared for clusters of type " + Type.container);
- }
+ private ClusterSpec(Type type, Id id, Optional<Group> groupId, Version vespaVersion, boolean exclusive) {
this.type = type;
this.id = id;
this.groupId = groupId;
this.vespaVersion = vespaVersion;
this.exclusive = exclusive;
- this.rotations = ImmutableSortedSet.copyOf(rotations);
}
/** Returns the cluster type */
@@ -57,35 +50,30 @@ public final class ClusterSpec {
*/
public boolean isExclusive() { return exclusive; }
- /** Returns the rotations of which this cluster should be a member */
- public Set<RotationName> rotations() {
- return rotations;
- }
-
public ClusterSpec with(Optional<Group> newGroup) {
- return new ClusterSpec(type, id, newGroup, vespaVersion, exclusive, rotations);
+ return new ClusterSpec(type, id, newGroup, vespaVersion, exclusive);
}
public ClusterSpec exclusive(boolean exclusive) {
- return new ClusterSpec(type, id, groupId, vespaVersion, exclusive, rotations);
+ return new ClusterSpec(type, id, groupId, vespaVersion, exclusive);
}
public static ClusterSpec request(Type type, Id id, Version vespaVersion, boolean exclusive) {
- return new ClusterSpec(type, id, Optional.empty(), vespaVersion, exclusive, Set.of());
+ return new ClusterSpec(type, id, Optional.empty(), vespaVersion, exclusive);
}
// TODO: Remove after June 2019
public static ClusterSpec request(Type type, Id id, Version vespaVersion, boolean exclusive, Set<RotationName> rotations) {
- return new ClusterSpec(type, id, Optional.empty(), vespaVersion, exclusive, rotations);
+ return new ClusterSpec(type, id, Optional.empty(), vespaVersion, exclusive);
}
public static ClusterSpec from(Type type, Id id, Group groupId, Version vespaVersion, boolean exclusive) {
- return new ClusterSpec(type, id, Optional.of(groupId), vespaVersion, exclusive, Set.of());
+ return new ClusterSpec(type, id, Optional.of(groupId), vespaVersion, exclusive);
}
// TODO: Remove after June 2019
public static ClusterSpec from(Type type, Id id, Group groupId, Version vespaVersion, boolean exclusive, Set<RotationName> rotations) {
- return new ClusterSpec(type, id, Optional.of(groupId), vespaVersion, exclusive, rotations);
+ return new ClusterSpec(type, id, Optional.of(groupId), vespaVersion, exclusive);
}
@Override