diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2018-01-16 12:00:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-16 12:00:32 +0100 |
commit | 763cc52c0eab484afeeb7ce0a73b7b1d2b1d3a6a (patch) | |
tree | 96ae2c31391c3b7215758f0e2375fa78f9de502a /configserver | |
parent | ce8d0e4aa4890d6cf3e405e2eb395a53fc10ab66 (diff) | |
parent | a7295435da81b348a89c456008e3da773de9b5c6 (diff) |
Merge pull request #4672 from vespa-engine/hmusum/ask-config-servers-to-download-files
Ask other config servers to start downloading files
Diffstat (limited to 'configserver')
3 files changed, 21 insertions, 7 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/CombinedLegacyDistribution.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/CombinedLegacyDistribution.java index 819f9a9d5d6..155479a7fd1 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/CombinedLegacyDistribution.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/CombinedLegacyDistribution.java @@ -8,8 +8,8 @@ import com.yahoo.jrt.Spec; import com.yahoo.jrt.StringArray; import com.yahoo.jrt.Supervisor; import com.yahoo.jrt.Target; -import com.yahoo.jrt.Transport; import com.yahoo.log.LogLevel; +import com.yahoo.vespa.model.ConfigProxy; import java.util.Collection; import java.util.Set; @@ -36,10 +36,14 @@ public class CombinedLegacyDistribution implements FileDistribution { legacy.sendDeployedFiles(hostName, fileReferences); } - @Override public void startDownload(String hostName, Set<FileReference> fileReferences) { + startDownload(hostName, ConfigProxy.BASEPORT, fileReferences); + } + + @Override + public void startDownload(String hostName, int port, Set<FileReference> fileReferences) { if (disableFileDistributor) - startDownloadingFileReferences(hostName, fileReferences); + startDownloadingFileReferences(hostName, port, fileReferences); } @Override @@ -54,8 +58,8 @@ public class CombinedLegacyDistribution implements FileDistribution { // Notifies config proxy which file references it should start downloading. It's OK if the call does not succeed, // as downloading will then start synchronously when a service requests a file reference instead - private void startDownloadingFileReferences(String hostName, Set<FileReference> fileReferences) { - Target target = supervisor.connect(new Spec(hostName, 19090)); + private void startDownloadingFileReferences(String hostName, int port, Set<FileReference> fileReferences) { + Target target = supervisor.connect(new Spec(hostName, port)); double timeout = 0.1; Request request = new Request("filedistribution.setFileReferencesToDownload"); request.parameters().add(new StringArray(fileReferences.stream().map(FileReference::value).toArray(String[]::new))); diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBHandler.java index 9b3f4c39a45..7dea85c59c3 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBHandler.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBHandler.java @@ -29,12 +29,16 @@ public class FileDBHandler implements FileDistribution { manager.setDeployedFiles(hostName, referencesAsString); } - @Override public void startDownload(String hostName, Set<FileReference> fileReferences) { throw new UnsupportedOperationException("Not valid for this Filedistribution implementation"); } @Override + public void startDownload(String hostName, int port, Set<FileReference> fileReferences) { + throw new UnsupportedOperationException("Not valid for this Filedistribution implementation"); + } + + @Override public void removeDeploymentsThatHaveDifferentApplicationId(Collection<String> targetHostnames) { manager.removeDeploymentsThatHaveDifferentApplicationId(targetHostnames); } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/MockFileDBHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/MockFileDBHandler.java index caf64cca4d0..9ba8daf87e4 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/MockFileDBHandler.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/MockFileDBHandler.java @@ -20,8 +20,14 @@ public class MockFileDBHandler implements FileDistribution { sendDeployedFilesCalled++; } + public void startDownload(String hostName, Set<FileReference> fileReferences) { + throw new UnsupportedOperationException("Not valid for this Filedistribution implementation"); + } + @Override - public void startDownload(String hostName, Set<FileReference> fileReferences) { /* not implemented */ } + public void startDownload(String hostName, int port, Set<FileReference> fileReferences) { + throw new UnsupportedOperationException("Not valid for this Filedistribution implementation"); + } @Override public void reloadDeployFileDistributor() { |