aboutsummaryrefslogtreecommitdiffstats
path: root/flags/src/main/java
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@yahooinc.com>2023-11-02 16:52:56 +0100
committerHåkon Hallingstad <hakon@yahooinc.com>2023-11-02 16:52:56 +0100
commitb02d1228c2e0d957651c094a3af367d6229d2ae3 (patch)
tree84a4f16dbc1850385d48251253807cd8b2e3eb08 /flags/src/main/java
parentef89054d86570de1934d34e880b4827a310b9269 (diff)
Retire if there are shared hosts dedicated to cluster type
Diffstat (limited to 'flags/src/main/java')
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/custom/SharedHost.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/custom/SharedHost.java b/flags/src/main/java/com/yahoo/vespa/flags/custom/SharedHost.java
index 3f6b20ccfa4..66356d979a4 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/custom/SharedHost.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/custom/SharedHost.java
@@ -41,9 +41,16 @@ public class SharedHost {
return resources.isEmpty() ? null : resources;
}
+ /** Whether there are any shared hosts specifically for the given cluster type, or without a cluster type restriction. */
@JsonIgnore
- public boolean isEnabled(String clusterType) {
- return resources.stream().anyMatch(hr -> hr.satisfiesClusterType(clusterType));
+ public boolean supportsClusterType(String clusterType) {
+ return resources.stream().anyMatch(resource -> resource.clusterType().map(clusterType::equalsIgnoreCase).orElse(true));
+ }
+
+ /** Whether there are any shared hosts specifically for the given cluster type. */
+ @JsonIgnore
+ public boolean hasClusterType(String clusterType) {
+ return resources.stream().anyMatch(resource -> resource.clusterType().map(clusterType::equalsIgnoreCase).orElse(false));
}
@JsonIgnore