diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2024-03-14 09:32:35 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2024-03-14 19:55:00 +0100 |
commit | 3c1d192192f903b0dffc81b2f3503830a705f0eb (patch) | |
tree | ba2c490cf64c36f7af94f00b72545597202b2194 /config-model/src/test/java | |
parent | b18fce14bf06de85aa9663ba182eb9db0f77d781 (diff) |
Revert "Revert "Balder/single searchcluster""
Diffstat (limited to 'config-model/src/test/java')
5 files changed, 17 insertions, 37 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/StreamingValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/StreamingValidatorTest.java index d3e62dae947..2879baf7b88 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/StreamingValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/StreamingValidatorTest.java @@ -29,7 +29,7 @@ public class StreamingValidatorTest { new VespaModelCreatorWithFilePkg("src/test/cfg/application/validation/document_references_validation/") .create(); }); - assertTrue(exception.getMessage().contains("For search cluster 'content.ad', streaming schema 'ad': Attribute 'campaign_ref' has type 'Reference<campaign>'. " + + assertTrue(exception.getMessage().contains("For search cluster 'content', streaming schema 'ad': Attribute 'campaign_ref' has type 'Reference<campaign>'. " + "Document references and imported fields are not allowed in streaming search.")); } @@ -52,7 +52,7 @@ public class StreamingValidatorTest { "attribute { distance-metric: euclidean } }"); var warnings = filter(logger.warnings); assertEquals(1, warnings.size()); - assertEquals("For search cluster 'content.test', streaming schema 'test', SD field 'nn': hnsw index is not relevant and not supported, ignoring setting", + assertEquals("For search cluster 'content', streaming schema 'test', SD field 'nn': hnsw index is not relevant and not supported, ignoring setting", warnings.get(0)); } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/StreamingSchemaClusterChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/StreamingSchemaClusterChangeValidatorTest.java index ee64ceb6969..28eabd18539 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/StreamingSchemaClusterChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/StreamingSchemaClusterChangeValidatorTest.java @@ -92,9 +92,9 @@ public class StreamingSchemaClusterChangeValidatorTest { private static final String ATTRIBUTE_INT_FIELD = "field f1 type int { indexing: attribute | summary }"; private static final String ATTRIBUTE_FAST_ACCESS_INT_FIELD = "field f1 type int { indexing: attribute | summary \n attribute: fast-access }"; private static final List<ServiceInfo> FOO_SERVICE = - List.of(new ServiceInfo("searchnode", "null", null, null, "foo/search/0", "null")); + List.of(new ServiceInfo("searchnode", "null", null, null, "foo/search/cluster.foo/0", "null")); private static final List<ServiceInfo> BAR_SERVICE = - List.of(new ServiceInfo("searchnode2", "null", null, null, "bar/search/0", "null")); + List.of(new ServiceInfo("searchnode2", "null", null, null, "bar/search/cluster.bar/0", "null")); @Test void changing_field_type_requires_refeed() { 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 d3e69e64fe6..327b169a629 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 @@ -196,11 +196,10 @@ public class ContentBuilderTest extends DomBuilderTest { ContentSearchCluster s; s = cluster.getSearch(); - assertFalse(s.hasIndexedCluster()); + assertTrue(s.hasIndexedCluster()); assertEquals(1, s.getClusters().size()); - assertNull(s.getIndexed()); - SearchCluster sc = s.getClusters().get(musicClusterId + ".music"); - assertEquals(musicClusterId + ".music", sc.getClusterName()); + SearchCluster sc = s.getClusters().get(musicClusterId); + assertEquals(musicClusterId, sc.getClusterName()); assertEquals(musicClusterId, sc.getStorageRouteSpec()); assertTrue(cluster.getPersistence() instanceof ProtonEngine.Factory); @@ -236,24 +235,11 @@ public class ContentBuilderTest extends DomBuilderTest { " <node hostalias=\"mockhost\" distribution-key=\"0\"/>" + " </group>" + "</content>"); - ContentSearchCluster s; - - s = cluster.getSearch(); - assertFalse(s.hasIndexedCluster()); - assertEquals(2, s.getClusters().size()); - assertNull(s.getIndexed()); - { - String id = musicClusterId + ".book"; - SearchCluster sc = s.getClusters().get(id); - assertEquals(id, sc.getClusterName()); - assertEquals(musicClusterId, sc.getStorageRouteSpec()); - } - { - String id = musicClusterId + ".music"; - SearchCluster sc = s.getClusters().get(id); - assertEquals(id, sc.getClusterName()); - assertEquals(musicClusterId, sc.getStorageRouteSpec()); - } + ContentSearchCluster s = cluster.getSearch(); + assertTrue(s.hasIndexedCluster()); + assertEquals(2, s.getIndexed().getDocumentDbs().size()); + assertTrue(s.getIndexed().hasDocumentDB("book")); + assertTrue(s.getIndexed().hasDocumentDB("music")); assertTrue(cluster.getPersistence() instanceof ProtonEngine.Factory); assertEquals(1, cluster.getStorageCluster().getChildren().size()); @@ -362,9 +348,7 @@ public class ContentBuilderTest extends DomBuilderTest { " <node hostalias=\"mockhost\" distribution-key=\"0\" />" + " </group>" + "</content>", new TestProperties().setEnvironmentVariables(List.of("MY_1_ENV=xyz abc", "MY_2_ENV=2"))); - ContentSearchCluster s; - - s = b.getSearch(); + ContentSearchCluster s = b.getSearch(); assertTrue(s.hasIndexedCluster()); assertNotNull(s.getIndexed()); assertEquals(1, b.getStorageCluster().getChildren().size()); 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 6f9127779db..ae08f78c404 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 @@ -163,7 +163,6 @@ public class IndexedTest extends ContentBaseTest { // "transactionlogserver"}; // DomContentBuilderTest.assertServices(h, expectedServices); ContentCluster s = model.getContentClusters().get("test"); - assertFalse(s.getSearch().hasIndexedCluster()); StorServerConfig.Builder builder = new StorServerConfig.Builder(); s.getStorageCluster().getConfig(builder); @@ -175,7 +174,6 @@ public class IndexedTest extends ContentBaseTest { VespaModel model = getStreamingVespaModel(); ContentCluster s = model.getContentClusters().get("test"); assertNotNull(s); - assertFalse(s.getSearch().hasIndexedCluster()); ClusterListConfig config = model.getConfig(ClusterListConfig.class, VespaModel.ROOT_CONFIGID); assertEquals(1, config.storage().size()); assertEquals("test", config.storage(0).name()); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/search/test/DocumentDatabaseTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/search/test/DocumentDatabaseTestCase.java index d3741405c15..fc7a10b6368 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/search/test/DocumentDatabaseTestCase.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/search/test/DocumentDatabaseTestCase.java @@ -309,7 +309,7 @@ public class DocumentDatabaseTestCase { var tester = new SchemaTester(); var model = tester.createModelWithMode(mode, sds); - DocumentdbInfoConfig dcfg = model.getConfig(DocumentdbInfoConfig.class, "test/search/cluster.test.type"); + DocumentdbInfoConfig dcfg = model.getConfig(DocumentdbInfoConfig.class, "test/search/cluster.test"); assertEquals(1, dcfg.documentdb().size()); DocumentdbInfoConfig.Documentdb db = dcfg.documentdb(0); assertEquals("type", db.name()); @@ -328,13 +328,11 @@ public class DocumentDatabaseTestCase { var tester = new SchemaTester(); var model = tester.createModel(sds, ""); DocumentdbInfoConfig indexed_cfg = model.getConfig(DocumentdbInfoConfig.class, "test/search/cluster.test"); - assertEquals(1, indexed_cfg.documentdb().size()); + assertEquals(2, indexed_cfg.documentdb().size()); var db = indexed_cfg.documentdb(0); assertEquals("a", db.name()); assertEquals(DocumentdbInfoConfig.Documentdb.Mode.INDEX, db.mode()); - DocumentdbInfoConfig streaming_cfg = model.getConfig(DocumentdbInfoConfig.class, "test/search/cluster.test.b"); - assertEquals(1, streaming_cfg.documentdb().size()); - db = streaming_cfg.documentdb(0); + db = indexed_cfg.documentdb(1); assertEquals("b", db.name()); assertEquals(DocumentdbInfoConfig.Documentdb.Mode.STREAMING, db.mode()); } @@ -390,7 +388,7 @@ public class DocumentDatabaseTestCase { @Test void testThatAttributesConfigIsProducedForStreamingForFastAccessFields() { assertAttributesConfigIndependentOfMode("streaming", List.of("type1"), - List.of("test/search/type1"), + List.of("test/search/cluster.test/type1"), Map.of("type1", List.of("f2"))); } |