aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2022-07-12 00:48:57 +0200
committergjoranv <gv@verizonmedia.com>2022-07-12 01:41:37 +0200
commita6cc157a30fea6bd60274c74d2bb0c259b304ebf (patch)
tree8fa4a5cb3bab68a60b84f518bdadbee935c1ee94 /config-model/src/main/java
parentb6f197461e83a02c9bdd13da0cfc932fcacabbc1 (diff)
Simplify creation of BundleInstantiationSpec
Diffstat (limited to 'config-model/src/main/java')
-rwxr-xr-xconfig-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java8
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/ContainerThreadpool.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/IdentityProvider.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/PlatformBundles.java3
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/component/SimpleComponent.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/docproc/DocprocChains.java10
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java8
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/DispatcherComponent.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/GUIHandler.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/RpcResourcePoolComponent.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleInstantiationSpecificationBuilder.java3
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/CloudSecretStore.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/SearchHandler.java5
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/document/DocumentFactoryBuilder.java2
16 files changed, 28 insertions, 29 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 b3189fe9251..e69872ca1e7 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
@@ -131,7 +131,7 @@ public abstract class ContainerCluster<CONTAINER extends Container>
public static final BindingPattern VIP_HANDLER_BINDING = SystemBindingPattern.fromHttpPath("/status.html");
public static final Set<Path> SEARCH_AND_DOCPROC_BUNDLES = Stream.of(
- PlatformBundles.searchAndDocprocBundle, "container-search-gui", "docprocs", "linguistics-components")
+ PlatformBundles.SEARCH_AND_DOCPROC_BUNDLE, "container-search-gui", "docprocs", "linguistics-components")
.map(PlatformBundles::absoluteBundlePath).collect(Collectors.toSet());
private final String name;
@@ -229,7 +229,7 @@ public abstract class ContainerCluster<CONTAINER extends Container>
public void addDefaultRootHandler() {
Handler handler = new Handler(
- new ComponentModel(BundleInstantiationSpecification.getFromStrings(
+ new ComponentModel(BundleInstantiationSpecification.fromStrings(
BINDINGS_OVERVIEW_HANDLER_CLASS, null, null), null)); // null bundle, as the handler is in container-disc
handler.addServerBindings(ROOT_HANDLER_BINDING);
addComponent(handler);
@@ -237,7 +237,7 @@ public abstract class ContainerCluster<CONTAINER extends Container>
public void addApplicationStatusHandler() {
Handler statusHandler = new Handler(
- new ComponentModel(BundleInstantiationSpecification.getFromStrings(
+ new ComponentModel(BundleInstantiationSpecification.fromStrings(
APPLICATION_STATUS_HANDLER_CLASS, null, null), null)); // null bundle, as the handler is in container-disc
statusHandler.addServerBindings(SystemBindingPattern.fromHttpPath("/ApplicationStatus"));
addComponent(statusHandler);
@@ -320,7 +320,7 @@ public abstract class ContainerCluster<CONTAINER extends Container>
ProcessingHandler<?> processingHandler = new ProcessingHandler<>(
processingChains,
- BundleInstantiationSpecification.getFromStrings(PROCESSING_HANDLER_CLASS, null, null));
+ BundleInstantiationSpecification.fromStrings(PROCESSING_HANDLER_CLASS, null, null));
for (BindingPattern binding: serverBindings)
processingHandler.addServerBindings(binding);
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerThreadpool.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerThreadpool.java
index fbd7bc9fe56..fb4e62f5cd1 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerThreadpool.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerThreadpool.java
@@ -24,7 +24,7 @@ public abstract class ContainerThreadpool extends SimpleComponent implements Con
public ContainerThreadpool(String name, UserOptions userOptions) {
super(new ComponentModel(
- BundleInstantiationSpecification.getFromStrings(
+ BundleInstantiationSpecification.fromStrings(
"threadpool@" + name,
ContainerThreadpoolImpl.class.getName(),
null)));
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java b/config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java
index 0b37abaded9..0fdd36b8811 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/DefaultThreadpoolProvider.java
@@ -19,7 +19,7 @@ class DefaultThreadpoolProvider extends SimpleComponent implements ThreadpoolCon
DefaultThreadpoolProvider(ContainerCluster<?> cluster, int defaultWorkerThreads) {
super(new ComponentModel(
- BundleInstantiationSpecification.getFromStrings(
+ BundleInstantiationSpecification.fromStrings(
"default-threadpool",
ThreadPoolProvider.class.getName(),
null)));
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/IdentityProvider.java b/config-model/src/main/java/com/yahoo/vespa/model/container/IdentityProvider.java
index 7ce2425179b..5e8bb85c29d 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/IdentityProvider.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/IdentityProvider.java
@@ -33,7 +33,7 @@ public class IdentityProvider extends SimpleComponent implements IdentityConfig.
URI ztsUrl,
String athenzDnsSuffix,
Zone zone) {
- super(new ComponentModel(BundleInstantiationSpecification.getFromStrings(CLASS, CLASS, BUNDLE)));
+ super(new ComponentModel(BundleInstantiationSpecification.fromStrings(CLASS, CLASS, BUNDLE)));
this.domain = domain;
this.service = service;
this.loadBalancerName = loadBalancerName;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/PlatformBundles.java b/config-model/src/main/java/com/yahoo/vespa/model/container/PlatformBundles.java
index e5125fe7e1d..6a1e647e9be 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/PlatformBundles.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/PlatformBundles.java
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.container;
+import com.yahoo.container.bundle.BundleInstantiationSpecification;
import com.yahoo.vespa.defaults.Defaults;
import java.nio.file.Path;
@@ -28,7 +29,7 @@ public class PlatformBundles {
}
public static final Path LIBRARY_PATH = Paths.get(Defaults.getDefaults().underVespaHome("lib/jars"));
- public static final String searchAndDocprocBundle = "container-search-and-docproc";
+ public static final String SEARCH_AND_DOCPROC_BUNDLE = BundleInstantiationSpecification.CONTAINER_SEARCH_AND_DOCPROC;
public static Set<Path> commonVespaBundles() {
var bundles = new LinkedHashSet<Path>();
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/component/SimpleComponent.java b/config-model/src/main/java/com/yahoo/vespa/model/container/component/SimpleComponent.java
index 2c4dd9a8dda..23915afacdd 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/component/SimpleComponent.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/component/SimpleComponent.java
@@ -17,7 +17,7 @@ public class SimpleComponent extends Component<AbstractConfigProducer<?>, Compon
}
public SimpleComponent(String className) {
- this(new ComponentModel(BundleInstantiationSpecification.getFromStrings(className, null, null)));
+ this(new ComponentModel(BundleInstantiationSpecification.fromStrings(className, null, null)));
}
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/docproc/DocprocChains.java b/config-model/src/main/java/com/yahoo/vespa/model/container/docproc/DocprocChains.java
index 43f86da1461..109ab3e806e 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/docproc/DocprocChains.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/docproc/DocprocChains.java
@@ -9,6 +9,7 @@ import com.yahoo.docproc.jdisc.observability.DocprocsStatusExtension;
import com.yahoo.osgi.provider.model.ComponentModel;
import com.yahoo.vespa.model.container.ApplicationContainerCluster;
import com.yahoo.vespa.model.container.ContainerCluster;
+import com.yahoo.vespa.model.container.PlatformBundles;
import com.yahoo.vespa.model.container.component.Component;
import com.yahoo.vespa.model.container.component.SimpleComponent;
import com.yahoo.vespa.model.container.component.SystemBindingPattern;
@@ -28,13 +29,10 @@ public class DocprocChains extends Chains<DocprocChain> {
super(parent, subId);
docprocHandler = new ProcessingHandler<>(
this,
- BundleInstantiationSpecification.getInternalHandlerSpecificationFromStrings("com.yahoo.docproc.jdisc.DocumentProcessingHandler", null));
+ BundleInstantiationSpecification.fromSearchAndDocproc("com.yahoo.docproc.jdisc.DocumentProcessingHandler"));
addComponent(docprocHandler);
- addComponent(
- new SimpleComponent(
- new ComponentModel(
- BundleInstantiationSpecification.getInternalProcessingSpecificationFromStrings(
- DocprocsStatusExtension.class.getName(), null), null)));
+ addComponent(new SimpleComponent(
+ new ComponentModel(DocprocsStatusExtension.class.getName(), null, PlatformBundles.SEARCH_AND_DOCPROC_BUNDLE)));
if (! (getParent() instanceof ApplicationContainerCluster)) {
// All application containers already have a DocumentTypeManager,
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java
index 3ac12381a1f..7a0b6c8e023 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java
@@ -25,7 +25,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import static com.yahoo.vespa.model.container.PlatformBundles.searchAndDocprocBundle;
+import static com.yahoo.vespa.model.container.PlatformBundles.SEARCH_AND_DOCPROC_BUNDLE;
/**
* @author gjoranv
@@ -56,9 +56,9 @@ public class ContainerSearch extends ContainerSubsystem<SearchChains>
this.owningCluster = cluster;
this.options = options;
- owningCluster.addComponent(Component.fromClassAndBundle(QUERY_PROFILE_REGISTRY_CLASS, searchAndDocprocBundle));
- owningCluster.addComponent(Component.fromClassAndBundle(com.yahoo.search.schema.SchemaInfo.class.getName(), searchAndDocprocBundle));
- owningCluster.addComponent(Component.fromClassAndBundle(SearchStatusExtension.class.getName(), searchAndDocprocBundle));
+ owningCluster.addComponent(Component.fromClassAndBundle(QUERY_PROFILE_REGISTRY_CLASS, SEARCH_AND_DOCPROC_BUNDLE));
+ owningCluster.addComponent(Component.fromClassAndBundle(com.yahoo.search.schema.SchemaInfo.class.getName(), SEARCH_AND_DOCPROC_BUNDLE));
+ owningCluster.addComponent(Component.fromClassAndBundle(SearchStatusExtension.class.getName(), SEARCH_AND_DOCPROC_BUNDLE));
cluster.addSearchAndDocprocBundles();
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/DispatcherComponent.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/DispatcherComponent.java
index 6edcd8901de..44c60cf0619 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/DispatcherComponent.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/DispatcherComponent.java
@@ -32,7 +32,7 @@ public class DispatcherComponent extends Component<AbstractConfigProducer<?>, Co
String dispatcherComponentId = "dispatcher." + indexedSearchCluster.getClusterName(); // used by ClusterSearcher
return new ComponentModel(dispatcherComponentId,
com.yahoo.search.dispatch.Dispatcher.class.getName(),
- PlatformBundles.searchAndDocprocBundle);
+ PlatformBundles.SEARCH_AND_DOCPROC_BUNDLE);
}
@Override
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/GUIHandler.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/GUIHandler.java
index c6b0eb28ed3..b00faa80715 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/GUIHandler.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/GUIHandler.java
@@ -20,7 +20,7 @@ public class GUIHandler extends Handler {
}
public static BundleInstantiationSpecification bundleSpec(String className, String bundle) {
- return BundleInstantiationSpecification.getFromStrings(className, className, bundle);
+ return BundleInstantiationSpecification.fromStrings(className, className, bundle);
}
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/RpcResourcePoolComponent.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/RpcResourcePoolComponent.java
index 956d551f6b3..b4b2af3c808 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/RpcResourcePoolComponent.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/RpcResourcePoolComponent.java
@@ -13,6 +13,6 @@ public class RpcResourcePoolComponent extends Component<RpcResourcePoolComponent
private static ComponentModel toComponentModel(String clusterName) {
String componentId = "rpcresourcepool." + clusterName;
- return new ComponentModel(componentId, com.yahoo.search.dispatch.rpc.RpcResourcePool.class.getName(), PlatformBundles.searchAndDocprocBundle);
+ return new ComponentModel(componentId, com.yahoo.search.dispatch.rpc.RpcResourcePool.class.getName(), PlatformBundles.SEARCH_AND_DOCPROC_BUNDLE);
}
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleInstantiationSpecificationBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleInstantiationSpecificationBuilder.java
index 41f0c0792b0..cdea63cfb70 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleInstantiationSpecificationBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleInstantiationSpecificationBuilder.java
@@ -5,7 +5,6 @@ import com.yahoo.config.model.builder.xml.XmlHelper;
import com.yahoo.container.bundle.BundleInstantiationSpecification;
import com.yahoo.component.ComponentSpecification;
import com.yahoo.vespa.model.container.PlatformBundles;
-import com.yahoo.vespa.model.container.component.chain.ProcessingHandler;
import org.w3c.dom.Element;
import java.util.Arrays;
@@ -33,7 +32,7 @@ public class BundleInstantiationSpecificationBuilder {
private static BundleInstantiationSpecification setBundleForSearchAndDocprocComponents(BundleInstantiationSpecification spec) {
if (PlatformBundles.isSearchAndDocprocClass(spec.getClassName()))
- return spec.inBundle(PlatformBundles.searchAndDocprocBundle);
+ return spec.inBundle(PlatformBundles.SEARCH_AND_DOCPROC_BUNDLE);
else
return spec;
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/CloudSecretStore.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/CloudSecretStore.java
index 18916f1e09b..373eb9714d3 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/CloudSecretStore.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/CloudSecretStore.java
@@ -21,7 +21,7 @@ public class CloudSecretStore extends SimpleComponent implements SecretStoreConf
private final List<StoreConfig> configList;
public CloudSecretStore() {
- super(new ComponentModel(BundleInstantiationSpecification.getFromStrings(CLASS, CLASS, BUNDLE)));
+ super(new ComponentModel(BundleInstantiationSpecification.fromStrings(CLASS, CLASS, BUNDLE)));
configList = new ArrayList<>();
}
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 ec447544073..a8ce0219434 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
@@ -889,7 +889,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
// Magic spell is needed to receive the chains config :-|
cluster.addComponent(new ProcessingHandler<>(
cluster.getSearch().getChains(),
- BundleInstantiationSpecification.getInternalHandlerSpecificationFromStrings("com.yahoo.search.searchchain.ExecutionFactory", null)));
+ BundleInstantiationSpecification.fromSearchAndDocproc("com.yahoo.search.searchchain.ExecutionFactory")));
cluster.addComponent(
new SearchHandler(
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/SearchHandler.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/SearchHandler.java
index 6b0bf8a67b9..7e1b3be9240 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/SearchHandler.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/SearchHandler.java
@@ -5,6 +5,7 @@ import com.yahoo.container.bundle.BundleInstantiationSpecification;
import com.yahoo.container.handler.threadpool.ContainerThreadpoolConfig;
import com.yahoo.vespa.model.container.ApplicationContainerCluster;
import com.yahoo.vespa.model.container.ContainerThreadpool;
+import com.yahoo.vespa.model.container.PlatformBundles;
import com.yahoo.vespa.model.container.component.BindingPattern;
import com.yahoo.vespa.model.container.component.SystemBindingPattern;
import com.yahoo.vespa.model.container.component.chain.ProcessingHandler;
@@ -12,7 +13,7 @@ import com.yahoo.vespa.model.container.search.searchchain.SearchChains;
import java.util.List;
-import static com.yahoo.container.bundle.BundleInstantiationSpecification.getInternalHandlerSpecificationFromStrings;
+import static com.yahoo.container.bundle.BundleInstantiationSpecification.fromSearchAndDocproc;
/**
* Component definition for {@link com.yahoo.search.handler.SearchHandler}
@@ -22,7 +23,7 @@ import static com.yahoo.container.bundle.BundleInstantiationSpecification.getInt
class SearchHandler extends ProcessingHandler<SearchChains> {
static final String HANDLER_CLASS = com.yahoo.search.handler.SearchHandler.class.getName();
- static final BundleInstantiationSpecification HANDLER_SPEC = getInternalHandlerSpecificationFromStrings(HANDLER_CLASS, null);
+ static final BundleInstantiationSpecification HANDLER_SPEC = fromSearchAndDocproc(HANDLER_CLASS);
static final BindingPattern DEFAULT_BINDING = SystemBindingPattern.fromHttpPath("/search/*");
SearchHandler(ApplicationContainerCluster cluster,
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/document/DocumentFactoryBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/document/DocumentFactoryBuilder.java
index 5df862647a0..7f3d7981bb6 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/document/DocumentFactoryBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/document/DocumentFactoryBuilder.java
@@ -31,7 +31,7 @@ public class DocumentFactoryBuilder {
String concDocFactory=pkg+"."+CONCRETE_DOC_FACTORY_CLASS;
String bundle = e.getAttribute("bundle");
Component<AbstractConfigProducer<?>, ComponentModel> component = new Component<>(
- new ComponentModel(BundleInstantiationSpecification.getFromStrings(concDocFactory, concDocFactory, bundle)));
+ new ComponentModel(BundleInstantiationSpecification.fromStrings(concDocFactory, concDocFactory, bundle)));
if (!cluster.getComponentsMap().containsKey(component.getComponentId())) cluster.addComponent(component);
types.put(type, concDocFactory);
}