aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2019-08-13 21:10:45 +0200
committerGitHub <noreply@github.com>2019-08-13 21:10:45 +0200
commit4381c58ec4061fa9eb2faa3b034da8b5cc7f6d59 (patch)
treeaf2e5592bd92fa5957713ed4c881bf00c7004e85
parent67a41ec6c320c5fc4030b0842e10ad9ad8590f76 (diff)
parent5024cc9a387ab8f9c02e3f73d825db46957e0391 (diff)
Merge pull request #10259 from vespa-engine/mpolden/cleanup
Clean up ConfigServer interface
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java19
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java10
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java3
3 files changed, 8 insertions, 24 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java
index 688cf275892..88ce8c41561 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java
@@ -4,15 +4,14 @@ package com.yahoo.vespa.hosted.controller.api.integration.configserver;
import com.yahoo.component.Version;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.zone.ZoneId;
+import com.yahoo.vespa.hosted.controller.api.application.v4.model.ClusterMetrics;
import com.yahoo.vespa.hosted.controller.api.application.v4.model.DeployOptions;
import com.yahoo.vespa.hosted.controller.api.application.v4.model.EndpointStatus;
-import com.yahoo.vespa.hosted.controller.api.application.v4.model.ClusterMetrics;
import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
import com.yahoo.vespa.hosted.controller.api.identifiers.Hostname;
import com.yahoo.vespa.hosted.controller.api.integration.certificates.ApplicationCertificate;
import com.yahoo.vespa.serviceview.bindings.ApplicationView;
-import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
@@ -55,10 +54,8 @@ public interface ConfigServer {
* @param deployment The application/zone pair
* @param endpoint The endpoint to modify
* @param status The new status with metadata
- * @throws IOException If trouble contacting the server
*/
- // TODO: Remove checked exception from signature
- void setGlobalRotationStatus(DeploymentId deployment, String endpoint, EndpointStatus status) throws IOException;
+ void setGlobalRotationStatus(DeploymentId deployment, String endpoint, EndpointStatus status);
/**
* Get the endpoint status for an app in one zone
@@ -66,25 +63,15 @@ public interface ConfigServer {
* @param deployment The application/zone pair
* @param endpoint The endpoint to modify
* @return The endpoint status with metadata
- * @throws IOException If trouble contacting the server
*/
- // TODO: Remove checked exception from signature
- EndpointStatus getGlobalRotationStatus(DeploymentId deployment, String endpoint) throws IOException;
+ EndpointStatus getGlobalRotationStatus(DeploymentId deployment, String endpoint);
/** The node repository on this config server */
NodeRepository nodeRepository();
- /** Get service convergence status for given deployment */
- default Optional<ServiceConvergence> serviceConvergence(DeploymentId deployment) {
- return serviceConvergence(deployment, Optional.empty());
- }
-
/** Get service convergence status for given deployment, using the nodes in the model at the given Vespa version. */
Optional<ServiceConvergence> serviceConvergence(DeploymentId deployment, Optional<Version> version);
- /** Get all load balancers in given zone */
- List<LoadBalancer> getLoadBalancers(ZoneId zone);
-
/** Get all load balancers for application in given zone */
List<LoadBalancer> getLoadBalancers(ApplicationId application, ZoneId zone);
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 c7f42a4aff2..bbe766b86de 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
@@ -78,8 +78,6 @@ import com.yahoo.vespa.hosted.controller.versions.VespaVersion;
import com.yahoo.vespa.hosted.rotation.config.RotationsConfig;
import com.yahoo.yolean.Exceptions;
-import java.io.IOException;
-import java.io.UncheckedIOException;
import java.net.URI;
import java.security.Principal;
import java.time.Clock;
@@ -214,8 +212,8 @@ public class ApplicationController {
try {
configServer.setGlobalRotationStatus(deployment, endpoint.upstreamName(), status);
return endpoint;
- } catch (IOException e) {
- throw new UncheckedIOException("Failed to set rotation status of " + deployment, e);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to set rotation status of " + deployment, e);
}
}).orElseThrow(() -> new IllegalArgumentException("No global endpoint exists for " + deployment));
}
@@ -226,8 +224,8 @@ public class ApplicationController {
try {
EndpointStatus status = configServer.getGlobalRotationStatus(deployment, endpoint.upstreamName());
return Map.of(endpoint, status);
- } catch (IOException e) {
- throw new UncheckedIOException("Failed to get rotation status of " + deployment, e);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to get rotation status of " + deployment, e);
}
}).orElseGet(Collections::emptyMap);
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
index fbc7bf20a24..b692500e40f 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
@@ -205,8 +205,7 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer
disallowConvergenceCheckApplications.add(applicationId);
}
- @Override
- public List<LoadBalancer> getLoadBalancers(ZoneId zone) {
+ private List<LoadBalancer> getLoadBalancers(ZoneId zone) {
return loadBalancers.getOrDefault(zone, Collections.emptyList());
}