Search in sources :

Example 1 with ContentClusterBuilder

use of com.yahoo.vespa.model.content.utils.ContentClusterBuilder in project vespa by vespa-engine.

the class ContentSearchClusterTest method createClusterWithMultipleBucketSpacesEnabled.

private static ContentCluster createClusterWithMultipleBucketSpacesEnabled() throws Exception {
    ContentClusterBuilder builder = createClusterBuilderWithGlobalType();
    builder.groupXml(joinLines("<group>", "<node distribution-key='0' hostalias='mockhost'/>", "<node distribution-key='1' hostalias='mockhost'/>", "</group>"));
    builder.enableMultipleBucketSpaces(true);
    String clusterXml = builder.getXml();
    return createCluster(clusterXml, createSearchDefinitions("global", "regular"));
}
Also used : ContentClusterBuilder(com.yahoo.vespa.model.content.utils.ContentClusterBuilder)

Example 2 with ContentClusterBuilder

use of com.yahoo.vespa.model.content.utils.ContentClusterBuilder in project vespa by vespa-engine.

the class ClusterTest method testZoneDependentDistributionBits.

@Test
public void testZoneDependentDistributionBits() throws Exception {
    String xml = new ContentClusterBuilder().docTypes("test").getXml();
    ContentCluster prodWith16Bits = createWithZone(xml, new Zone(Environment.prod, RegionName.from("us-east-3")));
    assertDistributionBitsInConfig(prodWith16Bits, 16);
    ContentCluster stagingNot16Bits = createWithZone(xml, new Zone(Environment.staging, RegionName.from("us-east-3")));
    assertDistributionBitsInConfig(stagingNot16Bits, 8);
}
Also used : ContentClusterBuilder(com.yahoo.vespa.model.content.utils.ContentClusterBuilder) Zone(com.yahoo.config.provision.Zone) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 3 with ContentClusterBuilder

use of com.yahoo.vespa.model.content.utils.ContentClusterBuilder in project vespa by vespa-engine.

the class ContentSearchClusterTest method createClusterWithThreeDocumentTypes.

private static ContentCluster createClusterWithThreeDocumentTypes() throws Exception {
    List<String> searchDefinitions = new ArrayList<>();
    searchDefinitions.add(new SearchDefinitionBuilder().name("a").content(joinLines("field ref_to_b type reference<b> { indexing: attribute }", "field ref_to_c type reference<c> { indexing: attribute }")).build());
    searchDefinitions.add(new SearchDefinitionBuilder().name("b").content("field ref_to_c type reference<c> { indexing: attribute }").build());
    searchDefinitions.add(new SearchDefinitionBuilder().name("c").build());
    return createCluster(new ContentClusterBuilder().docTypes(Arrays.asList(DocType.index("a"), DocType.indexGlobal("b"), DocType.indexGlobal("c"))).getXml(), searchDefinitions);
}
Also used : ContentClusterBuilder(com.yahoo.vespa.model.content.utils.ContentClusterBuilder) ArrayList(java.util.ArrayList) SearchDefinitionBuilder(com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder)

Aggregations

ContentClusterBuilder (com.yahoo.vespa.model.content.utils.ContentClusterBuilder)3 Zone (com.yahoo.config.provision.Zone)1 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)1 SearchDefinitionBuilder (com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1