aboutsummaryrefslogtreecommitdiffstats
path: root/config-provisioning/src/main/java/com/yahoo/config/provision/Exclusivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-provisioning/src/main/java/com/yahoo/config/provision/Exclusivity.java')
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/Exclusivity.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/Exclusivity.java b/config-provisioning/src/main/java/com/yahoo/config/provision/Exclusivity.java
index 40122c17c3f..6aafb20bee2 100644
--- a/config-provisioning/src/main/java/com/yahoo/config/provision/Exclusivity.java
+++ b/config-provisioning/src/main/java/com/yahoo/config/provision/Exclusivity.java
@@ -1,10 +1,5 @@
package com.yahoo.config.provision;
-import com.yahoo.vespa.flags.FlagSource;
-import com.yahoo.vespa.flags.JacksonFlag;
-import com.yahoo.vespa.flags.PermanentFlags;
-import com.yahoo.vespa.flags.custom.SharedHost;
-
/**
* A class which can be asked if allocations should be exclusive.
*
@@ -13,16 +8,16 @@ import com.yahoo.vespa.flags.custom.SharedHost;
public class Exclusivity {
private final Zone zone;
- private final JacksonFlag<SharedHost> sharedHosts;
+ private final SharedHosts sharedHost;
- public Exclusivity(Zone zone, FlagSource flagSource) {
+ public Exclusivity(Zone zone, SharedHosts sharedHost) {
this.zone = zone;
- this.sharedHosts = PermanentFlags.SHARED_HOST.bindTo(flagSource);
+ this.sharedHost = sharedHost;
}
/** Returns whether nodes must be allocated to hosts that are exclusive to the cluster type. */
public boolean clusterType(ClusterSpec cluster) {
- return sharedHosts.value().hasClusterType(cluster.type().name());
+ return sharedHost.hasClusterType(cluster.type());
}
/** Returns whether the nodes of this cluster must be running on hosts that are specifically provisioned for the application. */
@@ -38,7 +33,7 @@ public class Exclusivity {
public boolean allocation(ClusterSpec clusterSpec) {
return clusterSpec.isExclusive() ||
( clusterSpec.type().isContainer() && zone.system().isPublic() && !zone.environment().isTest() ) ||
- ( !zone.cloud().allowHostSharing() && !sharedHosts.value().supportsClusterType(clusterSpec.type().name()));
+ ( !zone.cloud().allowHostSharing() && !sharedHost.supportsClusterType(clusterSpec.type()));
}
}