summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2020-02-28 10:41:01 +0100
committerMartin Polden <mpolden@mpolden.no>2020-04-06 09:43:18 +0200
commitab0dfd64dfdd3889959d8459cc9fb0c320ecf047 (patch)
tree3bc4970727338a2754d41603027c53dd453cc0ad /controller-api
parentdd48066e6957a34e6a85bc425f759d1650b9a2b5 (diff)
Remove RoutingGenerator
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java4
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingEndpoint.java60
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingGenerator.java27
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingGeneratorMock.java45
4 files changed, 0 insertions, 136 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
index 978a00fbccf..ca939023245 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
@@ -20,7 +20,6 @@ import com.yahoo.vespa.hosted.controller.api.integration.resource.CostReportCons
import com.yahoo.vespa.hosted.controller.api.integration.resource.MeteringClient;
import com.yahoo.vespa.hosted.controller.api.integration.resource.TenantCost;
import com.yahoo.vespa.hosted.controller.api.integration.routing.GlobalRoutingService;
-import com.yahoo.vespa.hosted.controller.api.integration.routing.RoutingGenerator;
import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry;
import java.time.Clock;
@@ -41,9 +40,6 @@ public interface ServiceRegistry {
GlobalRoutingService globalRoutingService();
- // TODO(mpolden): Remove
- RoutingGenerator routingGenerator();
-
Mailer mailer();
EndpointCertificateProvider endpointCertificateProvider();
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingEndpoint.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingEndpoint.java
deleted file mode 100644
index c0ccd0722f3..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingEndpoint.java
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.hosted.controller.api.integration.routing;
-
-import java.util.Objects;
-
-/**
- * @author smorgrav
- */
-// TODO(mpolden): Remove together with RoutingGenerator and its implementations
-public class RoutingEndpoint {
-
- private final boolean isGlobal;
- private final String endpoint;
- private final String hostname;
- private final String upstreamName;
-
- public RoutingEndpoint(String endpoint, String hostname, boolean isGlobal, String upstreamName) {
- this.endpoint = endpoint;
- this.hostname = hostname;
- this.isGlobal = isGlobal;
- this.upstreamName = upstreamName;
- }
-
- /** Whether this is a global endpoint */
- public boolean isGlobal() {
- return isGlobal;
- }
-
- /** URL for this endpoint */
- public String endpoint() {
- return endpoint;
- }
-
- /** First hostname for an upstream behind this endpoint */
- public String hostname() {
- return hostname;
- }
-
- /** The upstream name of this endpoint */
- public String upstreamName() {
- return upstreamName;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- RoutingEndpoint that = (RoutingEndpoint) o;
- return isGlobal == that.isGlobal &&
- endpoint.equals(that.endpoint) &&
- hostname.equals(that.hostname) &&
- upstreamName.equals(that.upstreamName);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(isGlobal, endpoint, hostname, upstreamName);
- }
-
-}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingGenerator.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingGenerator.java
deleted file mode 100644
index 8150a99979e..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingGenerator.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.hosted.controller.api.integration.routing;
-
-import com.yahoo.config.provision.ClusterSpec;
-import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
-
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author bratseth
- * @author smorgrav
- */
-// TODO(mpolden): Remove
-public interface RoutingGenerator {
-
- /**
- * @param deploymentId Specifying an application in a zone
- * @return List of endpoints for that deploymentId
- */
- List<RoutingEndpoint> endpoints(DeploymentId deploymentId);
-
- /** Returns the endpoints of each cluster in the given deployment — nothing global. */
- Map<ClusterSpec.Id, URI> clusterEndpoints(DeploymentId deploymentId);
-
-}
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
deleted file mode 100644
index e768a090188..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/routing/RoutingGeneratorMock.java
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.hosted.controller.api.integration.routing;
-
-import com.yahoo.config.provision.ClusterSpec;
-import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
-
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
-
-/**
- * Returns a default set of endpoints on every query if it has no mappings, or those added by the user, otherwise.
- *
- * @author bratseth
- * @author jonmv
- */
-// TODO(mpolden): Remove
-public class RoutingGeneratorMock implements RoutingGenerator {
-
- private final Map<DeploymentId, List<RoutingEndpoint>> routingTable = new ConcurrentHashMap<>();
-
- @Override
- public List<RoutingEndpoint> endpoints(DeploymentId deployment) {
- return routingTable.getOrDefault(deployment, List.of());
- }
-
- @Override
- public Map<ClusterSpec.Id, URI> clusterEndpoints(DeploymentId deployment) {
- return endpoints(deployment).stream()
- .limit(1)
- .collect(Collectors.toMap(__ -> ClusterSpec.Id.from("default"),
- endpoint -> URI.create(endpoint.endpoint())));
- }
-
- public void putEndpoints(DeploymentId deployment, List<RoutingEndpoint> endpoints) {
- routingTable.put(deployment, endpoints);
- }
-
- public void removeEndpoints(DeploymentId deployment) {
- routingTable.remove(deployment);
- }
-
-}