summaryrefslogtreecommitdiffstats
path: root/config-application-package
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2020-11-09 12:31:18 +0100
committerGitHub <noreply@github.com>2020-11-09 12:31:18 +0100
commit0c68b00b2d3a9ddc191ed1733ba2f8699d1c3dc1 (patch)
tree2d9f42877a425890eaca0b5286d0d6ef7b6980a7 /config-application-package
parent6f31478ed0d63959bd4cbbb176445e0f561ad5a2 (diff)
parenteb74d778b8610d1ee52d85cd225d61b2b497854b (diff)
Merge pull request #15225 from vespa-engine/hmusum/remove-unused-code
Cleanup, bundled search definition support has been removed
Diffstat (limited to 'config-application-package')
-rw-r--r--config-application-package/src/main/java/com/yahoo/config/model/application/provider/FilesApplicationPackage.java27
1 files changed, 4 insertions, 23 deletions
diff --git a/config-application-package/src/main/java/com/yahoo/config/model/application/provider/FilesApplicationPackage.java b/config-application-package/src/main/java/com/yahoo/config/model/application/provider/FilesApplicationPackage.java
index 91ff1c6d339..9c68fb95cce 100644
--- a/config-application-package/src/main/java/com/yahoo/config/model/application/provider/FilesApplicationPackage.java
+++ b/config-application-package/src/main/java/com/yahoo/config/model/application/provider/FilesApplicationPackage.java
@@ -80,7 +80,7 @@ public class FilesApplicationPackage implements ApplicationPackage {
* The name of the subdirectory (below the original application package root)
* where a preprocessed version of this application package is stored.
* As it happens, the config model is first created with an application package in this subdirectory,
- * and later used backed by an application package which is not in this subdirectory.
+ * and later backed by an application package which is not in this subdirectory.
* To enable model code to correct for this, this constant must be publicly known.
*
* All of this stuff is Very Unfortunate and should be fixed. -Jon
@@ -306,34 +306,15 @@ public class FilesApplicationPackage implements ApplicationPackage {
@Override
public Collection<NamedReader> searchDefinitionContents() {
- Map<String, NamedReader> ret = new LinkedHashMap<>();
- Set<String> fileSds = new LinkedHashSet<>();
- Set<String> bundleSds = new LinkedHashSet<>();
+ Set<NamedReader> ret = new LinkedHashSet<>();
try {
for (File f : getSearchDefinitionFiles()) {
- fileSds.add(f.getName());
- ret.put(f.getName(), new NamedReader(f.getName(), new FileReader(f)));
+ ret.add(new NamedReader(f.getName(), new FileReader(f)));
}
} catch (Exception e) {
throw new IllegalArgumentException("Couldn't get search definition contents.", e);
}
- verifySdsDisjoint(fileSds, bundleSds);
- return ret.values();
- }
-
- /**
- * Verify that two sets of search definitions are disjoint (TODO: everything except error message is very generic).
- *
- * @param fileSds Set of search definitions from file
- * @param bundleSds Set of search definitions from bundles
- */
- private void verifySdsDisjoint(Set<String> fileSds, Set<String> bundleSds) {
- if (!Collections.disjoint(fileSds, bundleSds)) {
- Collection<String> disjoint = new ArrayList<>(fileSds);
- disjoint.retainAll(bundleSds);
- throw new IllegalArgumentException("For the following search definitions names there are collisions between those specified inside " +
- "docproc bundles and those in searchdefinitions/ in application package: "+disjoint);
- }
+ return ret;
}
/**