static Set<Integer> getIndicesOfUpNodes(ClusterState clusterState, NodeType type) {
        int nodeCount = clusterState.getNodeCount(type);

        Set<Integer> nodesBeingUp = new HashSet<>();
        for (int i = 0; i < nodeCount; ++i) {
            Node node = new Node(type, i);
            NodeState nodeState = clusterState.getNodeState(node);
            State state = nodeState.getState();
            if (state == State.UP || state == State.INITIALIZING ||
                state == State.RETIRED || state == State.MAINTENANCE) {
                nodesBeingUp.add(i);
            }
        }

        return nodesBeingUp;
    }
Returns the set of nodes that are up for a given node type. Non-private for testing.
clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ClusterStateView.java