summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2020-07-14 00:57:49 +0200
committergjoranv <gv@verizonmedia.com>2020-07-14 01:34:58 +0200
commit26d00d9818553eee9b0bc05b7a8bd8c44f8c6a77 (patch)
tree5ad2edb5ba19b321b2495fc8f0009d3fa1eb17cd /config-model
parent975ac66a4d56d744dd8435cee6dc147c038dc08c (diff)
Remove defective methods to add platform bundles based on components
+ Update TODO comment
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleMapper.java14
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java9
2 files changed, 1 insertions, 22 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleMapper.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleMapper.java
index aa7cb5eb539..8c7b06ce222 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleMapper.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleMapper.java
@@ -31,31 +31,19 @@ public class BundleMapper {
public static final String searchAndDocprocBundle = "container-search-and-docproc";
private static final Map<String, String> bundleFromClass;
- private static final Map<String, Path> bundleFileFromClass;
public static Optional<String> getBundle(String className) {
return Optional.ofNullable(bundleFromClass.get(className));
}
- public static Optional<Path> getBundlePath(String className) {
- return Optional.ofNullable(absoluteBundlePath(bundleFileFromClass.get(className)));
- }
-
public static Path absoluteBundlePath(Path fileName) {
if (fileName == null) return null;
return LIBRARY_PATH.resolve(fileName);
}
- /**
- * TODO: This is a temporary hack to ensure that users can use our internal components without
- * specifying the bundle in which the components reside. Ideally, this information
- * should be generated during vespamodel build time.
- *
- * The container_maven_plugin has much of the logic in place, but needs to be extended.
- */
+ //This is a hack to allow users to declare components from the search-and-docproc bundle without naming the bundle.
static {
bundleFromClass = new HashMap<>();
- bundleFileFromClass = new HashMap<>();
bundleFromClass.put("com.yahoo.docproc.AbstractConcreteDocumentFactory", searchAndDocprocBundle);
bundleFromClass.put("com.yahoo.docproc.DocumentProcessor", searchAndDocprocBundle);
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
index b83632a58a0..41e092c7ea5 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
@@ -154,21 +154,12 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
ApplicationContainerCluster cluster = createContainerCluster(spec, modelContext);
addClusterContent(cluster, spec, modelContext);
- addBundlesForPlatformComponents(cluster);
cluster.setMessageBusEnabled(rpcServerEnabled);
cluster.setRpcServerEnabled(rpcServerEnabled);
cluster.setHttpServerEnabled(httpServerEnabled);
model.setCluster(cluster);
}
- private void addBundlesForPlatformComponents(ApplicationContainerCluster cluster) {
- for (Component<?, ?> component : cluster.getAllComponents()) {
- String componentClass = component.model.bundleInstantiationSpec.getClassName();
- BundleMapper.getBundlePath(componentClass).
- ifPresent(cluster::addPlatformBundle);
- }
- }
-
private ApplicationContainerCluster createContainerCluster(Element spec, ConfigModelContext modelContext) {
return new VespaDomBuilder.DomConfigProducerBuilder<ApplicationContainerCluster>() {
@Override