diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2018-06-22 08:50:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-22 08:50:50 +0200 |
commit | 0041440b22ea63f22d4848f62fa690babc2b872e (patch) | |
tree | 97c53b943efa9542aa239ebf487a5b543b579149 | |
parent | 35f7edea4453df5b74fdb407a90e069239ce1817 (diff) | |
parent | 0a49b88207911860a9c3babb3c9c341c23a505cc (diff) |
Merge pull request #6262 from vespa-engine/revert-6253-freva/add-log-store
Revert "Inject LogStore"
6 files changed, 14 insertions, 83 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/LogStore.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/LogStore.java index a4093bc80af..0a7bacefffb 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/LogStore.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/LogStore.java @@ -1,29 +1,19 @@ package com.yahoo.vespa.hosted.controller.api.integration; import com.yahoo.config.provision.ApplicationId; -import com.yahoo.vespa.hosted.controller.api.integration.configserver.PrepareResponse; import com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType; +import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId; +// TODO jvenstad: Change most of this. public interface LogStore { - /** @return the test log of the given deployment job. */ - String getTestLog(ApplicationId applicationId, JobType jobType, long buildId); + /** Returns the log of the given deployment job. */ + String getTestLog(ApplicationId application, JobType jobType, int build); - /** Stores the given test log for the given deployment job. */ - void setTestLog(ApplicationId applicationId, JobType jobType, long buildId, String testLog); + /** Stores the given log for the given deployment job. */ + void setTestLog(ApplicationId application, JobType jobType, int build, String log); - /** @return the convergence log of the given deployment job. */ - String getConvergenceLog(ApplicationId applicationId, JobType jobType, long buildId); + /** Deletes the log for the given deployment job. */ + void deleteTestLog(ApplicationId application, JobType jobType, int build); - /** Stores the given convergence log for the given deployment job. */ - void setConvergenceLog(ApplicationId applicationId, JobType jobType, long buildId, String convergenceLog); - - /** @return the result of prepare of the test application for the given deployment job. */ - PrepareResponse getPrepareResponse(ApplicationId applicationId, JobType jobType, long buildId); - - /** Stores the given result of prepare of the test application for the given deployment job. */ - void setPrepareResponse(ApplicationId applicationId, JobType jobType, long buildId, PrepareResponse prepareResponse); - - /** Deletes all data associated with test of a given deployment job */ - void deleteTestData(ApplicationId applicationId, JobType jobType, long buildId); } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockLogStore.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockLogStore.java deleted file mode 100644 index 9ec547c2e0e..00000000000 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockLogStore.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2018 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.stubs; - -import com.yahoo.config.provision.ApplicationId; -import com.yahoo.vespa.hosted.controller.api.application.v4.model.configserverbindings.ConfigChangeActions; -import com.yahoo.vespa.hosted.controller.api.identifiers.TenantId; -import com.yahoo.vespa.hosted.controller.api.integration.LogStore; -import com.yahoo.vespa.hosted.controller.api.integration.configserver.PrepareResponse; -import com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType; - -import java.util.Collections; - -/** - * @author freva - */ -public class MockLogStore implements LogStore { - @Override - public String getTestLog(ApplicationId applicationId, JobType jobType, long buildId) { - return "SUCCESS"; - } - - @Override - public void setTestLog(ApplicationId applicationId, JobType jobType, long buildId, String testLog) { - - } - - @Override - public String getConvergenceLog(ApplicationId applicationId, JobType jobType, long buildId) { - return "SUCCESS"; - } - - @Override - public void setConvergenceLog(ApplicationId applicationId, JobType jobType, long buildId, String convergenceLog) { - - } - - @Override - public PrepareResponse getPrepareResponse(ApplicationId applicationId, JobType jobType, long buildId) { - PrepareResponse prepareResponse = new PrepareResponse(); - prepareResponse.message = "foo"; - prepareResponse.configChangeActions = new ConfigChangeActions(Collections.emptyList(), - Collections.emptyList()); - prepareResponse.tenant = new TenantId("tenant"); - return prepareResponse; } - - @Override - public void setPrepareResponse(ApplicationId applicationId, JobType jobType, long buildId, PrepareResponse prepareResponse) { - - } - - @Override - public void deleteTestData(ApplicationId applicationId, JobType jobType, long buildId) { - - } -} diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Controller.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Controller.java index c90ab5d19ba..3f5f3369c0a 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Controller.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Controller.java @@ -12,7 +12,6 @@ import com.yahoo.vespa.curator.Lock; import com.yahoo.vespa.hosted.controller.api.identifiers.Property; import com.yahoo.vespa.hosted.controller.api.identifiers.PropertyId; import com.yahoo.vespa.hosted.controller.api.integration.BuildService; -import com.yahoo.vespa.hosted.controller.api.integration.LogStore; import com.yahoo.vespa.hosted.controller.api.integration.MetricsService; import com.yahoo.vespa.hosted.controller.api.integration.athenz.AthenzClientFactory; import com.yahoo.vespa.hosted.controller.api.integration.chef.Chef; @@ -89,12 +88,12 @@ public class Controller extends AbstractComponent { ZoneRegistry zoneRegistry, ConfigServer configServer, MetricsService metricsService, NameService nameService, RoutingGenerator routingGenerator, Chef chef, AthenzClientFactory athenzClientFactory, - ArtifactRepository artifactRepository, BuildService buildService, LogStore logStore) { + ArtifactRepository artifactRepository, BuildService buildService) { this(curator, rotationsConfig, gitHub, entityService, organization, globalRoutingService, zoneRegistry, configServer, metricsService, nameService, routingGenerator, chef, Clock.systemUTC(), athenzClientFactory, artifactRepository, buildService, - logStore, com.yahoo.net.HostName::getLocalhost); + com.yahoo.net.HostName::getLocalhost); } public Controller(CuratorDb curator, RotationsConfig rotationsConfig, @@ -104,7 +103,7 @@ public class Controller extends AbstractComponent { MetricsService metricsService, NameService nameService, RoutingGenerator routingGenerator, Chef chef, Clock clock, AthenzClientFactory athenzClientFactory, ArtifactRepository artifactRepository, - BuildService buildService, LogStore logStore, Supplier<String> hostnameSupplier) { + BuildService buildService, Supplier<String> hostnameSupplier) { this.hostnameSupplier = Objects.requireNonNull(hostnameSupplier, "HostnameSupplier cannot be null"); this.curator = Objects.requireNonNull(curator, "Curator cannot be null"); @@ -119,7 +118,7 @@ public class Controller extends AbstractComponent { this.clock = Objects.requireNonNull(clock, "Clock cannot be null"); this.athenzClientFactory = Objects.requireNonNull(athenzClientFactory, "AthenzClientFactory cannot be null"); - jobController = new JobController(this, logStore); + jobController = new JobController(this); applicationController = new ApplicationController(this, curator, athenzClientFactory, Objects.requireNonNull(rotationsConfig, "RotationsConfig cannot be null"), Objects.requireNonNull(nameService, "NameService cannot be null"), diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java index 4da13632eef..2d1040f7095 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java @@ -22,9 +22,9 @@ public class JobController { private final Controller controller; private final LogStore logs; - public JobController(Controller controller, LogStore logStore) { + public JobController(Controller controller) { this.controller = controller; - this.logs = logStore; + this.logs = null; } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java index e6ca68c90e1..d3b70ea07d8 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java @@ -24,7 +24,6 @@ import com.yahoo.vespa.hosted.controller.api.integration.github.GitHubMock; import com.yahoo.vespa.hosted.controller.api.integration.organization.MockOrganization; import com.yahoo.vespa.hosted.controller.api.integration.routing.MemoryGlobalRoutingService; import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockBuildService; -import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockLogStore; import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId; import com.yahoo.vespa.hosted.controller.application.ApplicationPackage; import com.yahoo.vespa.hosted.controller.athenz.mock.AthenzClientFactoryMock; @@ -281,7 +280,6 @@ public final class ControllerTester { new AthenzClientFactoryMock(athensDb), artifactRepository, buildService, - new MockLogStore(), () -> "test-controller"); controller.updateVersionStatus(VersionStatus.compute(controller)); return controller; diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/ControllerContainerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/ControllerContainerTest.java index a79c830f3d4..833e2d8b552 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/ControllerContainerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/ControllerContainerTest.java @@ -68,7 +68,6 @@ public class ControllerContainerTest { " <component id='com.yahoo.vespa.hosted.controller.api.integration.routing.MemoryGlobalRoutingService'/>\n" + " <component id='com.yahoo.vespa.hosted.controller.api.integration.stubs.LoggingDeploymentIssues'/>\n" + " <component id='com.yahoo.vespa.hosted.controller.api.integration.stubs.DummyOwnershipIssues'/>\n" + - " <component id='com.yahoo.vespa.hosted.controller.api.integration.stubs.MockLogStore'/>\n" + " <component id='com.yahoo.vespa.hosted.controller.api.integration.organization.MockOrganization'/>\n" + " <component id='com.yahoo.vespa.hosted.controller.ConfigServerMock'/>\n" + " <component id='com.yahoo.vespa.hosted.controller.NodeRepositoryClientMock'/>\n" + |