summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2020-02-28 14:49:23 +0100
committerGitHub <noreply@github.com>2020-02-28 14:49:23 +0100
commitaea10120b5a1d75aa9ae050a58443fa9a7a988d2 (patch)
tree4d7495071bc7fde8063bab9402e28ba88b895cdf /controller-api
parent6480ed1293ea19a2018feb522cad6f172ee2ffe9 (diff)
parent83369e100a196260bf5f47d5d4d5a7d2080629a8 (diff)
Merge pull request #12378 from vespa-engine/mpolden/prefer-routing-generator-endpoint
Prefer endpoints from routing generator
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingGeneratorMock.java21
1 files changed, 0 insertions, 21 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingGeneratorMock.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingGeneratorMock.java
index c335b55729a..e768a090188 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingGeneratorMock.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingGeneratorMock.java
@@ -2,9 +2,7 @@
package com.yahoo.vespa.hosted.controller.api.integration.routing;
import com.yahoo.config.provision.ClusterSpec;
-import com.yahoo.config.provision.zone.RoutingMethod;
import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
-import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry;
import java.net.URI;
import java.util.List;
@@ -21,29 +19,10 @@ import java.util.stream.Collectors;
// TODO(mpolden): Remove
public class RoutingGeneratorMock implements RoutingGenerator {
- public static final List<RoutingEndpoint> TEST_ENDPOINTS =
- List.of(new RoutingEndpoint("http://old-endpoint.vespa.yahooapis.com:4080", "host1", false, "upstream3"),
- new RoutingEndpoint("http://qrs-endpoint.vespa.yahooapis.com:4080", "host1", false, "upstream1"),
- new RoutingEndpoint("http://feeding-endpoint.vespa.yahooapis.com:4080", "host2", false, "upstream2"),
- new RoutingEndpoint("http://global-endpoint.vespa.yahooapis.com:4080", "host1", true, "upstream1"),
- new RoutingEndpoint("http://alias-endpoint.vespa.yahooapis.com:4080", "host1", true, "upstream1"));
-
private final Map<DeploymentId, List<RoutingEndpoint>> routingTable = new ConcurrentHashMap<>();
- private final List<RoutingEndpoint> defaultEndpoints;
- private final ZoneRegistry zoneRegistry;
-
- public RoutingGeneratorMock(List<RoutingEndpoint> endpoints, ZoneRegistry zoneRegistry) {
- this.defaultEndpoints = List.copyOf(endpoints);
- this.zoneRegistry = zoneRegistry;
- }
@Override
public List<RoutingEndpoint> endpoints(DeploymentId deployment) {
- if (!zoneRegistry.zones().routingMethod(RoutingMethod.shared).ids().contains(deployment.zoneId())) {
- throw new IllegalArgumentException(deployment.zoneId() + " does not support routing method " +
- RoutingMethod.shared);
- }
- if (routingTable.isEmpty()) return defaultEndpoints;
return routingTable.getOrDefault(deployment, List.of());
}