diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-06-12 13:04:16 +0200 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-06-12 13:58:50 +0200 |
commit | 437f5d3d7f9dea815e34ccc0d00694ed5bb8cea9 (patch) | |
tree | 551663cd130360c967257b76eb7f2188c70d3f59 /controller-server | |
parent | 64755b214c236b41664e47c8a38dc98982cff52b (diff) |
Filter on emptiness of endpoint map
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java | 5 |
1 files changed, 3 insertions, 2 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 6eadfbd5974..c42363033aa 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 @@ -543,7 +543,7 @@ public class ApplicationController { } } - /** Returns the non-empty endpoints of the clusters in the deployment, or empty if the request fails. */ + /** Returns the non-empty endpoints per cluster in the given deployment, or empty if endpoints can't be found. */ public Optional<Map<ClusterSpec.Id, URI>> clusterEndpoints(DeploymentId id) { if ( ! get(id.applicationId()) .map(application -> application.deployments().containsKey(id.zoneId())) @@ -557,7 +557,8 @@ public class ApplicationController { .filter(policy -> policy.endpointIn(controller.system()).scope() == Endpoint.Scope.zone) .collect(Collectors.toUnmodifiableMap(policy -> policy.cluster(), policy -> policy.endpointIn(controller.system()).url()))) - .or(() -> Optional.of(routingGenerator.clusterEndpoints(id))); + .or(() -> Optional.of(routingGenerator.clusterEndpoints(id))) + .filter(endpoints -> ! endpoints.isEmpty()); } catch (RuntimeException e) { log.log(Level.WARNING, "Failed to get endpoint information for " + id + ": " |