Search in sources :

Example 1 with SearchNode

use of com.yahoo.vespa.model.search.SearchNode in project vespa by vespa-engine.

the class IndexedSearchNodeNamingTest method requireThatMultipleNodesAreNamedAfterDistributionKey.

@Test
public void requireThatMultipleNodesAreNamedAfterDistributionKey() throws Exception {
    ContentCluster cluster = getMultiNodeCluster();
    List<SearchNode> nodes = cluster.getSearch().getSearchNodes();
    assertEquals(3, nodes.size());
    assertSearchNode("n5", "5", nodes.get(0));
    assertSearchNode("n3", "3", nodes.get(1));
    assertSearchNode("n7", "7", nodes.get(2));
}
Also used : SearchNode(com.yahoo.vespa.model.search.SearchNode) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 2 with SearchNode

use of com.yahoo.vespa.model.search.SearchNode in project vespa by vespa-engine.

the class IndexedSearchNodeNamingTest method requireThatSingleNodeIsNamedAfterDistributionKey.

@Test
public void requireThatSingleNodeIsNamedAfterDistributionKey() throws Exception {
    ContentCluster cluster = getSingleNodeCluster();
    List<SearchNode> nodes = cluster.getSearch().getSearchNodes();
    assertSearchNode("n3", "3", nodes.get(0));
}
Also used : SearchNode(com.yahoo.vespa.model.search.SearchNode) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 3 with SearchNode

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

Example 4 with SearchNode

use of com.yahoo.vespa.model.search.SearchNode in project vespa by vespa-engine.

the class IndexedSearchNodeNamingTest method requireThatNodesInHierarchicGroupsAreNamedAfterDistributionKey.

@Test
public void requireThatNodesInHierarchicGroupsAreNamedAfterDistributionKey() throws Exception {
    ContentCluster cluster = getMultiGroupCluster();
    List<SearchNode> nodes = cluster.getSearch().getSearchNodes();
    assertEquals(4, nodes.size());
    assertSearchNode("n7", "7", nodes.get(0));
    assertSearchNode("n11", "11", nodes.get(1));
    assertSearchNode("n17", "17", nodes.get(2));
    assertSearchNode("n13", "13", nodes.get(3));
}
Also used : SearchNode(com.yahoo.vespa.model.search.SearchNode) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Example 5 with SearchNode

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

Aggregations

SearchNode (com.yahoo.vespa.model.search.SearchNode)8 Test (org.junit.Test)8 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)5 MockRoot (com.yahoo.config.model.test.MockRoot)3 NodeSpec (com.yahoo.vespa.model.search.NodeSpec)3 Host (com.yahoo.vespa.model.Host)2 HostResource (com.yahoo.vespa.model.HostResource)2