diff options
author | Martin Polden <mpolden@mpolden.no> | 2020-07-20 13:09:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-20 13:09:19 +0200 |
commit | 0120c3b992225f49aeb7396b4bbdcf78d6d83eb6 (patch) | |
tree | eb8e922f6dda60df435c2347506035c08da7ef29 /controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java | |
parent | f11e22927b86725998507ad2eee262036f2c473d (diff) | |
parent | d10891e79125ffe0f105552f51f147e85b2bd2ee (diff) |
Merge pull request #13926 from vespa-engine/mpolden/global-endpoint-cluster
Expose the target cluster of an global endpoint in application API
Diffstat (limited to 'controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java index 7f4a707949b..337e2b897f1 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java @@ -74,12 +74,12 @@ public class RoutingPolicy { Optional<Endpoint> infraEndpoint = SystemApplication.matching(id.owner()) .flatMap(app -> app.endpointIn(id.zone(), zoneRegistry)); if (infraEndpoint.isPresent()) return infraEndpoint.get(); - return endpoint(routingMethod).in(system); + return endpoint(routingMethod).target(id.cluster(), id.zone()).in(system); } /** Returns the weighted endpoint of this */ public Endpoint weightedEndpointIn(SystemName system, RoutingMethod routingMethod) { - return endpoint(routingMethod).weighted().in(system); + return endpoint(routingMethod).weighted(id.cluster(), id.zone()).in(system); } @Override @@ -104,7 +104,6 @@ public class RoutingPolicy { private Endpoint.EndpointBuilder endpoint(RoutingMethod routingMethod) { return Endpoint.of(id.owner()) - .target(id.cluster(), id.zone()) .on(Port.fromRoutingMethod(routingMethod)) .routingMethod(routingMethod); } |