Search in sources :

Example 1 with AbstractConfigProducer

use of com.yahoo.config.model.producer.AbstractConfigProducer in project vespa by vespa-engine.

the class ContainerCluster method addDefaultRootHandler.

public void addDefaultRootHandler() {
    if (hasHandlerWithBinding(ROOT_HANDLER_BINDING))
        return;
    Handler<AbstractConfigProducer<?>> handler = new Handler<>(new ComponentModel(BundleInstantiationSpecification.getFromStrings(BINDINGS_OVERVIEW_HANDLER_CLASS, null, null), // null bundle, as the handler is in container-disc
    null));
    handler.addServerBindings(ROOT_HANDLER_BINDING);
    addComponent(handler);
}
Also used : AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) ComponentModel(com.yahoo.osgi.provider.model.ComponentModel) BindingsOverviewHandler(com.yahoo.container.usability.BindingsOverviewHandler) ProcessingHandler(com.yahoo.vespa.model.container.component.chain.ProcessingHandler) Handler(com.yahoo.vespa.model.container.component.Handler) JerseyHandler(com.yahoo.vespa.model.container.jersey.JerseyHandler) StateHandler(com.yahoo.container.jdisc.state.StateHandler)

Example 2 with AbstractConfigProducer

use of com.yahoo.config.model.producer.AbstractConfigProducer in project vespa by vespa-engine.

the class DocumentFactoryBuilder method buildDocumentFactories.

public static void buildDocumentFactories(ContainerCluster cluster, Element spec) {
    Map<String, String> types = new LinkedHashMap<>();
    for (Element e : XML.getChildren(spec, "document")) {
        String type = e.getAttribute("type");
        String clazz = e.getAttribute("class");
        // Empty pkg is forbidden in the documentgen Mojo.
        if (clazz.indexOf('.') < 0)
            throw new IllegalArgumentException("Malformed class for <document> binding, must be a full class with package: " + clazz);
        String pkg = clazz.substring(0, clazz.lastIndexOf('.'));
        String concDocFactory = pkg + "." + CONCRETE_DOC_FACTORY_CLASS;
        String bundle = e.getAttribute("bundle");
        Component<AbstractConfigProducer<?>, ComponentModel> component = new Component<>(new ComponentModel(BundleInstantiationSpecification.getFromStrings(concDocFactory, concDocFactory, bundle)));
        if (!cluster.getComponentsMap().containsKey(component.getComponentId()))
            cluster.addComponent(component);
        types.put(type, concDocFactory);
    }
    cluster.concreteDocumentTypes().putAll(types);
}
Also used : AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) Element(org.w3c.dom.Element) ComponentModel(com.yahoo.osgi.provider.model.ComponentModel) Component(com.yahoo.vespa.model.container.component.Component) LinkedHashMap(java.util.LinkedHashMap)

Example 3 with AbstractConfigProducer

use of com.yahoo.config.model.producer.AbstractConfigProducer in project vespa by vespa-engine.

the class StorageNode method getConfig.

@Override
public void getConfig(StorServerConfig.Builder builder) {
    super.getConfig(builder);
    builder.node_capacity(getCapacity());
    for (AbstractConfigProducer producer : getChildren().values()) {
        ((PersistenceEngine) producer).getConfig(builder);
    }
}
Also used : AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) PersistenceEngine(com.yahoo.vespa.model.content.engines.PersistenceEngine)

Example 4 with AbstractConfigProducer

use of com.yahoo.config.model.producer.AbstractConfigProducer in project vespa by vespa-engine.

the class DomServiceClusterBuilder method doBuild.

@Override
protected ServiceCluster doBuild(AbstractConfigProducer ancestor, Element spec) {
    ServiceCluster cluster = new ServiceCluster(ancestor, name, spec.getAttribute("command"));
    int nodeIndex = 0;
    for (Element nodeSpec : XML.getChildren(spec, "node")) {
        com.yahoo.vespa.model.generic.service.Service service = new DomServiceBuilder(nodeIndex).build(cluster, nodeSpec);
        // and store them in ServiceCluster. Then have some way of referencing them from each service.
        for (Element subServiceSpec : XML.getChildren(spec, "module")) {
            String subServiceName = subServiceSpec.getAttribute("name");
            Map<String, AbstractConfigProducer<?>> map = service.getChildren();
            // Add only non-conflicting modules. Does not merge unspecified configs that are specified in root though.
            if (!map.containsKey(subServiceName))
                new DomModuleBuilder(subServiceName).build(service, subServiceSpec);
        }
        nodeIndex++;
    }
    return cluster;
}
Also used : ServiceCluster(com.yahoo.vespa.model.generic.service.ServiceCluster) AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) Element(org.w3c.dom.Element)

