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);
}
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);
}
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);
}
}
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));
}
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));
}
Aggregations