use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class StorageModelTestCase method testMetricsSnapshotIntervalYAMAS.
@Test
public void testMetricsSnapshotIntervalYAMAS() throws Exception {
VespaModel vespaModel = createModel("src/test/cfg/storage/clustercontroller_advanced");
ContentCluster contentCluster = vespaModel.getContentClusters().values().iterator().next();
assertNotNull(contentCluster);
MetricsmanagerConfig.Builder builder = new MetricsmanagerConfig.Builder();
contentCluster.getConfig(builder);
MetricsmanagerConfig config = new MetricsmanagerConfig(builder);
assertThat(config.snapshot().periods(0), is(60));
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster in project vespa by vespa-engine.
the class MultilevelDispatchTest method requireThatDispatchGroupsCanBeAutomaticallySetup.
@Test
public void requireThatDispatchGroupsCanBeAutomaticallySetup() throws Exception {
ContentCluster cr = createCluster(getSimpleDispatchXml());
IndexedSearchCluster ix = cr.getSearch().getIndexed();
Dispatch tld = cr.getSearch().getIndexed().getTLDs().get(0);
assertEquals("tlds/tld.0", tld.getConfigId());
assertEquals(0, getFdispatchrcConfig(tld).dispatchlevel());
new EngineAsserter(2, 6, tld).assertEngine(0, 0, "tcp/mh0:19113").assertEngine(1, 0, "tcp/mh1:19113").assertEngine(2, 0, "tcp/mh2:19113").assertEngine(0, 1, "tcp/mh3:19113").assertEngine(1, 1, "tcp/mh4:19113").assertEngine(2, 1, "tcp/mh5:19113");
List<Dispatch> ds = getDispatchers(tld);
assertEquals(6, ds.size());
{
// dispatch group 1
Dispatch[] dispatchers = { ds.get(0), ds.get(1), ds.get(2) };
String[] specs = { "tcp/mh0:19104", "tcp/mh1:19104", "tcp/mh2:19104" };
SearchNode[] searchNodes = { ix.getSearchNode(0), ix.getSearchNode(1), ix.getSearchNode(2) };
assertDispatchAndSearchNodes(0, dispatchers, specs, searchNodes);
}
{
// dispatch group 2
Dispatch[] dispatchers = { ds.get(3), ds.get(4), ds.get(5) };
String[] specs = { "tcp/mh3:19104", "tcp/mh4:19104", "tcp/mh5:19104" };
SearchNode[] searchNodes = { ix.getSearchNode(3), ix.getSearchNode(4), ix.getSearchNode(5) };
assertDispatchAndSearchNodes(1, dispatchers, specs, searchNodes);
}
}
use of com.yahoo.vespa.model.content.cluster.ContentCluster 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));
}
}
Aggregations