diff options
16 files changed, 269 insertions, 88 deletions
diff --git a/config-application-package/src/main/java/com/yahoo/config/model/application/provider/FileReferenceCreator.java b/config-application-package/src/main/java/com/yahoo/config/model/application/provider/FileReferenceCreator.java deleted file mode 100644 index 7e1d247281c..00000000000 --- a/config-application-package/src/main/java/com/yahoo/config/model/application/provider/FileReferenceCreator.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.config.model.application.provider; - -import com.yahoo.config.FileReference; - -import java.lang.reflect.Constructor; - -/** - * Convenience for creating a {@link com.yahoo.config.FileReference}. - * - * @author gjoranv - */ -public class FileReferenceCreator { - - public static FileReference create(String stringVal) { - try { - Constructor<FileReference> ctor = FileReference.class.getDeclaredConstructor(String.class); - ctor.setAccessible(true); - return ctor.newInstance(stringVal); - } catch (Exception e) { - throw new RuntimeException("Could not create a new " + FileReference.class.getName() + - ". This should never happen!", e); - } - } - -} diff --git a/config-application-package/src/main/java/com/yahoo/config/model/application/provider/MockFileRegistry.java b/config-application-package/src/main/java/com/yahoo/config/model/application/provider/MockFileRegistry.java index ca0b37d8cc3..d635fe90ded 100644 --- a/config-application-package/src/main/java/com/yahoo/config/model/application/provider/MockFileRegistry.java +++ b/config-application-package/src/main/java/com/yahoo/config/model/application/provider/MockFileRegistry.java @@ -17,7 +17,7 @@ import java.util.Set; public class MockFileRegistry implements FileRegistry { public FileReference addFile(String relativePath) { - return FileReferenceCreator.create("0123456789abcdef"); + return new FileReference("0123456789abcdef"); } @Override @@ -25,8 +25,8 @@ public class MockFileRegistry implements FileRegistry { return "localhost.fortestingpurposesonly"; } - public static final Entry entry1 = new Entry("component/path1", FileReferenceCreator.create("1234")); - public static final Entry entry2 = new Entry("component/path2", FileReferenceCreator.create("56789")); + public static final Entry entry1 = new Entry("component/path1", new FileReference("1234")); + public static final Entry entry2 = new Entry("component/path2", new FileReference("56789")); public List<Entry> export() { List<Entry> result = new ArrayList<>(); diff --git a/config-application-package/src/main/java/com/yahoo/config/model/application/provider/PreGeneratedFileRegistry.java b/config-application-package/src/main/java/com/yahoo/config/model/application/provider/PreGeneratedFileRegistry.java index 29e83e00305..0b0b799f47f 100644 --- a/config-application-package/src/main/java/com/yahoo/config/model/application/provider/PreGeneratedFileRegistry.java +++ b/config-application-package/src/main/java/com/yahoo/config/model/application/provider/PreGeneratedFileRegistry.java @@ -70,7 +70,7 @@ public class PreGeneratedFileRegistry implements FileRegistry { } public FileReference addFile(String relativePath) { - return FileReferenceCreator.create(path2Hash.get(relativePath)); + return new FileReference(path2Hash.get(relativePath)); } @Override @@ -86,7 +86,7 @@ public class PreGeneratedFileRegistry implements FileRegistry { public List<Entry> export() { List<Entry> entries = new ArrayList<>(); for (Map.Entry<String, String> entry : path2Hash.entrySet()) { - entries.add(new Entry(entry.getKey(), FileReferenceCreator.create(entry.getValue()))); + entries.add(new Entry(entry.getKey(), new FileReference(entry.getValue()))); } return entries; } 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 8860f5c2249..f6cc9203d00 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 @@ -110,11 +110,5 @@ public class FileDistributor { public void reloadDeployFileDistributor(FileDistribution dbHandler) { dbHandler.reloadDeployFileDistributor(); } - - private Set<String> union(Set<String> hosts, String... additionalHosts) { - Set<String> result = new HashSet<>(hosts); - result.addAll(asList(additionalHosts)); - return result; - } } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/AddFileInterface.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/AddFileInterface.java new file mode 100644 index 00000000000..61c376a7256 --- /dev/null +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/AddFileInterface.java @@ -0,0 +1,9 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.config.server.filedistribution; + +import com.yahoo.config.FileReference; + +public interface AddFileInterface { + FileReference addFile(String relativePath); + FileReference addFile(String relativePath, FileReference reference); +} diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/ApplicationFileManager.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/ApplicationFileManager.java new file mode 100644 index 00000000000..0d1aae97690 --- /dev/null +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/ApplicationFileManager.java @@ -0,0 +1,25 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.config.server.filedistribution; + +import com.yahoo.config.FileReference; +import java.io.File; + +public class ApplicationFileManager implements AddFileInterface { + private final File applicationDir; + private final FileDirectory master; + + ApplicationFileManager(File applicationDir, FileDirectory master) { + this.applicationDir = applicationDir; + this.master = master; + } + + @Override + public FileReference addFile(String relativePath, FileReference reference) { + return master.addFile(new File(applicationDir, relativePath), reference); + } + + @Override + public FileReference addFile(String relativePath) { + return master.addFile(new File(applicationDir, relativePath)); + } +} 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 new file mode 100644 index 00000000000..588f2d1d63f --- /dev/null +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/CombinedLegacyDistribution.java @@ -0,0 +1,30 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.config.server.filedistribution; + +import com.yahoo.config.FileReference; +import com.yahoo.config.model.api.FileDistribution; + +import java.util.Collection; +import java.util.Set; + +public class CombinedLegacyDistribution implements FileDistribution { + private final FileDistribution legacy; + + CombinedLegacyDistribution(FileDBHandler legacy) { + this.legacy = legacy; + } + @Override + public void sendDeployedFiles(String hostName, Set<FileReference> fileReferences) { + legacy.sendDeployedFiles(hostName, fileReferences); + } + + @Override + public void reloadDeployFileDistributor() { + legacy.reloadDeployFileDistributor(); + } + + @Override + public void removeDeploymentsThatHaveDifferentApplicationId(Collection<String> targetHostnames) { + legacy.removeDeploymentsThatHaveDifferentApplicationId(targetHostnames); + } +} diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/CombinedLegacyRegistry.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/CombinedLegacyRegistry.java new file mode 100644 index 00000000000..8f2cb194bbd --- /dev/null +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/CombinedLegacyRegistry.java @@ -0,0 +1,32 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.config.server.filedistribution; + +import com.yahoo.config.FileReference; +import com.yahoo.config.application.api.FileRegistry; + +import java.util.List; + +public class CombinedLegacyRegistry implements FileRegistry { + private final FileDBRegistry legacy; + private final FileDBRegistry future; + + CombinedLegacyRegistry(FileDBRegistry legacy, FileDBRegistry future) { + this.legacy = legacy; + this.future = future; + } + @Override + public FileReference addFile(String relativePath) { + FileReference reference = legacy.addFile(relativePath); + return future.addFile(relativePath, reference); + } + + @Override + public String fileSourceHost() { + return future.fileSourceHost(); + } + + @Override + public List<Entry> export() { + return future.export(); + } +} diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBRegistry.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBRegistry.java index d921d8d4f8d..1a76454fbed 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBRegistry.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBRegistry.java @@ -4,29 +4,41 @@ package com.yahoo.vespa.config.server.filedistribution; import com.yahoo.config.FileReference; import com.yahoo.config.application.api.FileRegistry; import com.yahoo.net.HostName; -import com.yahoo.vespa.filedistribution.FileDistributionManager; -import com.yahoo.config.model.application.provider.FileReferenceCreator; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; /** * @author tonytv */ public class FileDBRegistry implements FileRegistry { - private final FileDistributionManager manager; + private final AddFileInterface manager; private List<Entry> entries = new ArrayList<>(); private final Map<String, FileReference> fileReferenceCache = new HashMap<>(); - public FileDBRegistry(FileDistributionManager manager) { + public FileDBRegistry(AddFileInterface manager) { this.manager = manager; } + public synchronized FileReference addFile(String relativePath, FileReference reference) { + Optional<FileReference> cachedReference = Optional.ofNullable(fileReferenceCache.get(relativePath)); + return cachedReference.orElseGet(() -> { + FileReference newRef = manager.addFile(relativePath, reference); + entries.add(new Entry(relativePath, newRef)); + fileReferenceCache.put(relativePath, newRef); + return newRef; + }); + } + @Override public synchronized FileReference addFile(String relativePath) { Optional<FileReference> cachedReference = Optional.ofNullable(fileReferenceCache.get(relativePath)); return cachedReference.orElseGet(() -> { - FileReference newRef = FileReferenceCreator.create(manager.addFile(relativePath)); + FileReference newRef = manager.addFile(relativePath); entries.add(new Entry(relativePath, newRef)); fileReferenceCache.put(relativePath, newRef); return newRef; diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDirectory.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDirectory.java new file mode 100644 index 00000000000..5a7bc4e7e82 --- /dev/null +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDirectory.java @@ -0,0 +1,113 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +package com.yahoo.vespa.config.server.filedistribution; + +import com.yahoo.config.FileReference; +import com.yahoo.config.model.api.FileDistribution; +import com.yahoo.io.IOUtils; +import com.yahoo.text.Utf8; +import net.jpountz.xxhash.XXHash64; +import net.jpountz.xxhash.XXHashFactory; + +import java.io.File; +import java.io.FilenameFilter; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.logging.Logger; + +public class FileDirectory { + private static final Logger log = Logger.getLogger(FileDirectory.class.getName()); + private final File root; + + public FileDirectory() { + this(FileDistribution.getDefaultFileDBPath()); + } + + public FileDirectory(File rootDir) { + root = rootDir; + try { + ensureRootExist(); + } catch (IllegalArgumentException e) { + log.warning("Failed creating directory in constructor, will retry on demand : " + e.toString()); + } + } + + private void ensureRootExist() { + if (! root.exists()) { + if ( ! root.mkdir()) { + throw new IllegalArgumentException("Failed creating root dir '" + root.getAbsolutePath() + "'."); + } + } else if (!root.isDirectory()) { + throw new IllegalArgumentException("'" + root.getAbsolutePath() + "' is not a directory"); + } + } + + static private class Filter implements FilenameFilter { + @Override + public boolean accept(File dir, String name) { + return !".".equals(name) && !"..".equals(name) ; + } + } + + String getPath(FileReference ref) { + return root.getAbsolutePath() + "/" + ref.value(); + } + + File getFile(FileReference reference) { + ensureRootExist(); + File dir = new File(getPath(reference)); + if (!dir.exists()) { + throw new IllegalArgumentException("File reference '" + reference.toString() + "' with absolute path '" + dir.getAbsolutePath() + "' does not exist."); + } + if (!dir.isDirectory()) { + throw new IllegalArgumentException("File reference '" + reference.toString() + "' with absolute path '" + dir.getAbsolutePath() + "' is not a directory."); + } + File [] files = dir.listFiles(new Filter()); + if (files.length != 1) { + StringBuilder msg = new StringBuilder(); + for (File f: files) { + msg.append(f.getName()).append("\n"); + } + throw new IllegalArgumentException("File reference '" + reference.toString() + "' with absolute path '" + dir.getAbsolutePath() + " does not contain exactly one file, but [" + msg.toString() + "]"); + } + return files[0]; + } + + private Long computeReference(File file) throws IOException { + byte [] wholeFile = IOUtils.readFileBytes(file); + XXHash64 hasher = XXHashFactory.fastestInstance().hash64(); + return hasher.hash(ByteBuffer.wrap(wholeFile), hasher.hash(ByteBuffer.wrap(Utf8.toBytes(file.getName())), 0)); + } + + public FileReference addFile(File source) { + try { + Long hash = computeReference(source); + FileReference reference = new FileReference(Long.toHexString(hash)); + return addFile(source, reference); + } catch (IOException e) { + throw new IllegalArgumentException(e); + } + } + public FileReference addFile(File source, FileReference reference) { + ensureRootExist(); + try { + File destinationDir = new File(root, reference.value()); + if (!destinationDir.exists()) { + destinationDir.mkdir(); + File tempDestinationDir = File.createTempFile("writing", null, root); + tempDestinationDir.mkdir(); + File destination = new File(tempDestinationDir, source.getName()); + IOUtils.copy(source, destination); + if (!destinationDir.exists()) { + if ( ! tempDestinationDir.renameTo(destinationDir)) { + log.warning("Failed moving '" + tempDestinationDir.getAbsolutePath() + "' to '" + destination.getAbsolutePath() + "'."); + } + } + IOUtils.recursiveDeleteDir(tempDestinationDir); + } + return reference; + } catch (IOException e) { + throw new IllegalArgumentException(e); + } + } +} diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionProvider.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionProvider.java index 36b0138ad36..59c3a54897d 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionProvider.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionProvider.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.server.filedistribution; +import com.yahoo.config.FileReference; import com.yahoo.config.model.api.FileDistribution; import com.yahoo.config.application.api.FileRegistry; import com.yahoo.vespa.filedistribution.FileDistributionManager; @@ -19,13 +20,32 @@ public class FileDistributionProvider { private final FileRegistry fileRegistry; private final FileDistribution fileDistribution; - public FileDistributionProvider(File applicationDir, String zooKeepersSpec, String applicationId, Lock fileDistributionLock) { + static private class ManagerWrapper implements AddFileInterface { + private final FileDistributionManager manager; + ManagerWrapper(FileDistributionManager manager) { + this.manager = manager; + } + @Override + public FileReference addFile(String relativePath) { + return new FileReference(manager.addFile(relativePath)); + } + + @Override + public FileReference addFile(String relativePath, FileReference reference) { + throw new IllegalStateException("addFile with external reference is not possible with legacy filedistribution."); + } + } + + public FileDistributionProvider(File applicationDir, String zooKeepersSpec, + String applicationId, Lock fileDistributionLock) + { ensureDirExists(FileDistribution.getDefaultFileDBPath()); final FileDistributionManager manager = new FileDistributionManager( FileDistribution.getDefaultFileDBPath(), applicationDir, zooKeepersSpec, applicationId, fileDistributionLock); - this.fileDistribution = new FileDBHandler(manager); - this.fileRegistry = new FileDBRegistry(manager); + this.fileDistribution = new CombinedLegacyDistribution(new FileDBHandler(manager)); + this.fileRegistry = new CombinedLegacyRegistry(new FileDBRegistry(new ManagerWrapper(manager)), + new FileDBRegistry(new ApplicationFileManager(applicationDir, new FileDirectory()))); } public FileDistributionProvider(FileRegistry fileRegistry, FileDistribution fileDistribution) { diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java index 1c77ee66d0c..0cbf35b98d1 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java @@ -1,3 +1,4 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.server.filedistribution; import com.google.inject.Inject; @@ -6,7 +7,6 @@ import com.yahoo.config.model.api.FileDistribution; import com.yahoo.io.IOUtils; import java.io.File; -import java.io.FilenameFilter; import java.io.IOException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -14,7 +14,7 @@ import java.util.logging.Logger; public class FileServer { private static final Logger log = Logger.getLogger(FileServer.class.getName()); - private final String rootDir; + private final FileDirectory root; private final ExecutorService executor; public static class ReplayStatus { @@ -33,46 +33,17 @@ public class FileServer { void receive(FileReference reference, String filename, byte [] content, ReplayStatus status); } - private String getPath(FileReference ref) { - return rootDir + "/" + ref.value(); - } - - static private class Filter implements FilenameFilter { - @Override - public boolean accept(File dir, String name) { - return !".".equals(name) && !"..".equals(name) ; - } - } - private File getFile(FileReference reference) { - File dir = new File(getPath(reference)); - if (!dir.exists()) { - throw new IllegalArgumentException("File reference '" + reference.toString() + "' with absolute path '" + dir.getAbsolutePath() + "' does not exist."); - } - if (!dir.isDirectory()) { - throw new IllegalArgumentException("File reference '" + reference.toString() + "' with absolute path '" + dir.getAbsolutePath() + "' is not a directory."); - } - File [] files = dir.listFiles(new Filter()); - if (files.length != 1) { - StringBuilder msg = new StringBuilder(); - for (File f: files) { - msg.append(f.getName()).append("\n"); - } - throw new IllegalArgumentException("File reference '" + reference.toString() + "' with absolute path '" + dir.getAbsolutePath() + " does not contain exactly one file, but [" + msg.toString() + "]"); - } - return files[0]; - } - @Inject public FileServer() { - this(FileDistribution.getDefaultFileDBRoot()); + this(FileDistribution.getDefaultFileDBPath()); } - public FileServer(String rootDir) { + public FileServer(File rootDir) { this(rootDir, Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())); } - public FileServer(String rootDir, ExecutorService executor) { - this.rootDir = rootDir; + public FileServer(File rootDir, ExecutorService executor) { + this.root = new FileDirectory(rootDir); this.executor = executor; } public boolean hasFile(String fileName) { @@ -80,7 +51,7 @@ public class FileServer { } public boolean hasFile(FileReference reference) { try { - return getFile(reference).exists(); + return root.getFile(reference).exists(); } catch (IllegalArgumentException e) { log.warning("Failed locating file reference '" + reference + "' with error " + e.toString()); } @@ -88,7 +59,7 @@ public class FileServer { } public boolean startFileServing(String fileName, Receiver target) { FileReference reference = new FileReference(fileName); - File file = getFile(reference); + File file = root.getFile(reference); if (file.exists()) { executor.execute(() -> serveFile(reference, target)); @@ -98,7 +69,7 @@ public class FileServer { private void serveFile(FileReference reference, Receiver target) { - File file = getFile(reference); + File file = root.getFile(reference); byte [] blob = new byte [0]; boolean success = false; String errorDescription = "OK"; diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/InjectedGlobalComponentRegistryTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/InjectedGlobalComponentRegistryTest.java index acda60049ab..dec9dd991de 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/InjectedGlobalComponentRegistryTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/InjectedGlobalComponentRegistryTest.java @@ -63,7 +63,7 @@ public class InjectedGlobalComponentRegistryTest { serverDB = new ConfigServerDB(configserverConfig); sessionPreparer = new SessionTest.MockSessionPreparer(); rpcServer = new RpcServer(configserverConfig, null, Metrics.createTestMetrics(), - new HostRegistries(), new ConfigRequestHostLivenessTracker(), new FileServer(FileDistribution.getDefaultFileDBRoot())); + new HostRegistries(), new ConfigRequestHostLivenessTracker(), new FileServer(FileDistribution.getDefaultFileDBPath())); generationCounter = new SuperModelGenerationCounter(curator); defRepo = new StaticConfigDefinitionRepo(); permanentApplicationPackage = new PermanentApplicationPackage(configserverConfig); diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/filedistribution/FileServerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/filedistribution/FileServerTest.java index 0c2ace38389..4913798e5ad 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/filedistribution/FileServerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/filedistribution/FileServerTest.java @@ -1,3 +1,4 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.server.filedistribution; import com.yahoo.config.FileReference; @@ -17,7 +18,7 @@ import static org.junit.Assert.assertFalse; public class FileServerTest { - FileServer fs = new FileServer("."); + FileServer fs = new FileServer(new File(".")); List<File> created = new LinkedList<>(); private void createCleanDir(String name) throws IOException{ diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/MockRpc.java b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/MockRpc.java index b094a741f34..4c2a4b56751 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/MockRpc.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/MockRpc.java @@ -39,7 +39,7 @@ public class MockRpc extends RpcServer { public MockRpc(int port, boolean createDefaultTenant, boolean pretendToHaveLoadedAnyApplication) { super(createConfig(port), null, Metrics.createTestMetrics(), - new HostRegistries(), new ConfigRequestHostLivenessTracker(), new FileServer(FileDistribution.getDefaultFileDBRoot())); + new HostRegistries(), new ConfigRequestHostLivenessTracker(), new FileServer(FileDistribution.getDefaultFileDBPath())); if (createDefaultTenant) { onTenantCreate(TenantName.from("default"), new MockTenantProvider(pretendToHaveLoadedAnyApplication)); } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/TestWithRpc.java b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/TestWithRpc.java index 933cb770dd1..12dc584f055 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/TestWithRpc.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/rpc/TestWithRpc.java @@ -90,7 +90,7 @@ public class TestWithRpc { emptyNodeFlavors(), generationCounter)), Metrics.createTestMetrics(), new HostRegistries(), - hostLivenessTracker, new FileServer(FileDistribution.getDefaultFileDBRoot())); + hostLivenessTracker, new FileServer(FileDistribution.getDefaultFileDBPath())); rpcServer.onTenantCreate(TenantName.from("default"), tenantProvider); t = new Thread(rpcServer); t.start(); |