diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2018-06-22 08:51:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-22 08:51:55 +0200 |
commit | 2329ea9767d6d44ddbd9c959cec5bb1212f08d5d (patch) | |
tree | bfaccaef6f0f4cf8052f573656bb57a844eb6cb9 /controller-api | |
parent | 0041440b22ea63f22d4848f62fa690babc2b872e (diff) |
Revert "Revert "Inject LogStore""
Diffstat (limited to 'controller-api')
2 files changed, 73 insertions, 8 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 0a7bacefffb..a4093bc80af 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,19 +1,29 @@ 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 { - /** Returns the log of the given deployment job. */ - String getTestLog(ApplicationId application, JobType jobType, int build); + /** @return the test log of the given deployment job. */ + String getTestLog(ApplicationId applicationId, JobType jobType, long buildId); - /** Stores the given log for the given deployment job. */ - void setTestLog(ApplicationId application, JobType jobType, int build, String log); + /** Stores the given test log for the given deployment job. */ + void setTestLog(ApplicationId applicationId, JobType jobType, long buildId, String testLog); - /** Deletes the log for the given deployment job. */ - void deleteTestLog(ApplicationId application, JobType jobType, int build); + /** @return the convergence log of the given deployment job. */ + String getConvergenceLog(ApplicationId applicationId, JobType jobType, long buildId); + /** 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 new file mode 100644 index 00000000000..9ec547c2e0e --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockLogStore.java @@ -0,0 +1,55 @@ +// 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) { + + } +} |