use of com.yahoo.vespa.model.search.DispatchGroup 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());
}
Aggregations