Search in sources :

Example 1 with GetNodesResponse

use of com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.GetNodesResponse in project vespa by vespa-engine.

the class RealNodeRepository method getContainersToRun.

@Override
public List<ContainerNodeSpec> getContainersToRun(String baseHostName) {
    final GetNodesResponse nodesForHost = configServerApi.get("/nodes/v2/node/?parentHost=" + baseHostName + "&recursive=true", GetNodesResponse.class);
    List<ContainerNodeSpec> nodes = new ArrayList<>(nodesForHost.nodes.size());
    for (GetNodesResponse.Node node : nodesForHost.nodes) {
        ContainerNodeSpec nodeSpec;
        try {
            nodeSpec = createContainerNodeSpec(node);
        } catch (IllegalArgumentException | NullPointerException e) {
            NODE_ADMIN_LOGGER.warning("Bad node received from node repo when requesting children of the " + baseHostName + " host: " + node, e);
            continue;
        }
        nodes.add(nodeSpec);
    }
    return nodes;
}
Also used : ArrayList(java.util.ArrayList) GetNodesResponse(com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.GetNodesResponse) ContainerNodeSpec(com.yahoo.vespa.hosted.node.admin.ContainerNodeSpec)

Aggregations

ContainerNodeSpec (com.yahoo.vespa.hosted.node.admin.ContainerNodeSpec)1 GetNodesResponse (com.yahoo.vespa.hosted.node.admin.configserver.noderepository.bindings.GetNodesResponse)1 ArrayList (java.util.ArrayList)1