use of com.yahoo.vespa.config.search.core.PartitionsConfig in project vespa by vespa-engine.
the class ContentBuilderTest method testMultipleSearchNodesOnSameHost.
@Test
public void testMultipleSearchNodesOnSameHost() throws Exception {
String services = getServices("<node hostalias='mockhost' distribution-key='0'/>" + "<node hostalias='mockhost' distribution-key='1'/>");
VespaModel m = new VespaModelCreatorWithMockPkg(createAppWithMusic(getHosts(), services)).create();
PartitionsConfig partitionsConfig = new PartitionsConfig((PartitionsConfig.Builder) m.getConfig(new PartitionsConfig.Builder(), "clu/search/cluster.clu/tlds/qrc.0.tld.0"));
assertTrue(partitionsConfig.dataset(0).engine(0).name_and_port().startsWith("tcp/node0:191"));
IndexedSearchCluster sc = m.getContentClusters().get("clu").getSearch().getIndexed();
assertEquals(2, sc.getSearchNodeCount());
}
use of com.yahoo.vespa.config.search.core.PartitionsConfig in project vespa by vespa-engine.
the class ContentBuilderTest method testConfigIdLookup.
@Test
public void testConfigIdLookup() throws Exception {
VespaModel m = new VespaModelCreatorWithMockPkg(createAppWithMusic(getHosts(), getBasicServices())).create();
PartitionsConfig partitionsConfig = new PartitionsConfig((PartitionsConfig.Builder) m.getConfig(new PartitionsConfig.Builder(), "clu/search/cluster.clu/tlds/qrc.0.tld.0"));
assertTrue(partitionsConfig.dataset(0).engine(0).name_and_port().startsWith("tcp/node0:191"));
}
use of com.yahoo.vespa.config.search.core.PartitionsConfig in project vespa by vespa-engine.
the class DispatchUtils method getDataset.
public static PartitionsConfig.Dataset getDataset(Dispatch dispatch) {
PartitionsConfig.Builder builder = new PartitionsConfig.Builder();
dispatch.getConfig(builder);
PartitionsConfig cfg = new PartitionsConfig(builder);
assertEquals(1, cfg.dataset().size());
return cfg.dataset(0);
}
use of com.yahoo.vespa.config.search.core.PartitionsConfig in project vespa by vespa-engine.
the class MultilevelDispatchTest method requireThatMaxHitsIsScaled.
@Test
public void requireThatMaxHitsIsScaled() throws Exception {
ContentCluster cr = createCluster(getSimpleDispatchXml() + getMaxhitsTuning());
IndexedSearchCluster ix = cr.getSearch().getIndexed();
Dispatch tld = cr.getSearch().getIndexed().getTLDs().get(0);
PartitionsConfig.Builder builder = new PartitionsConfig.Builder();
tld.getConfig(builder);
PartitionsConfig config = new PartitionsConfig(builder);
assertThat(config.dataset().size(), is(1));
assertThat(config.dataset(0).maxhitspernode(), is(300));
for (Dispatch dispatch : getDispatchers(tld)) {
PartitionsConfig.Builder b = new PartitionsConfig.Builder();
dispatch.getConfig(b);
PartitionsConfig c = new PartitionsConfig(b);
assertThat(c.dataset().size(), is(1));
assertThat(c.dataset(0).maxhitspernode(), is(100));
}
}
use of com.yahoo.vespa.config.search.core.PartitionsConfig in project vespa by vespa-engine.
the class TldTest method requireThatServicesIsParsed.
@Test
public void requireThatServicesIsParsed() {
ApplicationPackage app = new MockApplicationPackage.Builder().withHosts("<hosts><host name='localhost'><alias>mockhost</alias></host><host name='my.other.host'><alias>mockhost2</alias></host></hosts>").withServices("<services>" + " <admin version='2.0'>" + " <adminserver hostalias='mockhost' />" + " </admin>" + " <jdisc version='1.0' id='default'>" + " <search />" + " <nodes>" + " <node hostalias='mockhost'/>" + " </nodes>" + " </jdisc>" + " <content version='1.0' id='foo'>" + " <redundancy>1</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group>" + " <node hostalias='mockhost' distribution-key='0'/>" + " <node hostalias='mockhost2' distribution-key='1'/>" + " </group>" + " <tuning>" + " <dispatch>" + " <max-hits-per-partition>69</max-hits-per-partition>" + " <use-local-node>true</use-local-node>" + " </dispatch>" + " </tuning>" + " </content>" + "</services>").withSearchDefinition(MockApplicationPackage.MUSIC_SEARCHDEFINITION).build();
PartitionsConfig.Builder builder = new PartitionsConfig.Builder();
new TestDriver(true).buildModel(app).getConfig(builder, "foo/search/cluster.foo/tlds/default.0.tld.0");
PartitionsConfig config = new PartitionsConfig(builder);
assertEquals(1, config.dataset().size());
assertEquals(69, config.dataset(0).maxhitspernode());
assertEquals(1, config.dataset(0).engine().size());
}
Aggregations