summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2019-11-08 10:50:18 +0100
committerHarald Musum <musum@verizonmedia.com>2019-11-08 10:50:18 +0100
commit215c20647bcd97b4d941e715068c27896b506648 (patch)
tree4293cb89351a8354588e9a406e3c575ff40f4262 /config-model
parent0881c1cbcadda5fd8a805fed71ff8da628023902 (diff)
Create a copy of all files to send
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/filedistribution/FileDistributor.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/filedistribution/FileDistributor.java b/config-model/src/main/java/com/yahoo/vespa/model/filedistribution/FileDistributor.java
index a4557c2ea9c..576b009c846 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/filedistribution/FileDistributor.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/filedistribution/FileDistributor.java
@@ -68,12 +68,7 @@ public class FileDistributor {
}
private Set<Host> getHosts(FileReference reference) {
- Set<Host> hosts = filesToHosts.get(reference);
- if (hosts == null) {
- hosts = new HashSet<>();
- filesToHosts.put(reference, hosts);
- }
- return hosts;
+ return filesToHosts.computeIfAbsent(reference, k -> new HashSet<>());
}
public FileDistributor(FileRegistry fileRegistry, List<ConfigServerSpec> configServerSpecs) {
@@ -106,7 +101,7 @@ public class FileDistributor {
}
public Set<FileReference> allFilesToSend() {
- return filesToHosts.keySet();
+ return Set.copyOf(filesToHosts.keySet());
}
// should only be called during deploy