Search in sources :

Example 1 with Slobrok

use of com.yahoo.vespa.model.admin.Slobrok in project vespa by vespa-engine.

the class DomAdminV4Builder method createSlobroks.

private void createSlobroks(Admin admin, Collection<HostResource> hosts) {
    // No slobroks can be created (and none are needed)
    if (hosts.isEmpty())
        return;
    List<Slobrok> slobroks = new ArrayList<>();
    int index = 0;
    for (HostResource host : hosts) {
        Slobrok slobrok = new Slobrok(admin, index++);
        slobrok.setHostResource(host);
        slobroks.add(slobrok);
        slobrok.initService();
    }
    admin.addSlobroks(slobroks);
}
Also used : HostResource(com.yahoo.vespa.model.HostResource) ArrayList(java.util.ArrayList) Slobrok(com.yahoo.vespa.model.admin.Slobrok)

Example 2 with Slobrok

use of com.yahoo.vespa.model.admin.Slobrok in project vespa by vespa-engine.

the class DomAdminV2Builder method getExplicitSlobrokSetup.

private List<Slobrok> getExplicitSlobrokSetup(AbstractConfigProducer parent, Element slobroksE) {
    List<Slobrok> slobs = new ArrayList<>();
    List<Element> slobsE = XML.getChildren(slobroksE, "slobrok");
    int i = 0;
    for (Element e : slobsE) {
        Slobrok slob = new SlobrokBuilder(i).build(parent, e);
        slobs.add(slob);
        i++;
    }
    return slobs;
}
Also used : Element(org.w3c.dom.Element) ArrayList(java.util.ArrayList) Slobrok(com.yahoo.vespa.model.admin.Slobrok)

Aggregations

Slobrok (com.yahoo.vespa.model.admin.Slobrok)2 ArrayList (java.util.ArrayList)2 HostResource (com.yahoo.vespa.model.HostResource)1 Element (org.w3c.dom.Element)1