summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2021-11-28 19:32:27 +0100
committerHarald Musum <musum@yahooinc.com>2021-11-28 19:32:27 +0100
commit84fc775328cb28bb5a01edfe23f5257b51d4df9b (patch)
treee565e0e2b10bac57f42f7b908d35d499b114552d /configserver
parent1e42d272dc02bbf8a246ac91614a6b03e61aaeee (diff)
Simplify
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionFactory.java2
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionImpl.java25
2 files changed, 10 insertions, 17 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionFactory.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionFactory.java
index 3e3c7066927..1027cc6a237 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionFactory.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionFactory.java
@@ -32,7 +32,7 @@ public class FileDistributionFactory implements AutoCloseable {
}
public FileDistribution createFileDistribution() {
- return new FileDistributionImpl(getFileReferencesDir(), supervisor);
+ return new FileDistributionImpl(supervisor);
}
public AddFileInterface createFileManager(File applicationDir) {
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionImpl.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionImpl.java
index 605f5924e68..abb8a3e8487 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionImpl.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionImpl.java
@@ -10,7 +10,6 @@ import com.yahoo.jrt.StringArray;
import com.yahoo.jrt.Supervisor;
import com.yahoo.jrt.Target;
-import java.io.File;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -24,26 +23,21 @@ public class FileDistributionImpl implements FileDistribution, RequestWaiter {
private final static double rpcTimeout = 1.0;
private final Supervisor supervisor;
- private final File fileReferencesDir;
- public FileDistributionImpl(File fileReferencesDir, Supervisor supervisor) {
- this.fileReferencesDir = fileReferencesDir;
+ public FileDistributionImpl(Supervisor supervisor) {
this.supervisor = supervisor;
}
+ /**
+ * Notifies client which file references it should start downloading. It's OK if the call does not succeed,
+ * as this is just a hint to the client to start downloading. Currently the only client is the config server
+ *
+ * @param hostName host which should be notified about file references to download
+ * @param port port which should be used when notifying
+ * @param fileReferences set of file references to start downloading
+ */
@Override
public void startDownload(String hostName, int port, Set<FileReference> fileReferences) {
- startDownloadingFileReferences(hostName, port, fileReferences);
- }
-
- @Override
- public File getFileReferencesDir() {
- return fileReferencesDir;
- }
-
- // Notifies client which file references it should start downloading. It's OK if the call does not succeed,
- // as this is just a hint to the client to start downloading. Currently the only client is the config server
- private void startDownloadingFileReferences(String hostName, int port, Set<FileReference> fileReferences) {
Target target = supervisor.connect(new Spec(hostName, port));
Request request = new Request("filedistribution.setFileReferencesToDownload");
request.setContext(target);
@@ -52,7 +46,6 @@ public class FileDistributionImpl implements FileDistribution, RequestWaiter {
target.invokeAsync(request, rpcTimeout, this);
}
-
@Override
public void handleRequestDone(Request req) {
Target target = (Target) req.getContext();