diff options
author | Martin Polden <mpolden@mpolden.no> | 2022-06-09 10:57:53 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2022-06-13 10:47:53 +0200 |
commit | e046617cd9b30fa4fc2cf1fd472cc40de19d3e13 (patch) | |
tree | b256a24824959c0d478f8fdf6b8773306c64a1b7 /routing-generator/src/main | |
parent | d2f5c29433bd1b1cdea67b78af7e3c59a5341c14 (diff) |
Remove special handling of upstream name
Diffstat (limited to 'routing-generator/src/main')
-rw-r--r-- | routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/status/ServerGroup.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/status/ServerGroup.java b/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/status/ServerGroup.java index f1a87aa7106..1ce73d7de58 100644 --- a/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/status/ServerGroup.java +++ b/routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/status/ServerGroup.java @@ -1,14 +1,13 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.routing.status; -import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** - * A group servers behind a router/reverse proxy. + * A group of servers behind a router/reverse proxy. * * @author mpolden */ @@ -29,11 +28,7 @@ public class ServerGroup { /** Returns whether given upstream is healthy */ public boolean isHealthy(String upstreamName) { - // TODO(mpolden): Look up key directly here once layer 4 config (and thus "-feed" upstreams) are gone - List<Server> upstreamServers = servers.values().stream() - .flatMap(Collection::stream) - .filter(server -> upstreamName.startsWith(server.upstreamName())) - .collect(Collectors.toList()); + List<Server> upstreamServers = servers.getOrDefault(upstreamName, List.of()); long upCount = upstreamServers.stream() .filter(Server::up) .count(); |