use of com.yahoo.config.model.ConfigModel in project vespa by vespa-engine.
the class Content method createTlds.
public void createTlds(ConfigModelRepo modelRepo) {
IndexedSearchCluster indexedCluster = cluster.getSearch().getIndexed();
if (indexedCluster == null)
return;
SimpleConfigProducer tldParent = new SimpleConfigProducer(indexedCluster, "tlds");
for (ConfigModel model : modelRepo.asMap().values()) {
if (!(model instanceof ContainerModel))
continue;
ContainerCluster containerCluster = ((ContainerModel) model).getCluster();
// this is not a qrs cluster
if (containerCluster.getSearch() == null)
continue;
log.log(LogLevel.DEBUG, "Adding tlds for indexed cluster " + indexedCluster.getClusterName() + ", container cluster " + containerCluster.getName());
indexedCluster.addTldsWithSameIdsAsContainers(tldParent, containerCluster);
}
indexedCluster.setupDispatchGroups();
}
use of com.yahoo.config.model.ConfigModel in project vespa by vespa-engine.
the class SystemModelTestCase method testPlugins.
/**
* This test is the same as the system test cloudconfig/plugins.
* Be sure to update it as well if you change this.
*/
@Test
public void testPlugins() {
VespaModel vespaModel = getVespaModelDoNotValidateXml(TESTDIR + "plugins");
assertNotNull(vespaModel);
ApplicationConfigProducerRoot root = vespaModel.getVespa();
assertEquals(5, vespaModel.configModelRepo().asMap().size());
assertTrue(vespaModel.configModelRepo().asMap().keySet().contains("simple"));
assertTrue(vespaModel.configModelRepo().asMap().keySet().contains("api"));
assertTrue(root.getConfigIds().contains("simple/simpleservice.0"));
assertTrue(root.getConfigIds().contains("simple/simpleservice.1"));
assertTrue(root.getConfigIds().contains("api/apiservice.0"));
// Verify that configModelRegistry iterates in dependency order
Iterator<ConfigModel> i = vespaModel.configModelRepo().iterator();
ConfigModel plugin = i.next();
assertEquals("admin", plugin.getId());
plugin = i.next();
assertEquals("simple", plugin.getId());
plugin = i.next();
assertEquals("simple2", plugin.getId());
plugin = i.next();
assertEquals("api", plugin.getId());
plugin = i.next();
assertEquals("routing", plugin.getId());
assertEquals(vespaModel.getConfig(StandardConfig.class, "api/apiservice.0").astring(), "apiservice");
assertEquals(vespaModel.getConfig(StandardConfig.class, "simple/simpleservice.0").astring(), "simpleservice");
assertEquals(vespaModel.getConfig(StandardConfig.class, "simple/simpleservice.1").astring(), "simpleservice");
assertEquals(vespaModel.getConfig(StandardConfig.class, "simple2/simpleservice.0").astring(), "simpleservice");
}
use of com.yahoo.config.model.ConfigModel in project vespa by vespa-engine.
the class ApiConfigModel method prepare.
// Inherit doc from ConfigModel.
public void prepare(ConfigModelRepo configModelRepo) {
int numSimpleServices = 0;
ConfigModel simplePlugin = configModelRepo.get("simple");
if ((simplePlugin != null) && (simplePlugin instanceof TestApi)) {
TestApi testApi = (TestApi) simplePlugin;
numSimpleServices = testApi.getNumSimpleServices();
}
for (Object apiService : apiServices) {
ApiService as = (ApiService) apiService;
as.setNumSimpleServices(numSimpleServices);
}
}
Aggregations