Example 5 with AbstractConfigProducer

use of com.yahoo.config.model.producer.AbstractConfigProducer in project vespa by vespa-engine.

the class RankSetupValidator method writeConfigs.

private void writeConfigs(String dir, AbstractConfigProducer producer) throws IOException {
    RankProfilesConfig.Builder rpcb = new RankProfilesConfig.Builder();
    RankProfilesConfig.Producer.class.cast(producer).getConfig(rpcb);
    RankProfilesConfig rpc = new RankProfilesConfig(rpcb);
    writeConfig(dir, RankProfilesConfig.getDefName() + ".cfg", rpc);
    IndexschemaConfig.Builder iscb = new IndexschemaConfig.Builder();
    IndexschemaConfig.Producer.class.cast(producer).getConfig(iscb);
    IndexschemaConfig isc = new IndexschemaConfig(iscb);
    writeConfig(dir, IndexschemaConfig.getDefName() + ".cfg", isc);
    AttributesConfig.Builder acb = new AttributesConfig.Builder();
    AttributesConfig.Producer.class.cast(producer).getConfig(acb);
    AttributesConfig ac = new AttributesConfig(acb);
    writeConfig(dir, AttributesConfig.getDefName() + ".cfg", ac);
    RankingConstantsConfig.Builder rccb = new RankingConstantsConfig.Builder();
    RankingConstantsConfig.Producer.class.cast(producer).getConfig(rccb);
    RankingConstantsConfig rcc = new RankingConstantsConfig(rccb);
    writeConfig(dir, RankingConstantsConfig.getDefName() + ".cfg", rcc);
    ImportedFieldsConfig.Builder ifcb = new ImportedFieldsConfig.Builder();
    ImportedFieldsConfig.Producer.class.cast(producer).getConfig(ifcb);
    ImportedFieldsConfig ifc = new ImportedFieldsConfig(ifcb);
    writeConfig(dir, ImportedFieldsConfig.getDefName() + ".cfg", ifc);
}
Also used : AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) ImportedFieldsConfig(com.yahoo.vespa.config.search.ImportedFieldsConfig) RankProfilesConfig(com.yahoo.vespa.config.search.RankProfilesConfig) IndexschemaConfig(com.yahoo.vespa.config.search.IndexschemaConfig) AttributesConfig(com.yahoo.vespa.config.search.AttributesConfig) RankingConstantsConfig(com.yahoo.vespa.config.search.core.RankingConstantsConfig)

Aggregations

AbstractConfigProducer (com.yahoo.config.model.producer.AbstractConfigProducer)10 ComponentModel (com.yahoo.osgi.provider.model.ComponentModel)4 StateHandler (com.yahoo.container.jdisc.state.StateHandler)3 BindingsOverviewHandler (com.yahoo.container.usability.BindingsOverviewHandler)3 Handler (com.yahoo.vespa.model.container.component.Handler)3 ProcessingHandler (com.yahoo.vespa.model.container.component.chain.ProcessingHandler)3 JerseyHandler (com.yahoo.vespa.model.container.jersey.JerseyHandler)3 Element (org.w3c.dom.Element)2 ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)1 DeployLogger (com.yahoo.config.application.api.DeployLogger)1 DeployState (com.yahoo.config.model.deploy.DeployState)1 MockApplicationPackage (com.yahoo.config.model.test.MockApplicationPackage)1 MockRoot (com.yahoo.config.model.test.MockRoot)1 AttributesConfig (com.yahoo.vespa.config.search.AttributesConfig)1 ImportedFieldsConfig (com.yahoo.vespa.config.search.ImportedFieldsConfig)1 IndexschemaConfig (com.yahoo.vespa.config.search.IndexschemaConfig)1 RankProfilesConfig (com.yahoo.vespa.config.search.RankProfilesConfig)1 RankingConstantsConfig (com.yahoo.vespa.config.search.core.RankingConstantsConfig)1 UserConfigBuilder (com.yahoo.vespa.model.builder.UserConfigBuilder)1 DomSearchTuningBuilder (com.yahoo.vespa.model.builder.xml.dom.DomSearchTuningBuilder)1