diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2019-08-13 21:10:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-13 21:10:45 +0200 |
commit | 4381c58ec4061fa9eb2faa3b034da8b5cc7f6d59 (patch) | |
tree | af2e5592bd92fa5957713ed4c881bf00c7004e85 /controller-server | |
parent | 67a41ec6c320c5fc4030b0842e10ad9ad8590f76 (diff) | |
parent | 5024cc9a387ab8f9c02e3f73d825db46957e0391 (diff) |
Merge pull request #10259 from vespa-engine/mpolden/cleanup
Clean up ConfigServer interface
Diffstat (limited to 'controller-server')
2 files changed, 5 insertions, 8 deletions
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()); } |