Search in sources :

Example 1 with ConfigServerSpec

use of com.yahoo.config.model.api.ConfigServerSpec in project vespa by vespa-engine.

the class ZooKeepersConfigProvider method getZooKeepers.

// format for each element: hostname:port
public List<String> getZooKeepers() {
    List<String> servers = new ArrayList<>();
    for (Configserver server : configServers) {
        ConfigServerSpec serverSpec = server.getConfigServerSpec();
        servers.add(serverSpec.getHostName() + ":" + serverSpec.getZooKeeperPort());
    }
    return servers;
}
Also used : ArrayList(java.util.ArrayList) ConfigServerSpec(com.yahoo.config.model.api.ConfigServerSpec)

Example 2 with ConfigServerSpec

use of com.yahoo.config.model.api.ConfigServerSpec in project vespa by vespa-engine.

the class DomAdminBuilderBase method getConfigServersFromSpec.

List<Configserver> getConfigServersFromSpec(AbstractConfigProducer parent) {
    List<Configserver> configservers = new ArrayList<>();
    for (ConfigServerSpec spec : configServerSpecs) {
        HostSystem hostSystem = parent.getHostSystem();
        HostResource host = new HostResource(Host.createConfigServerHost(hostSystem, spec.getHostName()));
        hostSystem.addBoundHost(host);
        Configserver configserver = new Configserver(parent, spec.getHostName());
        configserver.setHostResource(host);
        configserver.setBasePort(configserver.getWantedPort());
        configserver.initService();
        configservers.add(configserver);
    }
    return configservers;
}
Also used : HostResource(com.yahoo.vespa.model.HostResource) HostSystem(com.yahoo.vespa.model.HostSystem) ConfigServerSpec(com.yahoo.config.model.api.ConfigServerSpec)

Aggregations

ConfigServerSpec (com.yahoo.config.model.api.ConfigServerSpec)2 HostResource (com.yahoo.vespa.model.HostResource)1 HostSystem (com.yahoo.vespa.model.HostSystem)1 ArrayList (java.util.ArrayList)1