Search in sources :

Example 1 with DomConfigPayloadBuilder

use of com.yahoo.vespa.model.builder.xml.dom.DomConfigPayloadBuilder in project vespa by vespa-engine.

the class UserConfigBuilder method buildElement.

private static void buildElement(Element element, Map<ConfigDefinitionKey, ConfigPayloadBuilder> builderMap, ConfigDefinitionStore configDefinitionStore, DeployLogger logger) {
    ConfigDefinitionKey key = DomConfigPayloadBuilder.parseConfigName(element);
    Optional<ConfigDefinition> def = configDefinitionStore.getConfigDefinition(key);
    if (!def.isPresent()) {
        // TODO: Fail instead of warn
        logger.log(LogLevel.WARNING, "Unable to find config definition '" + key.asFileName() + "'. Please ensure that the name is spelled correctly, and that the def file is included in a bundle.");
    }
    ConfigPayloadBuilder payloadBuilder = new DomConfigPayloadBuilder(def.orElse(null)).build(element);
    ConfigPayloadBuilder old = builderMap.get(key);
    if (old != null) {
        logger.log(LogLevel.WARNING, "Multiple overrides for " + key + " found. Applying in the order they are discovered");
        old.override(payloadBuilder);
    } else {
        builderMap.put(key, payloadBuilder);
    }
}
Also used : DomConfigPayloadBuilder(com.yahoo.vespa.model.builder.xml.dom.DomConfigPayloadBuilder) DomConfigPayloadBuilder(com.yahoo.vespa.model.builder.xml.dom.DomConfigPayloadBuilder)

Aggregations

DomConfigPayloadBuilder (com.yahoo.vespa.model.builder.xml.dom.DomConfigPayloadBuilder)1