protected ClickHouseNode get(ClickHouseNodes manager, ClickHouseNodeSelector t) {
        boolean noSelector = t == null || t == ClickHouseNodeSelector.EMPTY;
        int idx = manager.index.get();
        int i = 0;
        ClickHouseNode node = null;
        for (ClickHouseNode n : manager.nodes) {
            if (noSelector || t.match(n)) {
                node = n;
            }
            if (i++ >= idx && node != null) {
                break;
            }
        }
        if (node == null) {
            for (ClickHouseNode n : manager.faultyNodes) {
                ClickHouseNode probed = n.probe();
                if (noSelector || t.match(probed)) {
                    node = probed;
                }
                if (i++ >= idx && node != null) {
                    break;
                }
            }
        }

        if (node == null) {
            throw new IllegalArgumentException(ClickHouseUtils.format(ERROR_NO_SUITABLE_NODE, manager, t));
        }
        return node;
    }
Gets next node available in the list according to the given node selector.

@param manager managed nodes
@param t       node selector
@return next node
@throws IllegalArgumentException when no node available to use
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseLoadBalancingPolicy.java