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++;
}
}
}
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);
}
}
Aggregations