use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class MultilevelDispatchTest method requireThatSearchCoverageIsSetInMultilevelSetup.
@Test
public void requireThatSearchCoverageIsSetInMultilevelSetup() throws Exception {
ContentCluster cr = createCluster(getSimpleDispatchXml() + getCoverage());
Dispatch tld = cr.getSearch().getIndexed().getTLDs().get(0);
PartitionsConfig.Builder builder = new PartitionsConfig.Builder();
tld.getConfig(builder);
PartitionsConfig config = new PartitionsConfig(builder);
assertThat(config.dataset().size(), is(1));
assertEquals(95.0, config.dataset(0).minimal_searchcoverage(), 0.1);
for (Dispatch dispatch : getDispatchers(tld)) {
PartitionsConfig.Builder b = new PartitionsConfig.Builder();
dispatch.getConfig(b);
PartitionsConfig c = new PartitionsConfig(b);
assertThat(c.dataset().size(), is(1));
assertEquals(95.0, c.dataset(0).minimal_searchcoverage(), 0.1);
}
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class MultilevelDispatchTest method createCluster.
private ContentCluster createCluster(String dispatchXml) throws Exception {
String[] hosts = { "mh0", "mh1", "mh2", "mh3", "mh4", "mh5" };
MockRoot root = ContentClusterUtils.createMockRoot(hosts);
ContentCluster cluster = ContentClusterUtils.createCluster(createClusterXml(getGroupXml(), Optional.of(dispatchXml), 1, 1), root);
AbstractConfigProducer<Dispatch> dispatchParent = new SimpleConfigProducer<>(root, "tlds");
HostResource hostResource = new HostResource(new Host(root, "mockhost"));
IndexedSearchCluster index = cluster.getSearch().getIndexed();
index.addTld(dispatchParent, hostResource);
index.setupDispatchGroups();
root.freezeModelTopology();
cluster.validate();
return cluster;
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class IndexedHierarchicDistributionTest method requireThatSearchNodesAreCorrectWithTwoGroups.
@Test
public void requireThatSearchNodesAreCorrectWithTwoGroups() throws Exception {
ContentCluster c = getTwoGroupsCluster();
List<SearchNode> searchNodes = c.getSearch().getSearchNodes();
assertEquals(6, searchNodes.size());
assertSearchNode(0, 0, 0, searchNodes.get(0));
assertSearchNode(0, 1, 1, searchNodes.get(1));
assertSearchNode(0, 2, 2, searchNodes.get(2));
assertSearchNode(1, 0, 3, searchNodes.get(3));
assertSearchNode(1, 1, 4, searchNodes.get(4));
assertSearchNode(1, 2, 5, searchNodes.get(5));
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class IndexedHierarchicDistributionTest method requireThatActivePerLeafGroupIsDefaultWithOneGroup.
@Test
public void requireThatActivePerLeafGroupIsDefaultWithOneGroup() throws Exception {
ContentCluster c = getOneGroupCluster();
assertFalse(getStorDistributionConfig(c).active_per_leaf_group());
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class IndexedTest method requireProtonStreamingOnly.
@Test
public void requireProtonStreamingOnly() {
VespaModel model = getStreamingVespaModel();
HostResource h = model.getHostSystem().getHosts().get(0);
String[] expectedServices = { "logserver", "configserver", "adminserver", "slobrok", "logd", "configproxy", "config-sentinel", "qrserver", "storagenode", "searchnode", "distributor", "transactionlogserver" };
// TODO DomContentBuilderTest.assertServices(h, expectedServices);
ContentCluster s = model.getContentClusters().get("test");
assertFalse(s.getSearch().hasIndexedCluster());
StorServerConfig.Builder builder = new StorServerConfig.Builder();
s.getStorageNodes().getConfig(builder);
s.getStorageNodes().getChildren().get("3").getConfig(builder);
}
Aggregations