summaryrefslogtreecommitdiffstats
path: root/config-provisioning
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2022-06-27 22:00:43 +0200
committerGitHub <noreply@github.com>2022-06-27 22:00:43 +0200
commit73c88cff03651415648b63f4458df20254a5629a (patch)
tree3c50df4717c4867061059a3f41b6a6e2e8f0fefd /config-provisioning
parent24c7eee36b9c251fc754e6ca51c921e97be44aeb (diff)
Revert "Jonmv/multiple test and staging zones"
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.java16
2 files changed, 15 insertions, 19 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 e65340aa59b..058be998478 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,12 +1,13 @@
// 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
*/
@@ -15,13 +16,24 @@ 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 which are upgraded by the controller. */
- ZoneList controllerUpgraded();
+ /** Zones where hosts must be reprovisioned to upgrade their OS */
+ ZoneList reprovisionToUpgradeOs();
/** 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 0a6bdd3b6b8..c6ace00b90c 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,12 +1,10 @@
// 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;
import java.util.List;
-import java.util.Optional;
import java.util.stream.Collectors;
/**
@@ -29,23 +27,9 @@ 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 zone with the given id, if this exists. */
- default Optional<? extends ZoneApi> get(ZoneId id) {
- return among(id).zones().stream().findFirst();
- }
-
/** Returns the ZoneApi of all zones in this list. */
List<? extends ZoneApi> zones();