static ClickHouseNodes create(String endpoints, Map<?, ?> defaultOptions) {
        int index = endpoints.indexOf(ClickHouseNode.SCHEME_DELIMITER);
        String defaultProtocol = ((ClickHouseProtocol) ClickHouseDefaults.PROTOCOL
                .getEffectiveDefaultValue()).name();
        if (index > 0) {
            defaultProtocol = endpoints.substring(0, index);
            if (ClickHouseProtocol.fromUriScheme(defaultProtocol) == ClickHouseProtocol.ANY) {
                defaultProtocol = ClickHouseProtocol.ANY.name();
                index = 0;
            } else {
                index += 3;
            }
        } else {
            index = 0;
        }
        

        String defaultParams = "";
        Set<String> list = new LinkedHashSet<>();
        char stopChar = ',';
        for (int i = index, len = endpoints.length(); i < len; i++) {
            char ch = endpoints.charAt(i);
            if (ch == ',' || Character.isWhitespace(ch)) {
                index++;
                continue;
            } else if (ch == '/' || ch == '?' || ch == '#') {
                defaultParams = endpoints.substring(i);
                break;
            }
            switch (ch) {
                case '(':
                    stopChar = ')';
                    index++;
                    break;
                case '{':
                    stopChar = '}';
                    index++;
                    break;
                default:
                    break;
            }

            int endIndex = i;
            // parsing host name
            for (int j = i + 1; j < len; j++) {
                ch = endpoints.charAt(j);
                if (ch == stopChar || Character.isWhitespace(ch)) {
                    endIndex = j;
                    break;
                } else if ( stopChar == ',' && ( ch == '/' || ch == '?' || ch == '#') ) {
                    break;
                }
            }

            if (endIndex > i) {
                // add host name to list
                list.add(endpoints.substring(index, endIndex).trim());
                i = endIndex;
                index = endIndex + 1;
                stopChar = ',';
            } else {
                String last = endpoints.substring(index);
                int sepIndex = last.indexOf(ClickHouseNode.SCHEME_DELIMITER);
                int startIndex = sepIndex < 0 ? 0 : sepIndex + 3;
                for (char spec : separators) {
                    sepIndex = last.indexOf(spec, startIndex);
                    if (sepIndex > 0) {
                        break;
                    }
                }
                if (sepIndex > 0) {
                    defaultParams = last.substring(sepIndex);
                    list.add(last.substring(0, sepIndex).trim());
                } else {
                    list.add(last.trim());
                }
                break;
            }
        }
        list.remove("");
        if (list.isEmpty()) {
            throw new IllegalArgumentException(
                    "No valid URI found, please try 'http://localhost:8123' or simply 'localhost:8123' if you don't know protocol");
        }

        if (list.size() == 1 && defaultParams.isEmpty()) {
            endpoints = new StringBuilder().append(defaultProtocol).append(ClickHouseNode.SCHEME_DELIMITER)
                    .append(list.iterator().next()).toString();
            return new ClickHouseNodes(Collections.singletonList(ClickHouseNode.of(endpoints, defaultOptions)));
        }

        ClickHouseNode defaultNode = ClickHouseNode.of(defaultProtocol + "://localhost" + defaultParams,
                defaultOptions);
        List<ClickHouseNode> nodes = new LinkedList<>();
        for (String uri : list) {
            nodes.add(ClickHouseNode.of(uri, defaultNode));
        }
        return new ClickHouseNodes(nodes, defaultNode);
    }
Creates list of managed {@link ClickHouseNode} for load balancing and
fail-over.

@param endpoints      non-empty URIs separated by comma
@param defaultOptions default options
@return non-null list of nodes
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNodes.java