Search in sources :

Example 1 with ChainedComponentModel

use of com.yahoo.component.chain.model.ChainedComponentModel in project vespa by vespa-engine.

the class ChainsConfigurer method initDependencies.

private static <COMPONENT extends ChainedComponent> void initDependencies(ChainsModel model, ComponentRegistry<COMPONENT> allComponents) {
    for (ChainedComponentModel componentModel : model.allComponents()) {
        COMPONENT component = getComponentOrThrow(allComponents, componentModel.getComponentId().toSpecification());
        component.initDependencies(componentModel.dependencies);
    }
}
Also used : ChainedComponentModel(com.yahoo.component.chain.model.ChainedComponentModel)

Example 2 with ChainedComponentModel

use of com.yahoo.component.chain.model.ChainedComponentModel in project vespa by vespa-engine.

the class DomProviderBuilder method buildHttpProvider.

private Provider buildHttpProvider(ChainSpecification specWithoutInnerSearchers, ProviderReader providerReader, FederationOptions federationOptions) {
    ensureEmpty(specWithoutInnerSearchers.componentId, providerReader.clusterName);
    Provider httpProvider = buildEmptyHttpProvider(specWithoutInnerSearchers, providerReader, federationOptions);
    httpProvider.addInnerComponent(new HttpProviderSearcher(new ChainedComponentModel(HttpProviderSpec.toBundleInstantiationSpecification(HttpProviderSpec.Type.valueOf(providerReader.type)), Dependencies.emptyDependencies())));
    return httpProvider;
}
Also used : ChainedComponentModel(com.yahoo.component.chain.model.ChainedComponentModel) HttpProviderSearcher(com.yahoo.vespa.model.container.search.searchchain.HttpProviderSearcher) LocalProvider(com.yahoo.vespa.model.container.search.searchchain.LocalProvider) HttpProvider(com.yahoo.vespa.model.container.search.searchchain.HttpProvider) Provider(com.yahoo.vespa.model.container.search.searchchain.Provider)

Example 3 with ChainedComponentModel

use of com.yahoo.component.chain.model.ChainedComponentModel in project vespa by vespa-engine.

the class DomSearcherBuilderTest method ensureCorrectModel.

@Test
public void ensureCorrectModel() {
    ChainedComponent<ChainedComponentModel> searcher = new DomSearcherBuilder().doBuild(root, parse("<searcher id='theId' class='theclassid' bundle='thebundle' provides='p1'>", "    <provides>p2</provides>", "</searcher>"));
    ChainedComponentModel model = searcher.model;
    assertEquals(2, model.dependencies.provides().size());
    BundleInstantiationSpecification instantiationSpecification = model.bundleInstantiationSpec;
    assertEquals("theId", instantiationSpecification.id.stringValue());
    assertEquals("theclassid", instantiationSpecification.classId.stringValue());
    assertEquals("thebundle", instantiationSpecification.bundle.stringValue());
}
Also used : ChainedComponentModel(com.yahoo.component.chain.model.ChainedComponentModel) BundleInstantiationSpecification(com.yahoo.container.bundle.BundleInstantiationSpecification) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Aggregations

ChainedComponentModel (com.yahoo.component.chain.model.ChainedComponentModel)3 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)1 BundleInstantiationSpecification (com.yahoo.container.bundle.BundleInstantiationSpecification)1 HttpProvider (com.yahoo.vespa.model.container.search.searchchain.HttpProvider)1 HttpProviderSearcher (com.yahoo.vespa.model.container.search.searchchain.HttpProviderSearcher)1 LocalProvider (com.yahoo.vespa.model.container.search.searchchain.LocalProvider)1 Provider (com.yahoo.vespa.model.container.search.searchchain.Provider)1 Test (org.junit.Test)1