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

Function createDynamicHandlerFactory

src/Server/HTTPHandler.cpp:993–1015  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

991}
992
993HTTPRequestHandlerFactoryPtr createDynamicHandlerFactory(IServer & server,
994 const Poco::Util::AbstractConfiguration & config,
995 const std::string & config_prefix,
996 std::unordered_map<String, String> & common_headers)
997{
998 auto query_param_name = config.getString(config_prefix + ".handler.query_param_name", "query");
999
1000 HTTPHandlerConnectionConfig connection_config(config, config_prefix);
1001 HTTPResponseHeaderSetup http_response_headers_override = parseHTTPResponseHeaders(config, config_prefix);
1002 if (!common_headers.empty())
1003 {
1004 if (!http_response_headers_override.has_value())
1005 http_response_headers_override.emplace();
1006 http_response_headers_override.value().insert(common_headers.begin(), common_headers.end());
1007 }
1008
1009 auto creator = [&server, query_param_name, http_response_headers_override, connection_config]() -> std::unique_ptr<DynamicQueryHandler>
1010 { return std::make_unique<DynamicQueryHandler>(server, connection_config, query_param_name, http_response_headers_override); };
1011
1012 auto factory = std::make_shared<HandlingRuleHTTPHandlerFactory<DynamicQueryHandler>>(std::move(creator));
1013 factory->addFiltersFromConfig(config, config_prefix);
1014 return factory;
1015}
1016
1017HTTPRequestHandlerFactoryPtr createPredefinedHandlerFactory(IServer & server,
1018 const Poco::Util::AbstractConfiguration & config,

Callers 1

Calls 9

parseHTTPResponseHeadersFunction · 0.85
addFiltersFromConfigMethod · 0.80
getStringMethod · 0.45
emptyMethod · 0.45
emplaceMethod · 0.45
insertMethod · 0.45
valueMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected