use of com.yahoo.vespa.model.clients.VespaSpoolerService in project vespa by vespa-engine.
the class DomV20ClientsBuilder method createSpoolers.
/**
* Creates VespaSpooler objects using the given xml Element.
*/
private void createSpoolers(AbstractConfigProducer pcp, Element element, Clients clients) {
String jvmArgs = null;
if (element.hasAttribute(VespaDomBuilder.JVMARGS_ATTRIB_NAME))
jvmArgs = element.getAttribute(VespaDomBuilder.JVMARGS_ATTRIB_NAME);
SimpleConfigProducer spoolerCfg = new VespaDomBuilder.DomSimpleConfigProducerBuilder(element.getNodeName()).build(pcp, element);
Element spoolersFeederOptions = findFeederOptions(element);
createSpoolMasters(spoolerCfg, element);
for (Element e : XML.getChildren(element, "spooler")) {
String configId = e.getAttribute("id").trim();
FeederConfig.Builder feederConfig = getFeederConfig(spoolersFeederOptions, e);
SpoolerConfig.Builder spoolConfig = getSpoolConfig(e);
if (configId.length() == 0) {
int index = clients.getVespaSpoolers().size();
VespaSpoolerService spoolerService = new VespaSpoolerServiceBuilder(index, new VespaSpooler(feederConfig, spoolConfig)).build(spoolerCfg, e);
if ("".equals(spoolerService.getJvmArgs()) && jvmArgs != null)
spoolerService.setJvmArgs(jvmArgs);
spoolerService.setProp("index", String.valueOf(index));
clients.getVespaSpoolers().add(spoolerService);
} else {
new VespaSpoolerProducerBuilder(configId, new VespaSpooler(feederConfig, spoolConfig)).build(spoolerCfg, e);
}
}
}
Aggregations