Search in sources :

Example 6 with AbstractConfigProducer

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

the class ContainerCluster method addMetricStateHandler.

public void addMetricStateHandler() {
    Handler<AbstractConfigProducer<?>> stateHandler = new Handler<>(new ComponentModel(STATE_HANDLER_CLASS, null, null, null));
    stateHandler.addServerBindings("http://*" + StateHandler.STATE_API_ROOT, "https://*" + StateHandler.STATE_API_ROOT, "http://*" + StateHandler.STATE_API_ROOT + "/*", "https://*" + StateHandler.STATE_API_ROOT + "/*");
    addComponent(stateHandler);
}
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 7 with AbstractConfigProducer

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

the class ContainerCluster method addApplicationStatusHandler.

public void addApplicationStatusHandler() {
    Handler<AbstractConfigProducer<?>> statusHandler = new Handler<>(new ComponentModel(BundleInstantiationSpecification.getInternalHandlerSpecificationFromStrings(APPLICATION_STATUS_HANDLER_CLASS, null), null));
    statusHandler.addServerBindings("http://*/ApplicationStatus", "https://*/ApplicationStatus");
    addComponent(statusHandler);
}
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 8 with AbstractConfigProducer

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

the class ContentSearchCluster method addSearchNode.

public void addSearchNode(ContentNode node, StorageGroup parentGroup, ModelElement element) {
    AbstractConfigProducer parent = hasIndexedCluster() ? getIndexed() : this;
    NodeSpec spec = getNextSearchNodeSpec(parentGroup);
    SearchNode snode;
    TransactionLogServer tls;
    Optional<Tuning> tuning = Optional.ofNullable(this.tuning);
    if (element == null) {
        snode = SearchNode.create(parent, "" + node.getDistributionKey(), node.getDistributionKey(), spec, clusterName, node, flushOnShutdown, tuning);
        snode.setHostResource(node.getHostResource());
        snode.initService();
        tls = new TransactionLogServer(snode, clusterName);
        tls.setHostResource(snode.getHostResource());
        tls.initService();
    } else {
        snode = new SearchNode.Builder("" + node.getDistributionKey(), spec, clusterName, node, flushOnShutdown, tuning).build(parent, element.getXml());
        tls = new TransactionLogServer.Builder(clusterName).build(snode, element.getXml());
    }
    snode.setTls(tls);
    if (hasIndexedCluster()) {
        getIndexed().addSearcher(snode);
    } else {
        nonIndexed.add(snode);
    }
}
Also used : AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) UserConfigBuilder(com.yahoo.vespa.model.builder.UserConfigBuilder) DomResourceLimitsBuilder(com.yahoo.vespa.model.content.cluster.DomResourceLimitsBuilder) VespaDomBuilder(com.yahoo.vespa.model.builder.xml.dom.VespaDomBuilder) DomSearchTuningBuilder(com.yahoo.vespa.model.builder.xml.dom.DomSearchTuningBuilder)

Example 9 with AbstractConfigProducer

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

the class LegacyConfigModelBuilder method build.

@Override
public MODEL build(ConfigModelInstanceFactory<MODEL> factory, Element spec, ConfigModelContext context) {
    VespaDomBuilder.DomSimpleConfigProducerBuilder builder = new VespaDomBuilder.DomSimpleConfigProducerBuilder(context.getProducerId());
    AbstractConfigProducer producer = builder.build(context.getParentProducer(), spec);
    return super.build(factory, spec, context.withParent(producer));
}
Also used : AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer)

Example 10 with AbstractConfigProducer

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

the class ConfigModelContextTest method testConfigModelContext.

@Test
public void testConfigModelContext() {
    AbstractConfigProducer root = new MockRoot();
    String id = "foobar";
    ApplicationPackage pkg = new MockApplicationPackage.Builder().withServices("<services version=\"1.0\"><admin version=\"2.0\" /></services>").build();
    DeployState deployState = DeployState.createTestState(pkg);
    DeployLogger logger = deployState.getDeployLogger();
    ConfigModelContext ctx = ConfigModelContext.create(deployState, null, root, id);
    assertThat(ctx.getApplicationPackage(), is(pkg));
    assertThat(ctx.getProducerId(), is(id));
    assertThat(ctx.getParentProducer(), is(root));
    assertThat(ctx.getDeployLogger(), is(logger));
    ctx = ConfigModelContext.create(null, root, id);
    assertThat(ctx.getProducerId(), is(id));
    assertThat(ctx.getParentProducer(), is(root));
    AbstractConfigProducer newRoot = new MockRoot("bar");
    ctx = ctx.withParent(newRoot);
    assertThat(ctx.getProducerId(), is(id));
    assertThat(ctx.getParentProducer(), is(not(root)));
    assertThat(ctx.getParentProducer(), is(newRoot));
}
Also used : MockRoot(com.yahoo.config.model.test.MockRoot) DeployState(com.yahoo.config.model.deploy.DeployState) AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) DeployLogger(com.yahoo.config.application.api.DeployLogger) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) MockApplicationPackage(com.yahoo.config.model.test.MockApplicationPackage) Test(org.junit.Test)

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