Search in sources :

Example 16 with ComponentSpecification

use of com.yahoo.component.ComponentSpecification in project vespa by vespa-engine.

the class FederationSearcher method addDefaultTargets.

private void addDefaultTargets(TargetResolver targetResolver, ComponentRegistry<SearchChain> searchChainRegistry) {
    for (GenericTarget genericTarget : defaultTargets(searchChainRegistry.allComponents())) {
        ComponentSpecification specification = genericTarget.getComponentId().toSpecification();
        // Can't use genericTarget directly, as it might be part of a source group.
        Target federationTarget = targetResolver.resolve(new TargetSpec(specification, new FederationOptions()));
        // Do not replace manually added sources, as they might have manually configured federation options
        if (!resolvedTargets.containsKey(federationTarget.id))
            resolvedTargets.put(federationTarget.id, federationTarget);
    }
}
Also used : FederationOptions(com.yahoo.search.searchchain.model.federation.FederationOptions) ComponentSpecification(com.yahoo.component.ComponentSpecification) TargetSpec(com.yahoo.search.searchchain.model.federation.FederationSearcherModel.TargetSpec)

Example 17 with ComponentSpecification

use of com.yahoo.component.ComponentSpecification in project vespa by vespa-engine.

the class HttpBuilder method readFilterBindings.

private List<Binding> readFilterBindings(Element filteringSpec) {
    List<Binding> result = new ArrayList<>();
    for (Element child : XML.getChildren(filteringSpec)) {
        String tagName = child.getTagName();
        if ((tagName.equals("request-chain") || tagName.equals("response-chain"))) {
            ComponentSpecification chainId = XmlHelper.getIdRef(child);
            for (Element bindingSpec : XML.getChildren(child, "binding")) {
                String binding = XML.getValue(bindingSpec);
                result.add(new Binding(chainId, binding));
            }
        }
    }
    return result;
}
Also used : Binding(com.yahoo.vespa.model.container.http.Http.Binding) ComponentSpecification(com.yahoo.component.ComponentSpecification) Element(org.w3c.dom.Element) ArrayList(java.util.ArrayList)

Aggregations

ComponentSpecification (com.yahoo.component.ComponentSpecification)17 ArrayList (java.util.ArrayList)4 Element (org.w3c.dom.Element)4 ComponentId (com.yahoo.component.ComponentId)2 BundleInstantiationSpecification (com.yahoo.container.bundle.BundleInstantiationSpecification)2 QueryProfile (com.yahoo.search.query.profile.QueryProfile)2 Phase (com.yahoo.component.chain.Phase)1 ChainSpecification (com.yahoo.component.chain.model.ChainSpecification)1 FileReference (com.yahoo.config.FileReference)1 CloudSubscriberFactory (com.yahoo.container.di.CloudSubscriberFactory)1 Container (com.yahoo.container.di.Container)1 ContainerTest (com.yahoo.container.di.ContainerTest)1 Osgi (com.yahoo.container.di.Osgi)1 Query (com.yahoo.search.Query)1 Result (com.yahoo.search.Result)1 DimensionValues (com.yahoo.search.query.profile.DimensionValues)1 QueryProfileType (com.yahoo.search.query.profile.types.QueryProfileType)1 FederationOptions (com.yahoo.search.searchchain.model.federation.FederationOptions)1 TargetSpec (com.yahoo.search.searchchain.model.federation.FederationSearcherModel.TargetSpec)1 Container (com.yahoo.vespa.model.container.Container)1