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

Function createReadBuffer

src/Databases/DataLake/HTTPBasedCatalogUtils.cpp:22–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20{
21
22DB::ReadWriteBufferFromHTTPPtr createReadBuffer(
23 const std::string & endpoint,
24 DB::ContextPtr context,
25 const Poco::Net::HTTPBasicCredentials & credentials,
26 const Poco::URI::QueryParameters & params,
27 const DB::HTTPHeaderEntries & headers,
28 const std::string & method,
29 std::function<void(std::ostream &)> out_stream_callaback)
30{
31 Poco::URI url(endpoint);
32 if (!params.empty())
33 url.setQueryParameters(params);
34
35 return DB::BuilderRWBufferFromHTTP(url)
36 .withConnectionGroup(DB::HTTPConnectionGroupType::HTTP)
37 .withSettings(context->getReadSettings())
38 .withTimeouts(DB::ConnectionTimeouts::getHTTPTimeouts(context->getSettingsRef(), context->getServerSettings()))
39 .withHostFilter(&context->getRemoteHostFilter())
40 .withHeaders(headers)
41 .withDelayInit(false)
42 .withSkipNotFound(false)
43 .withMethod(method)
44 .withOutCallback(out_stream_callaback)
45 .create(credentials);
46}
47
48std::pair<Poco::Dynamic::Var, std::string> makeHTTPRequestAndReadJSON(
49 const std::string & endpoint,

Callers 8

existsTableMethod · 0.70
requestRestMethod · 0.70
loadConfigMethod · 0.70
getNamespacesMethod · 0.70
getTablesMethod · 0.70
getTableMetadataImplMethod · 0.70

Calls 6

getReadSettingsMethod · 0.80
getHTTPTimeoutsFunction · 0.50
emptyMethod · 0.45
setQueryParametersMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected