diff options
author | gjoranv <gv@verizonmedia.com> | 2020-07-17 18:48:53 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2020-07-17 18:48:53 +0200 |
commit | c020e9a0ea5cb1f4130e6f12d510501bd33f7f40 (patch) | |
tree | 138db885e91f3e5987d804ab7781992608d0acfc | |
parent | 1395510686fd5252494e25e9e92eae9131dc60e1 (diff) |
Drop the now unnecessary 'file:' prefix for disk bundles.
- It was originally used to separate between disk bundles and
bundles retrieved with file distribution.
- Keep conversion code until the last model producing 'file:'
has rolled out of hosted.
3 files changed, 6 insertions, 26 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java index e2d0868cb9d..f44abef607d 100755 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java @@ -69,8 +69,6 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; -import static com.yahoo.container.core.BundleLoaderProperties.DISK_BUNDLE_PREFIX; - /** * Parent class for all container cluster types. * @@ -474,14 +472,11 @@ public abstract class ContainerCluster<CONTAINER extends Container> @Override public void getConfig(PlatformBundlesConfig.Builder builder) { - platformBundles.stream() .map(ContainerCluster::toFileReferenceString) + platformBundles.stream() + .map(Path::toString) .forEach(builder::bundles); } - private static String toFileReferenceString(Path path) { - return DISK_BUNDLE_PREFIX + path.toString(); - } - @Override public void getConfig(QrSearchersConfig.Builder builder) { if (containerSearch != null) containerSearch.getConfig(builder); diff --git a/container-core/src/main/java/com/yahoo/container/core/BundleLoaderProperties.java b/container-core/src/main/java/com/yahoo/container/core/BundleLoaderProperties.java deleted file mode 100644 index ee12c7d4c9f..00000000000 --- a/container-core/src/main/java/com/yahoo/container/core/BundleLoaderProperties.java +++ /dev/null @@ -1,15 +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.container.core; - -/** - * @author gjoranv - */ -public interface BundleLoaderProperties { - - // TODO: This should be removed. The prefix is used to separate the bundles in BundlesConfig - // into those that are transferred with filedistribution and those that are preinstalled - // on disk. Instead, the model should have put them in two different configs. I.e. create a new - // config 'preinstalled-bundles.def'. - String DISK_BUNDLE_PREFIX = "file:"; - -} diff --git a/container-core/src/main/java/com/yahoo/container/core/config/DiskBundleInstaller.java b/container-core/src/main/java/com/yahoo/container/core/config/DiskBundleInstaller.java index 3edabe9f861..87c3d3048c5 100644 --- a/container-core/src/main/java/com/yahoo/container/core/config/DiskBundleInstaller.java +++ b/container-core/src/main/java/com/yahoo/container/core/config/DiskBundleInstaller.java @@ -8,8 +8,6 @@ import org.osgi.framework.Bundle; import java.io.File; import java.util.List; -import static com.yahoo.container.core.BundleLoaderProperties.DISK_BUNDLE_PREFIX; - /** * @author gjoranv */ @@ -17,8 +15,10 @@ public class DiskBundleInstaller implements BundleInstaller { @Override public List<Bundle> installBundles(FileReference reference, Osgi osgi) { - assert(reference.value().startsWith(DISK_BUNDLE_PREFIX)); - String referenceFileName = reference.value().substring(DISK_BUNDLE_PREFIX.length()); + // TODO: remove when the last model producing 'file:' has rolled out of hosted + String referenceFileName = reference.value().startsWith("file:") + ? reference.value().substring("file:".length()) + : reference.value(); File file = new File(referenceFileName); if ( ! file.exists()) { |