Search in sources :

Example 1 with SearchInterface

use of com.yahoo.vespa.model.search.SearchInterface 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());
}
Also used : SearchInterface(com.yahoo.vespa.model.search.SearchInterface) DispatchGroup(com.yahoo.vespa.model.search.DispatchGroup) ArrayList(java.util.ArrayList) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Aggregations

ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)1 DispatchGroup (com.yahoo.vespa.model.search.DispatchGroup)1 SearchInterface (com.yahoo.vespa.model.search.SearchInterface)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1