summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2018-01-05 20:14:40 +0100
committerGitHub <noreply@github.com>2018-01-05 20:14:40 +0100
commit2c19d9340e817bbbbe1054239789478c326b07c8 (patch)
treee84bfdafb1af6bb2377dc5103bc02e1c4d6884a4
parent715063aff6ab219cb8344255b79671427c518d57 (diff)
parentda649caa23f3efd65dbe8e35c54e3a847018d30f (diff)
Merge pull request #4542 from vespa-engine/jvenstad/zone-cleanup-5
vargargs for some filters
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneFilterMock.java10
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneList.java10
2 files changed, 10 insertions, 10 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneFilterMock.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneFilterMock.java
index e68bf0ccc24..a7d51fa4d24 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneFilterMock.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneFilterMock.java
@@ -46,17 +46,17 @@ public class ZoneFilterMock implements ZoneList {
}
@Override
- public ZoneList in(Environment environment) {
- return filter(zoneId -> zoneId.environment() == environment);
+ public ZoneList in(Environment... environments) {
+ return filter(zoneId -> new HashSet<>(Arrays.asList(environments)).contains(zoneId.environment()));
}
@Override
- public ZoneList in(RegionName region) {
- return filter(zoneId -> zoneId.region().equals(region));
+ public ZoneList in(RegionName... regions) {
+ return filter(zoneId -> new HashSet<>(Arrays.asList(regions)).contains(zoneId.region()));
}
@Override
- public ZoneList zones(ZoneId... zones) {
+ public ZoneList among(ZoneId... zones) {
return filter(zoneId -> new HashSet<>(Arrays.asList(zones)).contains(zoneId));
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneList.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneList.java
index cd263769864..408168e41da 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneList.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/zone/ZoneList.java
@@ -19,14 +19,14 @@ public interface ZoneList extends ZoneFilter {
@Override
ZoneList not();
- /** Zones in the given environment. */
- ZoneList in(Environment environment);
+ /** Zones in one of the given environments. */
+ ZoneList in(Environment... environments);
- /** Zones in the given region. */
- ZoneList in(RegionName region);
+ /** Zones in one of the given regions. */
+ ZoneList in(RegionName... regions);
/** Only the given zones — combine with not() for best effect! */
- ZoneList zones(ZoneId... zones);
+ ZoneList among(ZoneId... zones);
/** Returns the id of all zones in this list as — you guessed it — a list. */
List<ZoneId> ids();