diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-10-25 13:40:18 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-10-25 13:40:18 +0200 |
commit | bccd559bd26899198232b67fb470391cd1ba855d (patch) | |
tree | 450020f97b4c6d3ee0d1f9070d11c07ac4b7aa2f /config-model | |
parent | cc7153b5c502bfdfa9603182cfe6848f955075de (diff) | |
parent | 59873ed9fec892a712a8c71b95a45efcfb39d25d (diff) |
Merge with master
Diffstat (limited to 'config-model')
8 files changed, 52 insertions, 60 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDiskAccessValidator.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDiskAccessValidator.java index 8c0c6a74037..2fab941b10e 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDiskAccessValidator.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDiskAccessValidator.java @@ -7,11 +7,14 @@ import com.yahoo.searchdefinition.derived.SummaryClass; import com.yahoo.searchdefinition.document.ImmutableSDField; import com.yahoo.vespa.documentmodel.DocumentSummary; import com.yahoo.vespa.documentmodel.SummaryField; +import com.yahoo.vespa.documentmodel.SummaryTransform; import com.yahoo.vespa.model.container.search.QueryProfiles; import java.util.Optional; import java.util.logging.Level; +import static com.yahoo.searchdefinition.document.ComplexAttributeFieldUtils.isComplexFieldWithOnlyStructFieldAttributes; + /** * Emits a warning for summaries which accesses disk. * @@ -41,7 +44,7 @@ public class SummaryDiskAccessValidator extends Processor { if (field == null && ! source.getName().equals(SummaryClass.DOCUMENT_ID_FIELD)) throw new IllegalArgumentException(summaryField + " in " + summary + " references " + source + ", but this field does not exist"); - if ( ! isInMemory(field) && ! summary.isFromDisk()) { + if ( ! isInMemory(field, summaryField) && ! summary.isFromDisk()) { deployLogger.log(Level.WARNING, summaryField + " in " + summary + " references " + source + ", which is not an attribute: Using this " + "summary will cause disk accesses. " + @@ -52,8 +55,13 @@ public class SummaryDiskAccessValidator extends Processor { } } - private boolean isInMemory(ImmutableSDField field) { + private boolean isInMemory(ImmutableSDField field, SummaryField summaryField) { if (field == null) return false; // For DOCUMENT_ID_FIELD, which may be implicit, but is then not in memory + if (isComplexFieldWithOnlyStructFieldAttributes(field) && + (summaryField.getTransform() == SummaryTransform.ATTRIBUTECOMBINER || + summaryField.getTransform() == SummaryTransform.MATCHED_ATTRIBUTE_ELEMENTS_FILTER)) { + return true; + } return field.doesAttributing(); } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/LocalProvider.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/LocalProvider.java index 4d02082217c..e05b2d27e09 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/LocalProvider.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/searchchain/LocalProvider.java @@ -7,23 +7,18 @@ import com.yahoo.component.chain.model.ChainSpecification; import com.yahoo.component.chain.model.ChainedComponentModel; import com.yahoo.prelude.fastsearch.DocumentdbInfoConfig; import com.yahoo.prelude.cluster.QrMonitorConfig; -import com.yahoo.search.config.dispatchprototype.SearchNodesConfig; -import com.yahoo.vespa.config.search.DispatchConfig; import com.yahoo.vespa.config.search.RankProfilesConfig; import com.yahoo.vespa.config.search.AttributesConfig; import com.yahoo.search.config.ClusterConfig; import com.yahoo.search.searchchain.model.federation.FederationOptions; import com.yahoo.search.searchchain.model.federation.LocalProviderSpec; import com.yahoo.vespa.model.search.AbstractSearchCluster; -import com.yahoo.vespa.model.search.IndexedSearchCluster; -import com.yahoo.vespa.model.search.SearchNode; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; - /** * Config producer for search chain responsible for sending queries to a local cluster. * @@ -34,8 +29,7 @@ public class LocalProvider extends Provider implements ClusterConfig.Producer, AttributesConfig.Producer, QrMonitorConfig.Producer, - RankProfilesConfig.Producer, - SearchNodesConfig.Producer { + RankProfilesConfig.Producer { private final LocalProviderSpec providerSpec; private volatile AbstractSearchCluster searchCluster; @@ -72,22 +66,6 @@ public class LocalProvider extends Provider implements } } - @Override - public void getConfig(final SearchNodesConfig.Builder builder) { - if (!(searchCluster instanceof IndexedSearchCluster)) { - log.warning("Could not build SearchNodesConfig: Only supported for IndexedSearchCluster, got " - + searchCluster.getClass().getCanonicalName()); - return; - } - final IndexedSearchCluster indexedSearchCluster = (IndexedSearchCluster) searchCluster; - for (final SearchNode searchNode : indexedSearchCluster.getSearchNodes()) { - builder.search_node( - new SearchNodesConfig.Search_node.Builder() - .host(searchNode.getHostName()) - .port(searchNode.getDispatchPort())); - } - } - private void addProviderSearchers() { for (ChainedComponentModel searcherModel : LocalProviderSpec.searcherModels) { addInnerComponent(new Searcher<>(searcherModel)); @@ -124,7 +102,7 @@ public class LocalProvider extends Provider implements return providerSpec.clusterName; } - public void setSearchCluster(AbstractSearchCluster searchCluster) { + void setSearchCluster(AbstractSearchCluster searchCluster) { this.searchCluster = searchCluster; } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java index 3ea36dc800e..64ac00020f7 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/IndexedSearchCluster.java @@ -302,7 +302,6 @@ public class IndexedSearchCluster extends SearchCluster nodeBuilder.group(node.getNodeSpec().groupIndex()); nodeBuilder.host(node.getHostName()); nodeBuilder.port(node.getRpcPort()); - nodeBuilder.fs4port(node.getDispatchPort()); builder.node(nodeBuilder); } if (useAdaptiveDispatch) diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchInterface.java b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchInterface.java index c7d69b6818a..7a3fc7dd715 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchInterface.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchInterface.java @@ -10,7 +10,6 @@ package com.yahoo.vespa.model.search; public interface SearchInterface { NodeSpec getNodeSpec(); - String getDispatcherConnectSpec(); String getHostName(); } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java index fe1a61086f2..a174e7c38e8 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNode.java @@ -64,8 +64,8 @@ public class SearchNode extends AbstractService implements private final Optional<Tuning> tuning; private final Optional<ResourceLimits> resourceLimits; private static final int RPC_PORT = 0; - private static final int FS4_PORT = 1; - private static final int FUTURE_HEALTH_PORT = 2; + private static final int UNUSED_1 = 1; + private static final int UNUSED_2 = 2; private static final int UNUSED_3 = 3; private static final int HEALTH_PORT = 4; @@ -123,8 +123,8 @@ public class SearchNode extends AbstractService implements this.clusterName = clusterName; this.flushOnShutdown = flushOnShutdown; portsMeta.on(RPC_PORT).tag("rpc").tag("rtc").tag("admin").tag("status"); - portsMeta.on(FS4_PORT).tag("fs4"); - portsMeta.on(FUTURE_HEALTH_PORT).tag("unused"); + portsMeta.on(UNUSED_1).tag("unused"); + portsMeta.on(UNUSED_2).tag("unused"); portsMeta.on(UNUSED_3).tag("unused"); portsMeta.on(HEALTH_PORT).tag("http").tag("json").tag("health").tag("state"); // Properties are set in DomSearchBuilder @@ -156,7 +156,7 @@ public class SearchNode extends AbstractService implements this.redundancy = redundancy; } - public void updatePartition(int partitionId) { + void updatePartition(int partitionId) { nodeSpec = new NodeSpec(nodeSpec.groupIndex(), partitionId); } @@ -169,8 +169,8 @@ public class SearchNode extends AbstractService implements public void allocatePorts(int start, PortAllocBridge from) { // NB: ignore "start" from.allocatePort("rpc"); - from.allocatePort("fs4"); - from.allocatePort("future/4"); + from.allocatePort("unused/1"); + from.allocatePort("unused/2"); from.allocatePort("unused/3"); from.allocatePort("health"); } @@ -208,20 +208,6 @@ public class SearchNode extends AbstractService implements return distributionKey; } - /** - * Returns the connection spec string that resolves to the dispatcher service - * on this node. - * - * @return The connection string. - */ - public String getDispatcherConnectSpec() { - return "tcp/" + getHost().getHostname() + ":" + getDispatchPort(); - } - - public int getDispatchPort() { - return getRelativePort(FS4_PORT); - } - private int getHttpPort() { return getRelativePort(HEALTH_PORT); } @@ -236,7 +222,7 @@ public class SearchNode extends AbstractService implements return getHostName(); } - public TransactionLogServer getTransactionLogServer() { + private TransactionLogServer getTransactionLogServer() { return tls; } @@ -269,7 +255,6 @@ public class SearchNode extends AbstractService implements @Override public void getConfig(ProtonConfig.Builder builder) { builder. - ptport(getDispatchPort()). rpcport(getRpcPort()). httpport(getHttpPort()). partition(getNodeSpec().partitionId()). diff --git a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNodeWrapper.java b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNodeWrapper.java index fea3285e9a0..73feb0d3a16 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNodeWrapper.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/search/SearchNodeWrapper.java @@ -17,11 +17,6 @@ public class SearchNodeWrapper implements SearchInterface { } @Override - public String getDispatcherConnectSpec() { - return node.getDispatcherConnectSpec(); - } - - @Override public String getHostName() { return node.getHostName(); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java index f94ac1c285c..6fbd80adaa9 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/SummaryTestCase.java @@ -97,4 +97,36 @@ public class SummaryTestCase { assertTrue(logger.entries.isEmpty()); } + @Test + public void testStructMemorySummary() throws ParseException { + String sd = + "search structmemorysummary {\n" + + " document structmemorysummary {\n" + + " struct elem {\n" + + " field name type string {}\n" + + " field weight type int {}\n" + + " }\n" + + " field elem_array type array<elem> {\n" + + " indexing: summary\n" + + " struct-field name {\n" + + " indexing: attribute\n" + + " }\n" + + " struct-field weight {\n" + + " indexing: attribute\n" + + " }\n" + + " }\n" + + " }\n" + + " document-summary filtered {\n" + + " summary elem_array_filtered type array<elem> {\n" + + " source: elem_array\n" + + " matched-elements-only\n" + + " }\n" + + " }\n" + + "\n" + + "}"; + DeployLoggerStub logger = new DeployLoggerStub(); + SearchBuilder.createFromString(sd, logger); + assertTrue(logger.entries.isEmpty()); + } + } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/ClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/ClusterTest.java index 54ded910bfa..319c871f996 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/ClusterTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/ClusterTest.java @@ -117,10 +117,6 @@ public class ClusterTest { assertEquals(19118, config.node(1).port()); assertEquals(19130, config.node(2).port()); - assertEquals(19107, config.node(0).fs4port()); - assertEquals(19119, config.node(1).fs4port()); - assertEquals(19131, config.node(2).fs4port()); - assertEquals(0, config.node(0).group()); assertEquals(0, config.node(1).group()); assertEquals(0, config.node(2).group()); |