Search in sources :

Example 1 with Dispatch

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

the class ModelProvisioningTest method checkThatTldAndContainerRunningOnSameHostHaveSameId.

private void checkThatTldAndContainerRunningOnSameHostHaveSameId(Collection<ContainerCluster> containerClusters, Collection<ContentCluster> contentClusters, int startIndexForContainerIds) {
    for (ContentCluster contentCluster : contentClusters) {
        String contentClusterName = contentCluster.getName();
        int i = 0;
        for (ContainerCluster containerCluster : containerClusters) {
            String containerClusterName = containerCluster.getName();
            for (int j = 0; j < 2; j++) {
                Dispatch tld = contentCluster.getSearch().getIndexed().getTLDs().get(2 * i + j);
                Container container = containerCluster.getContainers().get(j);
                int containerConfigIdIndex = j + startIndexForContainerIds;
                assertEquals(container.getHostName(), tld.getHostname());
                assertEquals(contentClusterName + "/search/cluster." + contentClusterName + "/tlds/" + containerClusterName + "." + containerConfigIdIndex + ".tld." + containerConfigIdIndex, tld.getConfigId());
                assertEquals(containerClusterName + "/" + "container." + containerConfigIdIndex, container.getConfigId());
            }
            i++;
        }
    }
}
Also used : Container(com.yahoo.vespa.model.container.Container) ContainerCluster(com.yahoo.vespa.model.container.ContainerCluster) Dispatch(com.yahoo.vespa.model.search.Dispatch) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster)

Example 2 with Dispatch

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

the class ClusterTest method requireThatSearchCoverageIsApplied.

@Test
public void requireThatSearchCoverageIsApplied() throws ParseException {
    ContentCluster cluster = newContentCluster(joinLines("<search>", "  <coverage>", "    <minimum>0.11</minimum>", "    <min-wait-after-coverage-factor>0.23</min-wait-after-coverage-factor>", "    <max-wait-after-coverage-factor>0.58</max-wait-after-coverage-factor>", "  </coverage>", "</search>"));
    for (Dispatch tld : cluster.getSearch().getIndexed().getTLDs()) {
        PartitionsConfig.Builder builder = new PartitionsConfig.Builder();
        tld.getConfig(builder);
        PartitionsConfig config = new PartitionsConfig(builder);
        assertEquals(11.0, config.dataset(0).minimal_searchcoverage(), 1E-6);
        assertEquals(0.23, config.dataset(0).higher_coverage_minsearchwait(), 1E-6);
        assertEquals(0.58, config.dataset(0).higher_coverage_maxsearchwait(), 1E-6);
    }
}
Also used : SearchBuilder(com.yahoo.searchdefinition.SearchBuilder) Dispatch(com.yahoo.vespa.model.search.Dispatch) PartitionsConfig(com.yahoo.vespa.config.search.core.PartitionsConfig) Test(org.junit.Test)

Aggregations

Dispatch (com.yahoo.vespa.model.search.Dispatch)2 SearchBuilder (com.yahoo.searchdefinition.SearchBuilder)1 PartitionsConfig (com.yahoo.vespa.config.search.core.PartitionsConfig)1 Container (com.yahoo.vespa.model.container.Container)1 ContainerCluster (com.yahoo.vespa.model.container.ContainerCluster)1 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)1 Test (org.junit.Test)1