public static ClickHouseNode of(URI uri, ClickHouseNode template) {
        String host = ClickHouseChecker.nonNull(uri, "URI").getHost();
        String scheme = ClickHouseChecker.nonEmpty(uri.getScheme(), "Protocol");
        if (template == null) {
            template = DEFAULT;
        }
        if (ClickHouseChecker.isNullOrEmpty(host)) {
            host = template.getHost();
        }

        Map<String, String> params = new LinkedHashMap<>(template.options);
        parseDatabase(uri.getPath(), params);

        ClickHouseUtils.extractParameters(uri.getRawQuery(), params);

        ClickHouseProtocol protocol = ClickHouseProtocol.fromUriScheme(scheme);
        int port = extract(scheme, uri.getPort(), protocol, params);

        ClickHouseCredentials credentials = extract(uri.getRawUserInfo(), params, template.credentials);

        Set<String> tags = new LinkedHashSet<>(template.tags);
        parseTags(uri.getRawFragment(), tags);

        // TODO allow to define scope of client option
        for (String key : new String[] {
                ClickHouseClientOption.LOAD_BALANCING_POLICY.getKey(),
                ClickHouseClientOption.LOAD_BALANCING_TAGS.getKey(),
                ClickHouseClientOption.FAILOVER.getKey(),
                ClickHouseClientOption.NODE_DISCOVERY_INTERVAL.getKey(),
                ClickHouseClientOption.NODE_DISCOVERY_LIMIT.getKey(),
                ClickHouseClientOption.HEALTH_CHECK_INTERVAL.getKey(),
                ClickHouseClientOption.NODE_GROUP_SIZE.getKey(),
                ClickHouseClientOption.CHECK_ALL_NODES.getKey()
        }) {
            if (template.options.containsKey(key)) {
                params.remove(key);
            }
        }

        return new ClickHouseNode(host, protocol, port, credentials, params, tags);
    }
Creates a node object using given URI.

@param uri      non-null URI which contains scheme(protocol), host and
                optionally port
@param template optinal template used for creating the node object
@return non-null node object
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java