diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-07-16 13:22:05 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2021-07-16 13:22:05 +0200 |
commit | 3aa2d28f0a0571a2345042a44559fbaf71fcc6f2 (patch) | |
tree | 3d59962c47ec5112e535fca16475d68d4a07a04f /controller-server/src/main/java | |
parent | 236c15593258ec5e0d495332edc64468df269fc4 (diff) |
Support listing nodes for multiple applications
Diffstat (limited to 'controller-server/src/main/java')
2 files changed, 10 insertions, 11 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java index e9b4b25672a..24d9db362ef 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java @@ -277,7 +277,7 @@ public class ApplicationController { /** Reads the oldest installed platform for the given application and zone from the node repo of that zone. */ private Optional<Version> oldestInstalledPlatform(JobId job) { return configServer.nodeRepository().list(job.type().zone(controller.system()), - job.application(), + Set.of(job.application()), EnumSet.of(active, reserved)) .stream() .map(Node::currentVersion) diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index c49e3c88df3..7b17b3e44ff 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -1,7 +1,6 @@ // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.deployment; -import com.google.common.collect.ImmutableSet; import com.yahoo.component.Version; import com.yahoo.config.application.api.DeploymentInstanceSpec; import com.yahoo.config.application.api.DeploymentSpec; @@ -65,6 +64,7 @@ import java.time.Duration; import java.time.Instant; import java.util.ArrayList; import java.util.Date; +import java.util.EnumSet; import java.util.List; import java.util.Map; import java.util.Optional; @@ -313,8 +313,8 @@ public class InternalStepRunner implements StepRunner { return Optional.empty(); } List<Node> nodes = controller.serviceRegistry().configServer().nodeRepository().list(id.type().zone(controller.system()), - id.application(), - Set.of(active)); + Set.of(id.application()), + EnumSet.of(active)); List<Node> parents = controller.serviceRegistry().configServer().nodeRepository().list(id.type().zone(controller.system()), nodes.stream().map(node -> node.parentHostname().get()).collect(toList())); NodeList nodeList = NodeList.of(nodes, parents, services.get()); @@ -419,8 +419,8 @@ public class InternalStepRunner implements StepRunner { : Optional.empty(); } List<Node> nodes = controller.serviceRegistry().configServer().nodeRepository().list(zone, - testerId, - ImmutableSet.of(active, reserved)); + Set.of(testerId), + EnumSet.of(active, reserved)); List<Node> parents = controller.serviceRegistry().configServer().nodeRepository().list(zone, nodes.stream().map(node -> node.parentHostname().get()).collect(toList())); NodeList nodeList = NodeList.of(nodes, parents, services.get()); @@ -447,14 +447,13 @@ public class InternalStepRunner implements StepRunner { if ( ! endpoints.containsKey(zoneId)) return false; - return endpoints.get(zoneId).parallelStream().map(endpoint -> { + return endpoints.get(zoneId).parallelStream().allMatch(endpoint -> { boolean ready = controller.jobController().cloud().ready(endpoint.url()); - if ( ! ready) { + if (!ready) { logger.log("Failed to get 100 consecutive OKs from " + endpoint); - return Boolean.FALSE; } - return Boolean.TRUE; - }).allMatch(Boolean.TRUE::equals); + return ready; + }); } /** Returns true iff all containers in the tester deployment give 100 consecutive 200 OK responses on /status.html. */ |