use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class DistributorTest method testMaxMergesPerNode.
@Test
public void testMaxMergesPerNode() {
StorDistributormanagerConfig.Builder builder = new StorDistributormanagerConfig.Builder();
DistributorCluster dcluster = parse("<content id=\"storage\">\n" + " <documents/>" + " <group>" + " <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + " </group>" + "</content>");
((ContentCluster) dcluster.getParent()).getConfig(builder);
StorDistributormanagerConfig conf = new StorDistributormanagerConfig(builder);
assertEquals(16, conf.maximum_nodes_per_merge());
builder = new StorDistributormanagerConfig.Builder();
dcluster = parse("<content id=\"storage\">\n" + " <documents/>" + " <tuning>\n" + " <merges max-nodes-per-merge=\"4\"/>\n" + " </tuning>\n" + " <group>" + " <node distribution-key=\"0\" hostalias=\"mockhost\"/>" + " </group>" + "</content>");
((ContentCluster) dcluster.getParent()).getConfig(builder);
conf = new StorDistributormanagerConfig(builder);
assertEquals(4, conf.maximum_nodes_per_merge());
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class IndexedHierarchicDistributionTest method requireThatLeafGroupsCanHaveUnequalNumberOfNodesIfRandomPolicy.
@Test
public void requireThatLeafGroupsCanHaveUnequalNumberOfNodesIfRandomPolicy() throws Exception {
ContentCluster c = getOddGroupsCluster();
DispatchGroup dg = c.getSearch().getIndexed().getRootDispatch();
assertEquals(8, dg.getRowBits());
assertEquals(3, dg.getNumPartitions());
assertEquals(true, dg.useFixedRowInDispatch());
assertEquals(1, dg.getMaxNodesDownPerFixedRow());
ArrayList<SearchInterface> list = new ArrayList<>();
for (SearchInterface si : dg.getSearchersIterable()) {
list.add(si);
}
assertEquals(5, list.size());
assertEquals(0, list.get(0).getNodeSpec().partitionId());
assertEquals(0, list.get(0).getNodeSpec().groupIndex());
assertEquals(0, list.get(1).getNodeSpec().partitionId());
assertEquals(1, list.get(1).getNodeSpec().groupIndex());
assertEquals(1, list.get(2).getNodeSpec().partitionId());
assertEquals(0, list.get(2).getNodeSpec().groupIndex());
assertEquals(1, list.get(3).getNodeSpec().partitionId());
assertEquals(1, list.get(3).getNodeSpec().groupIndex());
assertEquals(2, list.get(4).getNodeSpec().partitionId());
assertEquals(1, list.get(4).getNodeSpec().groupIndex());
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class IndexedHierarchicDistributionTest method requireThatActivePerLeafGroupIsSetWithTwoGroups.
@Test
public void requireThatActivePerLeafGroupIsSetWithTwoGroups() throws Exception {
ContentCluster c = getTwoGroupsCluster();
assertTrue(getStorDistributionConfig(c).active_per_leaf_group());
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class IndexedHierarchicDistributionTest method requireThatDispatcherIsCorrectWithTwoGroups.
@Test
public void requireThatDispatcherIsCorrectWithTwoGroups() throws Exception {
ContentCluster c = getTwoGroupsCluster();
PartitionsConfig.Dataset dataset = getDataset(c.getSearch().getIndexed().getTLDs().get(0));
assertEquals(3, dataset.numparts());
assertEquals(2, dataset.maxnodesdownperfixedrow());
assertEquals(PartitionsConfig.Dataset.Querydistribution.FIXEDROW, dataset.querydistribution());
List<PartitionsConfig.Dataset.Engine> engines = dataset.engine();
assertEquals(6, engines.size());
assertEngine(0, 0, engines.get(0));
assertEngine(1, 0, engines.get(1));
assertEngine(0, 1, engines.get(2));
assertEngine(1, 1, engines.get(3));
assertEngine(0, 2, engines.get(4));
assertEngine(1, 2, engines.get(5));
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class IndexedHierarchicDistributionTest method requireThatSearchNodesAreCorrectWithOneGroup.
@Test
public void requireThatSearchNodesAreCorrectWithOneGroup() throws Exception {
ContentCluster c = getOneGroupCluster();
List<SearchNode> searchNodes = c.getSearch().getSearchNodes();
assertEquals(3, searchNodes.size());
assertSearchNode(0, 0, 0, searchNodes.get(0));
assertSearchNode(0, 1, 1, searchNodes.get(1));
assertSearchNode(0, 2, 2, searchNodes.get(2));
}
Aggregations