diff options
12 files changed, 121 insertions, 135 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java b/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java index e76e40f2235..e8103f1d1df 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java @@ -55,7 +55,6 @@ import com.yahoo.vespa.model.ml.ConvertedModel; import com.yahoo.vespa.model.ml.ModelName; import com.yahoo.vespa.model.ml.OnnxModelInfo; import com.yahoo.vespa.model.routing.Routing; -import com.yahoo.vespa.model.search.DocumentDatabase; import com.yahoo.vespa.model.search.SearchCluster; import com.yahoo.vespa.model.utils.internal.ReflectionUtil; import org.xml.sax.SAXException; @@ -207,9 +206,9 @@ public final class VespaModel extends AbstractConfigProducerRoot implements Mode .map(type -> type.getFullName().getName()) .collect(Collectors.toCollection(LinkedHashSet::new)); - Set<String> typesWithIndexedFields = content.getSearch().getIndexed() == null + Set<String> typesWithIndexedFields = content.getSearch().getSearchCluster() == null ? Set.of() - : content.getSearch().getIndexed().schemas().values().stream() + : content.getSearch().getSearchCluster().schemas().values().stream() .filter(schemaInfo -> schemaInfo.fullSchema() .allConcreteFields() .stream().anyMatch(SDField::doesIndexing)) diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidator.java index 5117fb7272c..f95ae0b6153 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/IndexedSearchClusterChangeValidator.java @@ -8,10 +8,10 @@ import com.yahoo.documentmodel.NewDocumentType; import com.yahoo.vespa.model.AbstractService; import com.yahoo.vespa.model.application.validation.Validation.ChangeContext; import com.yahoo.vespa.model.application.validation.change.search.DocumentDatabaseChangeValidator; -import com.yahoo.vespa.model.content.ContentSearchCluster; import com.yahoo.vespa.model.content.cluster.ContentCluster; import com.yahoo.vespa.model.search.DocumentDatabase; import com.yahoo.vespa.model.search.IndexedSearchCluster; +import com.yahoo.vespa.model.search.SearchCluster; import java.util.ArrayList; import java.util.List; @@ -29,7 +29,7 @@ public class IndexedSearchClusterChangeValidator implements ChangeValidator { public void validate(ChangeContext context) { for (Map.Entry<String, ContentCluster> currentEntry : context.previousModel().getContentClusters().entrySet()) { ContentCluster nextCluster = context.model().getContentClusters().get(currentEntry.getKey()); - if (nextCluster != null && nextCluster.getSearch().hasIndexedCluster()) { + if (nextCluster != null && nextCluster.getSearch().hasSearchCluster()) { validateContentCluster(currentEntry.getValue(), nextCluster, context.deployState()).forEach(context::require); } } @@ -47,9 +47,9 @@ public class IndexedSearchClusterChangeValidator implements ChangeValidator { DeployState deployState) { List<ConfigChangeAction> result = new ArrayList<>(); - for (DocumentDatabase currentDb : getDocumentDbs(currentCluster.getSearch())) { + for (DocumentDatabase currentDb : getDocumentDbs(currentCluster.getSearch().getSearchCluster())) { String docTypeName = currentDb.getName(); - var nextDb = nextCluster.getSearch().getIndexed().getDocumentDB(docTypeName); + var nextDb = nextCluster.getSearch().getSearchCluster().getDocumentDB(docTypeName); if (nextDb != null) { result.addAll(validateDocumentDatabase(currentCluster, nextCluster, docTypeName, currentDb, nextDb, deployState)); @@ -71,14 +71,14 @@ public class IndexedSearchClusterChangeValidator implements ChangeValidator { new DocumentDatabaseChangeValidator(currentCluster.id(), currentDb, currentDocType, nextDb, nextDocType, deployState).validate(); - return modifyActions(result, getSearchNodeServices(nextCluster.getSearch().getIndexed()), docTypeName); + return modifyActions(result, getSearchNodeServices(nextCluster.getSearch().getSearchCluster()), docTypeName); } - private static List<DocumentDatabase> getDocumentDbs(ContentSearchCluster cluster) { - if (cluster.getIndexed() != null) { - return cluster.getIndexed().getDocumentDbs(); + private static List<DocumentDatabase> getDocumentDbs(SearchCluster cluster) { + if (cluster != null) { + return cluster.getDocumentDbs(); } - return new ArrayList<>(); + return List.of(); } private static List<ServiceInfo> getSearchNodeServices(IndexedSearchCluster cluster) { diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java index 39894d95c2c..7c1e0def42d 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/StreamingSearchClusterChangeValidator.java @@ -30,9 +30,9 @@ public class StreamingSearchClusterChangeValidator implements ChangeValidator { context.previousModel().getContentClusters().forEach((clusterName, currentCluster) -> { ContentCluster nextCluster = context.model().getContentClusters().get(clusterName); if (nextCluster != null) { - if (currentCluster.getSearch().getIndexed() != null && nextCluster.getSearch().getIndexed() != null) { - validateStreamingCluster(currentCluster, currentCluster.getSearch().getIndexed(), - nextCluster, nextCluster.getSearch().getIndexed()) + if (currentCluster.getSearch().getSearchCluster() != null && nextCluster.getSearch().getSearchCluster() != null) { + validateStreamingCluster(currentCluster, currentCluster.getSearch().getSearchCluster(), + nextCluster, nextCluster.getSearch().getSearchCluster()) .forEach(context::require); } } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java b/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java index 4ac7a8e442a..3ccc44fe60b 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/Content.java @@ -136,8 +136,9 @@ public class Content extends ConfigModel { public static List<SearchCluster> getSearchClusters(ConfigModelRepo pc) { List<SearchCluster> clusters = new ArrayList<>(); for (ContentCluster c : getContentClusters(pc)) { - if (c.getSearch().hasIndexedCluster()) { - clusters.add(c.getSearch().getIndexed()); + SearchCluster sc = c.getSearch().getSearchCluster(); + if (sc != null) { + clusters.add(sc); } } return clusters; diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java index 378907eafd7..ebb556a2ba2 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java @@ -31,7 +31,6 @@ import java.util.Map; import java.util.Set; import java.util.LinkedHashMap; import java.util.Objects; -import java.util.TreeMap; import java.util.function.Predicate; /** @@ -51,11 +50,8 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> private final boolean flushOnShutdown; private final Boolean syncTransactionLog; - /** If this is set up for streaming search, it is modelled as one search cluster per search definition */ - private final Map<String, SearchCluster> clusters = new TreeMap<>(); - /** The single, indexed search cluster this sets up (supporting multiple document types), or null if none */ - private IndexedSearchCluster indexedCluster; + private IndexedSearchCluster searchCluster; private final IndexingDocproc indexingDocproc; private Redundancy redundancy; @@ -135,7 +131,7 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> search.setVisibilityDelay(visibilityDelay); } - IndexedSearchCluster isc = new IndexedSearchCluster(search, clusterName, 0, search, deployState.featureFlags()); + var isc = new IndexedSearchCluster(search, clusterName, 0, search, deployState.featureFlags()); search.addSearchCluster(deployState, isc, getQueryTimeout(clusterElem), docElem.subElements("document")); } } @@ -175,12 +171,12 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> public void setVisibilityDelay(double delay) { this.visibilityDelay=delay; - if (hasIndexedCluster()) { - indexedCluster.setVisibilityDelay(delay); + if (searchCluster != null) { + searchCluster.setVisibilityDelay(delay); } } - private void addSearchCluster(DeployState deployState, SearchCluster cluster, Double queryTimeout, List<ModelElement> documentDefs) { + private void addSearchCluster(DeployState deployState, IndexedSearchCluster cluster, Double queryTimeout, List<ModelElement> documentDefs) { addSchemas(deployState, documentDefs, cluster); if (queryTimeout != null) { @@ -206,17 +202,11 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> } } - private void addCluster(SearchCluster sc) { - if (clusters.containsKey(sc.getClusterName())) { - throw new IllegalArgumentException("Duplicate cluster '" + sc.getClusterName() + "'"); - } - if (sc instanceof IndexedSearchCluster) { - if (indexedCluster != null) { - throw new IllegalArgumentException("Duplicate indexed cluster '" + indexedCluster.getClusterName() + "'"); - } - indexedCluster = (IndexedSearchCluster)sc; + private void addCluster(IndexedSearchCluster sc) { + if (searchCluster != null) { + throw new IllegalArgumentException("Duplicate indexed cluster '" + searchCluster.getClusterName() + "'"); } - clusters.put(sc.getClusterName(), sc); + searchCluster = sc; } /** @@ -226,26 +216,26 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> * with indexing, null if it has both or none. */ public Boolean isStreaming() { - if (indexedCluster == null) return false; - boolean hasStreaming = indexedCluster.hasStreaming(); - if (indexedCluster.hasIndexed() == hasStreaming) return null; + if (searchCluster == null) return false; + boolean hasStreaming = searchCluster.hasStreaming(); + if (searchCluster.hasIndexed() == hasStreaming) return null; return hasStreaming; } public boolean hasStreaming() { - return (indexedCluster != null) && indexedCluster.hasStreaming(); + return (searchCluster != null) && searchCluster.hasStreaming(); } public boolean hasIndexed() { - return (indexedCluster != null) && indexedCluster.hasIndexed(); + return (searchCluster != null) && searchCluster.hasIndexed(); } public List<SearchNode> getSearchNodes() { - return hasIndexedCluster() ? getIndexed().getSearchNodes() : nonIndexed; + return (searchCluster != null) ? searchCluster.getSearchNodes() : nonIndexed; } public void addSearchNode(DeployState deployState, ContentNode node, StorageGroup parentGroup, ModelElement element) { - TreeConfigProducer<AnyConfigProducer> parent = hasIndexedCluster() ? getIndexed() : this; + TreeConfigProducer<AnyConfigProducer> parent = (searchCluster != null) ? searchCluster : this; NodeSpec spec = getNextSearchNodeSpec(parentGroup); SearchNode searchNode; @@ -267,8 +257,8 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> tls = new TransactionLogServer.Builder(clusterName, syncTransactionLog).build(deployState, searchNode, element.getXml()); } searchNode.setTls(tls); - if (hasIndexedCluster()) { - getIndexed().addSearcher(searchNode); + if (searchCluster != null) { + searchCluster.addSearcher(searchNode); } else { nonIndexed.add(searchNode); } @@ -295,7 +285,7 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> } public boolean usesHierarchicDistribution() { - return indexedCluster != null && groupToSpecMap.size() > 1; + return searchCluster != null && groupToSpecMap.size() > 1; } public void handleRedundancy(Redundancy redundancy) { @@ -313,14 +303,14 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> } private boolean hasIndexingModeStreaming(NewDocumentType type) { - if (indexedCluster == null) return false; - var schemaInfo = indexedCluster.schemas().get(type.getName()); + if (searchCluster == null) return false; + var schemaInfo = searchCluster.schemas().get(type.getName()); return (schemaInfo != null) && (schemaInfo.getIndexMode() == SchemaInfo.IndexMode.STREAMING); } private boolean hasIndexingModeIndexed(NewDocumentType type) { - if (indexedCluster == null) return false; - var schemaInfo = indexedCluster.schemas().get(type.getName()); + if (searchCluster == null) return false; + var schemaInfo = searchCluster.schemas().get(type.getName()); return (schemaInfo != null) && (schemaInfo.getIndexMode() == SchemaInfo.IndexMode.INDEX); } @@ -343,10 +333,10 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> if (hasIndexingModeStreaming(type)) { hasAnyNonIndexedSchema = true; - indexedCluster.fillDocumentDBConfig(type.getFullName().getName(), ddbB); + searchCluster.fillDocumentDBConfig(type.getFullName().getName(), ddbB); ddbB.mode(ProtonConfig.Documentdb.Mode.Enum.STREAMING); } else if (hasIndexingModeIndexed(type)) { - indexedCluster.fillDocumentDBConfig(type.getFullName().getName(), ddbB); + searchCluster.fillDocumentDBConfig(type.getFullName().getName(), ddbB); } else { hasAnyNonIndexedSchema = true; ddbB.mode(ProtonConfig.Documentdb.Mode.Enum.STORE_ONLY); @@ -400,19 +390,19 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> @Override public void getConfig(DispatchNodesConfig.Builder builder) { - if (hasIndexedCluster()) { - getIndexed().getConfig(builder); + if (searchCluster != null) { + searchCluster.getConfig(builder); } } @Override public void getConfig(DispatchConfig.Builder builder) { - if (hasIndexedCluster()) { - getIndexed().getConfig(builder); + if (searchCluster != null) { + searchCluster.getConfig(builder); } } - public IndexedSearchCluster getIndexed() { return indexedCluster; } - public boolean hasIndexedCluster() { return indexedCluster != null; } + public IndexedSearchCluster getSearchCluster() { return searchCluster; } + public boolean hasSearchCluster() { return searchCluster != null; } public IndexingDocproc getIndexingDocproc() { return indexingDocproc; } public String getClusterName() { return clusterName; } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java index 5a9b4bb0760..bac86e37e8f 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/cluster/ContentCluster.java @@ -73,14 +73,14 @@ import static java.util.logging.Level.WARNING; * @author bratseth */ public class ContentCluster extends TreeConfigProducer<AnyConfigProducer> implements - DistributionConfig.Producer, - StorDistributionConfig.Producer, - StorDistributormanagerConfig.Producer, - FleetcontrollerConfig.Producer, - MetricsmanagerConfig.Producer, - MessagetyperouteselectorpolicyConfig.Producer, - BucketspacesConfig.Producer { - + DistributionConfig.Producer, + StorDistributionConfig.Producer, + StorDistributormanagerConfig.Producer, + FleetcontrollerConfig.Producer, + MetricsmanagerConfig.Producer, + MessagetyperouteselectorpolicyConfig.Producer, + BucketspacesConfig.Producer +{ private final String documentSelection; private ContentSearchCluster search; private final boolean isHosted; @@ -177,8 +177,9 @@ public class ContentCluster extends TreeConfigProducer<AnyConfigProducer> implem if (visibilityDelay != null) { csc.setVisibilityDelay(visibilityDelay); } - if (csc.hasIndexedCluster()) { - setupIndexedCluster(csc.getIndexed(), search, element, logger); + IndexedSearchCluster sc = csc.getSearchCluster(); + if (sc != null) { + setupIndexedCluster(sc, search, element, logger); } } @@ -530,7 +531,7 @@ public class ContentCluster extends TreeConfigProducer<AnyConfigProducer> implem super.validate(); if (search.usesHierarchicDistribution() && !isHosted) { // validate manually configured groups - new IndexedHierarchicDistributionValidator(rootGroup, redundancy, search.getIndexed().getTuning().dispatch.getDispatchPolicy()).validate(); + new IndexedHierarchicDistributionValidator(rootGroup, redundancy, search.getSearchCluster().getTuning().dispatch.getDispatchPolicy()).validate(); } new ReservedDocumentTypeNameValidator().validate(documentDefinitions); new GlobalDistributionValidator().validate(documentDefinitions, globallyDistributedDocuments); 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 67d99e300de..c9c7e424ee6 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 @@ -2,12 +2,8 @@ package com.yahoo.vespa.model.search; import com.yahoo.config.model.api.ModelContext; -import com.yahoo.config.model.deploy.DeployState; import com.yahoo.config.model.producer.AnyConfigProducer; import com.yahoo.config.model.producer.TreeConfigProducer; -import com.yahoo.schema.DocumentOnlySchema; -import com.yahoo.schema.derived.DerivedConfiguration; -import com.yahoo.schema.derived.SchemaInfo; import com.yahoo.vespa.config.search.DispatchConfig; import com.yahoo.vespa.config.search.DispatchConfig.DistributionPolicy; import com.yahoo.vespa.config.search.DispatchNodesConfig; diff --git a/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java b/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java index b1d90b07b9d..5ead9812b56 100644 --- a/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java +++ b/config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java @@ -2480,7 +2480,7 @@ public class ModelProvisioningTest { private long protonMemorySize(ContentCluster cluster) { ProtonConfig.Builder b = new ProtonConfig.Builder(); - cluster.getSearch().getIndexed().getSearchNode(0).getConfig(b); + cluster.getSearch().getSearchCluster().getSearchNode(0).getConfig(b); return b.build().hwinfo().memory().size(); } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/ContentClusterFixture.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/ContentClusterFixture.java index e531087ebd6..91ba97817d6 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/ContentClusterFixture.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/ContentClusterFixture.java @@ -44,7 +44,7 @@ public abstract class ContentClusterFixture { } protected DocumentDatabase currentDb() { - return currentCluster.getSearch().getIndexed().getDocumentDbs().get(0); + return currentCluster.getSearch().getSearchCluster().getDocumentDbs().get(0); } protected NewDocumentType currentDocType() { @@ -52,7 +52,7 @@ public abstract class ContentClusterFixture { } protected DocumentDatabase nextDb() { - return nextCluster.getSearch().getIndexed().getDocumentDbs().get(0); + return nextCluster.getSearch().getSearchCluster().getDocumentDbs().get(0); } protected NewDocumentType nextDocType() { diff --git a/config-model/src/test/java/com/yahoo/vespa/model/builder/xml/dom/ContentBuilderTest.java b/config-model/src/test/java/com/yahoo/vespa/model/builder/xml/dom/ContentBuilderTest.java index a4a5f4cb4df..fac82f3e675 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/builder/xml/dom/ContentBuilderTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/builder/xml/dom/ContentBuilderTest.java @@ -62,7 +62,7 @@ public class ContentBuilderTest extends DomBuilderTest { "</content>"); ContentSearchCluster s = a.getSearch(); - assertFalse(s.hasIndexedCluster()); + assertFalse(s.hasSearchCluster()); assertTrue(a.getPersistence() instanceof com.yahoo.vespa.model.content.engines.DummyPersistence.Factory); } @@ -81,7 +81,7 @@ public class ContentBuilderTest extends DomBuilderTest { "</content>"); ContentSearchCluster s = a.getSearch(); - assertFalse(s.hasIndexedCluster()); + assertFalse(s.hasSearchCluster()); assertTrue(a.getPersistence() instanceof ProtonEngine.Factory); @@ -105,7 +105,7 @@ public class ContentBuilderTest extends DomBuilderTest { "</content>"); ContentSearchCluster s = a.getSearch(); - assertFalse(s.hasIndexedCluster()); + assertFalse(s.hasSearchCluster()); assertTrue(a.getPersistence() instanceof ProtonEngine.Factory); @@ -126,8 +126,8 @@ public class ContentBuilderTest extends DomBuilderTest { "</content>"); ContentSearchCluster s = a.getSearch(); - assertFalse(s.hasIndexedCluster()); - assertNull(s.getIndexed()); + assertFalse(s.hasSearchCluster()); + assertNull(s.getSearchCluster()); assertNull(a.getRootGroup().getName()); assertNull(a.getRootGroup().getIndex()); @@ -146,10 +146,10 @@ public class ContentBuilderTest extends DomBuilderTest { ContentCluster c = CollectionUtil.first(m.getContentClusters().values()); ContentSearchCluster s = c.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); - assertEquals("clu", s.getIndexed().getClusterName()); - assertEquals(7.3, s.getIndexed().getQueryTimeout(), 0.0); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); + assertEquals("clu", s.getSearchCluster().getClusterName()); + assertEquals(7.3, s.getSearchCluster().getQueryTimeout(), 0.0); assertTrue(c.getPersistence() instanceof ProtonEngine.Factory); assertEquals(1, c.getStorageCluster().getChildren().size()); @@ -170,7 +170,7 @@ public class ContentBuilderTest extends DomBuilderTest { String services = getServices("<node hostalias='mockhost' distribution-key='0'/>" + "<node hostalias='mockhost' distribution-key='1'/>"); VespaModel m = new VespaModelCreatorWithMockPkg(createAppWithMusic(getHosts(), services)).create(); - IndexedSearchCluster sc = m.getContentClusters().get("clu").getSearch().getIndexed(); + IndexedSearchCluster sc = m.getContentClusters().get("clu").getSearch().getSearchCluster(); assertEquals(2, sc.getSearchNodeCount()); } @@ -191,8 +191,8 @@ public class ContentBuilderTest extends DomBuilderTest { ContentSearchCluster s; s = cluster.getSearch(); - assertTrue(s.hasIndexedCluster()); - SearchCluster sc = s.getIndexed(); + assertTrue(s.hasSearchCluster()); + SearchCluster sc = s.getSearchCluster(); assertEquals(musicClusterId, sc.getClusterName()); assertEquals(musicClusterId, sc.getStorageRouteSpec()); @@ -230,10 +230,10 @@ public class ContentBuilderTest extends DomBuilderTest { " </group>" + "</content>"); ContentSearchCluster s = cluster.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertEquals(2, s.getIndexed().getDocumentDbs().size()); - assertTrue(s.getIndexed().hasDocumentDB("book")); - assertTrue(s.getIndexed().hasDocumentDB("music")); + assertTrue(s.hasSearchCluster()); + assertEquals(2, s.getSearchCluster().getDocumentDbs().size()); + assertTrue(s.getSearchCluster().hasDocumentDB("book")); + assertTrue(s.getSearchCluster().hasDocumentDB("music")); assertTrue(cluster.getPersistence() instanceof ProtonEngine.Factory); assertEquals(1, cluster.getStorageCluster().getChildren().size()); @@ -256,9 +256,9 @@ public class ContentBuilderTest extends DomBuilderTest { ContentSearchCluster s; s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); - assertEquals("b", s.getIndexed().getClusterName()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); + assertEquals("b", s.getSearchCluster().getClusterName()); assertTrue(b.getPersistence() instanceof ProtonEngine.Factory); assertEquals(1, b.getStorageCluster().getChildren().size()); @@ -287,8 +287,8 @@ public class ContentBuilderTest extends DomBuilderTest { ContentSearchCluster s; s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); assertEquals(2, b.getStorageCluster().getChildren().size()); assertTrue(b.getRootGroup().getMmapNoCoreLimit().isPresent()); assertEquals(200000, b.getRootGroup().getMmapNoCoreLimit().get().longValue()); @@ -313,8 +313,8 @@ public class ContentBuilderTest extends DomBuilderTest { ContentSearchCluster s; s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); assertEquals(1, b.getStorageCluster().getChildren().size()); assertEquals(1, s.getSearchNodes().size()); @@ -342,8 +342,8 @@ public class ContentBuilderTest extends DomBuilderTest { " </group>" + "</content>", new TestProperties().setEnvironmentVariables(List.of("MY_1_ENV=xyz abc", "MY_2_ENV=2"))); ContentSearchCluster s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); assertEquals(1, b.getStorageCluster().getChildren().size()); assertEquals(1, s.getSearchNodes().size()); @@ -368,8 +368,8 @@ public class ContentBuilderTest extends DomBuilderTest { ContentSearchCluster s; s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); assertEquals(2, b.getStorageCluster().getChildren().size()); assertTrue(b.getRootGroup().getCoreOnOOM().isPresent()); assertTrue(b.getRootGroup().getCoreOnOOM().get()); @@ -393,8 +393,8 @@ public class ContentBuilderTest extends DomBuilderTest { " </group>" + "</content>"); ContentSearchCluster s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); assertEquals(2, b.getStorageCluster().getChildren().size()); assertFalse(b.getRootGroup().getCoreOnOOM().isPresent()); @@ -417,8 +417,8 @@ public class ContentBuilderTest extends DomBuilderTest { " </group>" + "</content>"); ContentSearchCluster s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); assertEquals(2, b.getStorageCluster().getChildren().size()); assertFalse(b.getRootGroup().getMmapNoCoreLimit().isPresent()); @@ -441,8 +441,8 @@ public class ContentBuilderTest extends DomBuilderTest { " </group>" + "</content>"); ContentSearchCluster s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); assertEquals(2, b.getStorageCluster().getChildren().size()); assertFalse(b.getRootGroup().getCoreOnOOM().isPresent()); @@ -467,8 +467,8 @@ public class ContentBuilderTest extends DomBuilderTest { " </group>" + "</content>"); ContentSearchCluster s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); assertEquals(4, b.getStorageCluster().getChildren().size()); assertTrue(b.getRootGroup().getNoVespaMalloc().isPresent()); assertEquals("proton", b.getRootGroup().getNoVespaMalloc().get()); @@ -501,8 +501,8 @@ public class ContentBuilderTest extends DomBuilderTest { " </group>" + "</content>"); ContentSearchCluster s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); assertEquals(4, b.getStorageCluster().getChildren().size()); assertFalse(b.getRootGroup().getNoVespaMalloc().isPresent()); assertFalse(b.getRootGroup().getVespaMalloc().isPresent()); @@ -532,8 +532,8 @@ public class ContentBuilderTest extends DomBuilderTest { ContentSearchCluster s; s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); assertEquals(2, b.getStorageCluster().getChildren().size()); assertTrue(b.getStorageCluster().getChildren().get("0").getAffinity().isPresent()); assertEquals(0, b.getStorageCluster().getChildren().get("0").getAffinity().get().cpuSocket()); @@ -567,8 +567,8 @@ public class ContentBuilderTest extends DomBuilderTest { ContentSearchCluster s; s = b.getSearch(); - assertTrue(s.hasIndexedCluster()); - assertNotNull(s.getIndexed()); + assertTrue(s.hasSearchCluster()); + assertNotNull(s.getSearchCluster()); assertEquals(6, b.getStorageCluster().getChildren().size()); assertTrue(b.getRootGroup().useCpuSocketAffinity()); @@ -606,18 +606,17 @@ public class ContentBuilderTest extends DomBuilderTest { void requireBug5357273() { try { createContent( - " <content version='1.0' id='storage'>\n" + - " <redundancy>3</redundancy>\n" + - " <documents>" + - " <document type='music' mode='index'/>" + - " </documents>" + - " <group>\n" + - " <node hostalias='mockhost' distribution-key='0' />\n" + - " </group>\n" + - " <engine>\n" + - " <dummy/>\n" + - " </engine>\n" + - " </content>\n"); + """ + <content version='1.0' id='storage'> + <redundancy>3</redundancy> + <documents> <document type='music' mode='index'/> </documents> <group> + <node hostalias='mockhost' distribution-key='0' /> + </group> + <engine> + <dummy/> + </engine> + </content> + """); fail(); } catch (Exception e) { @@ -695,8 +694,8 @@ public class ContentBuilderTest extends DomBuilderTest { " </group>" + "</content>"); ProtonConfig.Builder builder = new ProtonConfig.Builder(); - content.getSearch().getIndexed().getSearchNode(0).cascadeConfig(builder); - content.getSearch().getIndexed().getSearchNode(0).addUserConfig(builder); + content.getSearch().getSearchCluster().getSearchNode(0).cascadeConfig(builder); + content.getSearch().getSearchCluster().getSearchNode(0).addUserConfig(builder); ProtonConfig config = new ProtonConfig(builder); assertEquals(1, config.search().mmap().options().size()); assertEquals(ProtonConfig.Search.Mmap.Options.POPULATE, config.search().mmap().options(0)); @@ -826,8 +825,8 @@ public class ContentBuilderTest extends DomBuilderTest { private ProtonConfig getProtonConfig(ContentCluster content) { ProtonConfig.Builder configBuilder = new ProtonConfig.Builder(); - content.getSearch().getIndexed().getSearchNode(0).cascadeConfig(configBuilder); - content.getSearch().getIndexed().getSearchNode(0).addUserConfig(configBuilder); + content.getSearch().getSearchCluster().getSearchNode(0).cascadeConfig(configBuilder); + content.getSearch().getSearchCluster().getSearchNode(0).addUserConfig(configBuilder); return new ProtonConfig(configBuilder); } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/IndexedTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/IndexedTest.java index ae08f78c404..e9e96d8b0cf 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/IndexedTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/IndexedTest.java @@ -113,7 +113,7 @@ public class IndexedTest extends ContentBaseTest { VespaModelCreatorWithMockPkg creator = getIndexedVespaModelCreator(); VespaModel model = creator.create(); DeployState deployState = creator.deployState; - IndexedSearchCluster cluster = model.getContentClusters().get("test").getSearch().getIndexed(); + IndexedSearchCluster cluster = model.getContentClusters().get("test").getSearch().getSearchCluster(); assertEquals(3, cluster.getDocumentDbs().size()); NewDocumentType type1 = deployState.getDocumentModel().getDocumentManager().getDocumentType("type1"); NewDocumentType type2 = deployState.getDocumentModel().getDocumentManager().getDocumentType("type2"); 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 0cdcf0534c2..8b83c941631 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 @@ -30,7 +30,7 @@ public class ClusterTest { " <query-timeout>1.1</query-timeout>", " <visibility-delay>2.3</visibility-delay>", "</search>")); - SearchCluster searchCluster = cluster.getSearch().getIndexed(); + SearchCluster searchCluster = cluster.getSearch().getSearchCluster(); assertNotNull(searchCluster); assertEquals(1.1, searchCluster.getQueryTimeout(), DELTA); assertEquals(2.3, searchCluster.getVisibilityDelay(), DELTA); |