MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / getHostAndPort

Function getHostAndPort

src/Client/ConnectionString.cpp:45–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void getHostAndPort(const Poco::URI & uri, std::vector<std::vector<std::string>> & hosts_and_ports_arguments)
46{
47 std::vector<std::string> host_and_port;
48 const std::string & host = uri.getHost();
49 if (!host.empty())
50 {
51 host_and_port.push_back("--host=" + uriDecode(host, false));
52 }
53
54 // Port can be written without host (":9000"). Empty host name equals to default host.
55 auto port = uri.getPort();
56 if (port != 0)
57 host_and_port.push_back("--port=" + std::to_string(port));
58
59 if (!host_and_port.empty())
60 hosts_and_ports_arguments.push_back(std::move(host_and_port));
61}
62
63void buildConnectionString(
64 std::string_view host_and_port,

Callers 2

buildConnectionStringFunction · 0.85
tryParseConnectionStringFunction · 0.85

Calls 6

uriDecodeFunction · 0.85
getHostMethod · 0.80
to_stringFunction · 0.50
emptyMethod · 0.45
push_backMethod · 0.45
getPortMethod · 0.45

Tested by

no test coverage detected