aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-11-05 13:33:19 +0100
committergjoranv <gv@oath.com>2019-01-21 15:09:25 +0100
commit8505bd016ec028c4dcdeb04ec4baa07a435e166b (patch)
treee63e493940d11732214b240269f5238cfe7e6903 /config-model/src/main/java
parent6b01125fad374672738a0e68edf7eef5f5463ec9 (diff)
Remove HTTP searchers
Diffstat (limited to 'config-model/src/main/java')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/search/DomProviderBuilder.java71
-rwxr-xr-xconfig-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java3
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/ContainerSearch.java13
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/GenericProvider.java36
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/HttpProvider.java102
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/HttpProviderSearcher.java19
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/SearchChains.java5
7 files changed, 39 insertions, 210 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/search/DomProviderBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/search/DomProviderBuilder.java
index 66b425be8f5..534b07339ec 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/search/DomProviderBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/chains/search/DomProviderBuilder.java
@@ -2,8 +2,6 @@
package com.yahoo.vespa.model.builder.xml.dom.chains.search;
import com.yahoo.binaryprefix.BinaryPrefix;
-import com.yahoo.component.chain.dependencies.Dependencies;
-import com.yahoo.component.chain.model.ChainedComponentModel;
import com.yahoo.component.ComponentId;
import com.yahoo.component.chain.model.ChainSpecification;
import com.yahoo.config.model.deploy.DeployState;
@@ -13,7 +11,7 @@ import com.yahoo.text.XML;
import com.yahoo.config.model.producer.AbstractConfigProducer;
import com.yahoo.vespa.model.builder.xml.dom.BinaryScaledAmountParser;
import com.yahoo.vespa.model.builder.xml.dom.chains.ComponentsBuilder;
-import com.yahoo.vespa.model.container.search.searchchain.HttpProvider;
+import com.yahoo.vespa.model.container.search.searchchain.GenericProvider;
import com.yahoo.vespa.model.container.search.searchchain.LocalProvider;
import com.yahoo.vespa.model.container.search.searchchain.Provider;
import com.yahoo.vespa.model.container.search.searchchain.Source;
@@ -23,7 +21,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-import java.util.stream.Collectors;
/**
* Builds a provider from xml.
@@ -211,9 +208,7 @@ public class DomProviderBuilder extends DomGenericTargetBuilder<Provider> {
ProviderReader providerReader, FederationOptions federationOptions) {
if (providerReader.type == null) {
- return buildEmptyHttpProvider(specWithoutInnerSearchers, providerReader, federationOptions);
- } else if (com.yahoo.search.searchchain.model.federation.HttpProviderSpec.includesType(providerReader.type)) { // TODO: Remove on Vespa 7
- return buildHttpProvider(specWithoutInnerSearchers, providerReader, federationOptions);
+ return new GenericProvider(specWithoutInnerSearchers, federationOptions);
} else if (LocalProviderSpec.includesType(providerReader.type)) {
return buildLocalProvider(specWithoutInnerSearchers, providerReader, federationOptions);
} else {
@@ -236,63 +231,6 @@ public class DomProviderBuilder extends DomGenericTargetBuilder<Provider> {
}
}
- // TODO: Remove on Vespa 7
- @SuppressWarnings("deprecation")
- private Provider buildHttpProvider(ChainSpecification specWithoutInnerSearchers, ProviderReader providerReader, FederationOptions federationOptions) {
- ensureEmpty(specWithoutInnerSearchers.componentId, providerReader.clusterName);
-
- Provider httpProvider = buildEmptyHttpProvider(specWithoutInnerSearchers, providerReader, federationOptions);
-
- httpProvider.addInnerComponent(new com.yahoo.vespa.model.container.search.searchchain.HttpProviderSearcher(
- new ChainedComponentModel(
- com.yahoo.search.searchchain.model.federation.HttpProviderSpec.toBundleInstantiationSpecification(com.yahoo.search.searchchain.model.federation.HttpProviderSpec.Type.valueOf(providerReader.type)),
- Dependencies.emptyDependencies())));
-
- return httpProvider;
- }
-
- // TODO: Remove on Vespa 7
- @SuppressWarnings("deprecation")
- private Provider buildEmptyHttpProvider(ChainSpecification specWithoutInnerSearchers, ProviderReader providerReader, FederationOptions federationOptions) {
- ensureEmpty(specWithoutInnerSearchers.componentId, providerReader.clusterName);
-
- return new HttpProvider(specWithoutInnerSearchers,
- federationOptions,
- new com.yahoo.search.searchchain.model.federation.HttpProviderSpec(
- providerReader.cacheWeight,
- providerReader.path,
- toHttpProviderNodes(providerReader.nodes),
- providerReader.certificateApplicationId,
- providerReader.certificateTtl,
- providerReader.certificateRetryWait,
- toHttpProviderNode(providerReader.certificateProxy),
- providerReader.cacheSizeMB,
- connectionParameters(providerReader)));
- }
-
- // TODO: Remove on Vespa 7
- @SuppressWarnings("deprecation")
- private com.yahoo.search.searchchain.model.federation.HttpProviderSpec.Node toHttpProviderNode(Node node) {
- if (node == null) return null;
- return new com.yahoo.search.searchchain.model.federation.HttpProviderSpec.Node(node.host, node.port);
- }
-
- @SuppressWarnings("deprecation")
- private List<com.yahoo.search.searchchain.model.federation.HttpProviderSpec.Node> toHttpProviderNodes(List<Node> nodes) {
- if (nodes == null) return null;
- return nodes.stream().map(node -> toHttpProviderNode(node)).collect(Collectors.toList());
- }
-
- // TODO: Remove on Vespa 7
- @SuppressWarnings("deprecation")
- private com.yahoo.search.searchchain.model.federation.HttpProviderSpec.ConnectionParameters connectionParameters(ProviderReader providerReader) {
- return new com.yahoo.search.searchchain.model.federation.HttpProviderSpec.ConnectionParameters(
- providerReader.readTimeout,
- providerReader.connectionTimeout,
- providerReader.connectionPoolTimeout,
- providerReader.retries);
- }
-
private void ensureEmpty(ComponentId componentId, Object... objects) {
for (Object object : objects) {
if (object != null) {
@@ -313,10 +251,7 @@ public class DomProviderBuilder extends DomGenericTargetBuilder<Provider> {
@Override
public String toString() {
- return "Node{" +
- "host='" + host + '\'' +
- ", port=" + port +
- '}';
+ return "Node{" + "host='" + host + '\'' + ", port=" + port + '}';
}
}
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 5b98a8e85be..2b2fec2b8d9 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
@@ -629,9 +629,6 @@ public final class ContainerCluster
} else if (isHostedVespa()) {
jvmBuilder.heapSizeAsPercentageOfPhysicalMemory(getHostClusterId().isPresent() ? 17 : 60);
}
- if (containerSearch!=null) {
- jvmBuilder.directMemorySizeCache(containerSearch.totalCacheSizeMb());
- }
if (jvmGCOptions != null) {
jvmBuilder.gcopts(jvmGCOptions);
} else {
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 3a7b7864554..6c537e359d1 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
@@ -8,7 +8,6 @@ import com.yahoo.prelude.semantics.SemanticRulesConfig;
import com.yahoo.vespa.model.container.ContainerCluster;
import com.yahoo.vespa.model.container.component.Component;
import com.yahoo.vespa.model.container.component.ContainerSubsystem;
-import com.yahoo.vespa.model.container.search.searchchain.HttpProvider;
import com.yahoo.vespa.model.container.search.searchchain.LocalProvider;
import com.yahoo.vespa.model.container.search.searchchain.SearchChains;
import com.yahoo.search.config.IndexInfoConfig;
@@ -110,18 +109,6 @@ public class ContainerSearch extends ContainerSubsystem<SearchChains>
if (pageTemplates!=null) pageTemplates.getConfig(builder);
}
- public int totalCacheSizeMb() {
- return totalHttpProviderCacheSize();
- }
-
- private int totalHttpProviderCacheSize() {
- int totalCacheSizeMb = 0;
- for (HttpProvider provider: getChains().httpProviders())
- totalCacheSizeMb += provider.cacheSizeMB();
-
- return totalCacheSizeMb;
- }
-
@Override
public void getConfig(IndexInfoConfig.Builder builder) {
for (AbstractSearchCluster sc : systems) {
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/GenericProvider.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/GenericProvider.java
new file mode 100644
index 00000000000..e1bba1e12fb
--- /dev/null
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/GenericProvider.java
@@ -0,0 +1,36 @@
+// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.vespa.model.container.search.searchchain;
+
+import com.yahoo.component.chain.model.ChainSpecification;
+import com.yahoo.search.cache.QrBinaryCacheConfig;
+import com.yahoo.search.cache.QrBinaryCacheRegionConfig;
+import com.yahoo.search.federation.ProviderConfig;
+import com.yahoo.search.searchchain.model.federation.FederationOptions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.yahoo.search.federation.ProviderConfig.Node;
+import static com.yahoo.search.federation.ProviderConfig.Yca;
+
+
+/**
+ * A generic provider, used when no type is given.
+ *
+ * @author Tony Vaagenes
+ */
+public class GenericProvider extends Provider implements ProviderConfig.Producer {
+
+ /*
+ * Config producer for the contained http searcher..
+ */
+ @SuppressWarnings("deprecation")
+ public GenericProvider(ChainSpecification specWithoutInnerSearchers, FederationOptions federationOptions) {
+ super(specWithoutInnerSearchers, federationOptions);
+ }
+
+ @Override
+ public void getConfig(ProviderConfig.Builder builder) {
+ }
+
+}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/HttpProvider.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/HttpProvider.java
deleted file mode 100644
index 62b2f2ccbc6..00000000000
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/HttpProvider.java
+++ /dev/null
@@ -1,102 +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.vespa.model.container.search.searchchain;
-
-import com.yahoo.binaryprefix.BinaryPrefix;
-import com.yahoo.binaryprefix.BinaryScaledAmount;
-import com.yahoo.component.chain.model.ChainSpecification;
-import com.yahoo.search.cache.QrBinaryCacheConfig;
-import com.yahoo.search.cache.QrBinaryCacheRegionConfig;
-import com.yahoo.search.federation.ProviderConfig;
-import com.yahoo.search.searchchain.model.federation.FederationOptions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static com.yahoo.search.federation.ProviderConfig.Node;
-import static com.yahoo.search.federation.ProviderConfig.Yca;
-
-
-/**
- * A provider containing a http searcher.
- *
- * @author Tony Vaagenes
- */
-public class HttpProvider extends Provider implements ProviderConfig.Producer,
- QrBinaryCacheConfig.Producer,
- QrBinaryCacheRegionConfig.Producer {
-
- @SuppressWarnings("deprecation")
- private final com.yahoo.search.searchchain.model.federation.HttpProviderSpec providerSpec;
-
- /*
- * Config producer for the contained http searcher..
- */
- @SuppressWarnings("deprecation")
- public HttpProvider(ChainSpecification specWithoutInnerSearchers, FederationOptions federationOptions, com.yahoo.search.searchchain.model.federation.HttpProviderSpec providerSpec) {
- super(specWithoutInnerSearchers, federationOptions);
- this.providerSpec = providerSpec;
- }
-
- @Override
- public void getConfig(ProviderConfig.Builder builder) {
- if (providerSpec.path != null)
- builder.path(providerSpec.path);
- if (providerSpec.connectionParameters.readTimeout != null)
- builder.readTimeout(providerSpec.connectionParameters.readTimeout );
- if (providerSpec.connectionParameters.connectionTimeout != null)
- builder.connectionTimeout(providerSpec.connectionParameters.connectionTimeout);
- if (providerSpec.connectionParameters.connectionPoolTimeout != null)
- builder.connectionPoolTimeout(providerSpec.connectionParameters.connectionPoolTimeout);
- if (providerSpec.connectionParameters.retries != null)
- builder.retries(providerSpec.connectionParameters.retries);
-
- builder.node(getNodes(providerSpec.nodes));
-
- if (providerSpec.ycaApplicationId != null) {
- builder.yca(getCertificate(providerSpec));
- }
- }
-
- @SuppressWarnings("deprecation")
- private static Yca.Builder getCertificate(com.yahoo.search.searchchain.model.federation.HttpProviderSpec providerSpec) {
- Yca.Builder certificate = new Yca.Builder()
- .applicationId(providerSpec.ycaApplicationId);
-
- if (providerSpec.ycaProxy != null) {
- certificate.useProxy(true);
- if (providerSpec.ycaProxy.host != null) {
- certificate.host(providerSpec.ycaProxy.host)
- .port(providerSpec.ycaProxy.port);
- }
- }
- if (providerSpec.ycaCertificateTtl != null) certificate.ttl(providerSpec.ycaCertificateTtl);
- if (providerSpec.ycaRetryWait != null) certificate.ttl(providerSpec.ycaRetryWait);
- return certificate;
- }
-
- @SuppressWarnings("deprecation")
- private static List<Node.Builder> getNodes(List<com.yahoo.search.searchchain.model.federation.HttpProviderSpec.Node> nodeSpecs) {
- ArrayList<Node.Builder> nodes = new ArrayList<>();
- for (com.yahoo.search.searchchain.model.federation.HttpProviderSpec.Node node : nodeSpecs) {
- nodes.add(
- new Node.Builder()
- .host(node.host)
- .port(node.port));
- }
- return nodes;
- }
-
- public int cacheSizeMB() {
- return providerSpec.cacheSizeMB != null ? providerSpec.cacheSizeMB : 0;
- }
-
- @Override
- public void getConfig(QrBinaryCacheConfig.Builder builder) {
- builder.cache_size(cacheSizeMB());
- }
-
- @Override
- public void getConfig(QrBinaryCacheRegionConfig.Builder builder) {
- builder.region_size(cacheSizeMB());
- }
-}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/HttpProviderSearcher.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/HttpProviderSearcher.java
deleted file mode 100644
index 8c74496c895..00000000000
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/HttpProviderSearcher.java
+++ /dev/null
@@ -1,19 +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.vespa.model.container.search.searchchain;
-
-import com.yahoo.component.chain.model.ChainedComponentModel;
-
-/**
- * @author Tony Vaagenes
- * @deprecated
- */
-// TODO: Remove on Vespa 7
-@Deprecated
-public class HttpProviderSearcher extends Searcher<ChainedComponentModel> {
-
- public HttpProviderSearcher(ChainedComponentModel model) {
- super(model);
- }
-
-
-}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/SearchChains.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/SearchChains.java
index 42d81e19496..24ff885f131 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/SearchChains.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/SearchChains.java
@@ -74,11 +74,6 @@ public class SearchChains extends Chains<SearchChain> {
return CollectionUtil.filter(allChains().allComponents(), LocalProvider.class);
}
-
- public Collection<HttpProvider> httpProviders() {
- return CollectionUtil.filter(allChains().allComponents(), HttpProvider.class);
- }
-
/*
* If searchChain is a provider, its sources must already have been attached.
*/