summaryrefslogtreecommitdiffstats
path: root/config-provisioning
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2022-06-22 17:06:58 +0200
committerjonmv <venstad@gmail.com>2022-06-22 17:06:58 +0200
commit5be9df33cf7f84d27dfd7a1c4cc18aebcd6a5547 (patch)
tree9c99d92326dd3ffe5c55dcc67da1c0bad433ea45 /config-provisioning
parent587d2b646501a434ed79d8c520487141b93fda8b (diff)
Clean up ZoneFilter/List
Diffstat (limited to 'config-provisioning')
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/zone/ZoneFilter.java18
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/zone/ZoneList.java10
2 files changed, 13 insertions, 15 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/zone/ZoneFilter.java b/config-provisioning/src/main/java/com/yahoo/config/provision/zone/ZoneFilter.java
index 058be998478..e65340aa59b 100644
--- a/config-provisioning/src/main/java/com/yahoo/config/provision/zone/ZoneFilter.java
+++ b/config-provisioning/src/main/java/com/yahoo/config/provision/zone/ZoneFilter.java
@@ -1,13 +1,12 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.provision.zone;
-import com.yahoo.config.provision.CloudName;
-
/**
* A ZoneId list which can be filtered in various ways; elements can be accessed after at least one filter.
*
* The methods here return instances of {@link ZoneList}, which extends ZoneFilter, but with accessors and additional filters.
* This forces the developer to consider which of the filters in this class to apply, prior to accessing any zones.
+ * Note: Do not add further filters, as this is only meant for the levels of configuration of the zone, not other properties.
*
* @author jonmv
*/
@@ -16,24 +15,13 @@ public interface ZoneFilter {
/** Negates the next filter. */
ZoneFilter not();
- /** Zones which are upgraded by the controller. */
- ZoneList controllerUpgraded();
-
- /** Zones where traffic is routed using given method */
- ZoneList routingMethod(RoutingMethod method);
-
/** Zones where config servers are up and running. */
ZoneList reachable();
- /** Zones where hosts must be reprovisioned to upgrade their OS */
- ZoneList reprovisionToUpgradeOs();
+ /** Zones which are upgraded by the controller. */
+ ZoneList controllerUpgraded();
/** All zones from the initial pool. */
ZoneList all();
- /** Zones in the specified cloud */
- default ZoneList ofCloud(CloudName cloud) {
- return all(); // Not implemented in this repo.
- }
-
}
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/zone/ZoneList.java b/config-provisioning/src/main/java/com/yahoo/config/provision/zone/ZoneList.java
index c6ace00b90c..ce4542cbae9 100644
--- a/config-provisioning/src/main/java/com/yahoo/config/provision/zone/ZoneList.java
+++ b/config-provisioning/src/main/java/com/yahoo/config/provision/zone/ZoneList.java
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.provision.zone;
+import com.yahoo.config.provision.CloudName;
import com.yahoo.config.provision.Environment;
import com.yahoo.config.provision.RegionName;
@@ -27,9 +28,18 @@ public interface ZoneList extends ZoneFilter {
/** Zones in one of the given regions. */
ZoneList in(RegionName... regions);
+ /** Zones in one of the given clouds. */
+ ZoneList in(CloudName... clouds);
+
/** Only the given zones — combine with not() for best effect! */
ZoneList among(ZoneId... zones);
+ /** Zones where hosts must be reprovisioned to upgrade their OS */
+ ZoneList reprovisionToUpgradeOs();
+
+ /** Zones where traffic is routed using given method */
+ ZoneList routingMethod(RoutingMethod method);
+
/** Returns the ZoneApi of all zones in this list. */
List<? extends ZoneApi> zones();