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"));
}
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);
}
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);
}
Aggregations