mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
dbms: limited queries to OLAP compatibility layer [#METR-18008].
This commit is contained in:
parent
05a759468b
commit
fba839199a
@ -51,6 +51,7 @@ void OLAPHTTPHandler::processQuery(Poco::Net::HTTPServerRequest & request, Poco:
|
||||
context.setGlobalContext(*server.global_context);
|
||||
|
||||
context.setUser(user, password, request.clientAddress().host(), quota_key);
|
||||
context.setSetting("profile", profile);
|
||||
|
||||
context.setInterface(Context::Interface::OLAP_HTTP);
|
||||
context.setHTTPMethod(Context::HTTPMethod::POST);
|
||||
|
@ -11,8 +11,9 @@ class OLAPHTTPHandler : public Poco::Net::HTTPRequestHandler
|
||||
{
|
||||
public:
|
||||
OLAPHTTPHandler(Server & server_)
|
||||
: server(server_)
|
||||
, log(&Logger::get("OLAPHTTPHandler"))
|
||||
: server(server_),
|
||||
log(&Logger::get("OLAPHTTPHandler")),
|
||||
profile(Poco::Util::Application::instance().config().getString("olap_compatibility.profile"))
|
||||
{
|
||||
}
|
||||
|
||||
@ -20,8 +21,8 @@ public:
|
||||
|
||||
private:
|
||||
Server & server;
|
||||
|
||||
Logger * log;
|
||||
const String profile;
|
||||
|
||||
void processQuery(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse & response);
|
||||
};
|
||||
|
@ -10,8 +10,8 @@ namespace OLAP
|
||||
|
||||
QueryConverter::QueryConverter(Poco::Util::AbstractConfiguration & config)
|
||||
{
|
||||
table_for_single_counter = config.getString("olap_table_for_single_counter");
|
||||
table_for_all_counters = config.getString("olap_table_for_all_counters");
|
||||
table_for_single_counter = config.getString("olap_compatibility.table_for_single_counter");
|
||||
table_for_all_counters = config.getString("olap_compatibility.table_for_all_counters");
|
||||
|
||||
fillFormattedAttributeMap();
|
||||
fillNumericAttributeMap();
|
||||
|
@ -613,7 +613,6 @@ int Server::main(const std::vector<std::string> & args)
|
||||
|
||||
const std::string listen_host = config().getString("listen_host", "::");
|
||||
|
||||
bool use_olap_server = config().getBool("use_olap_http_server", false);
|
||||
Poco::Timespan keep_alive_timeout(config().getInt("keep_alive_timeout", 10), 0);
|
||||
|
||||
Poco::ThreadPool server_pool(3, config().getInt("max_connections", 1024));
|
||||
@ -657,12 +656,13 @@ int Server::main(const std::vector<std::string> & args)
|
||||
|
||||
/// OLAP HTTP
|
||||
Poco::SharedPtr<Poco::Net::HTTPServer> olap_http_server;
|
||||
bool use_olap_server = config().has("olap_compatibility.port");
|
||||
if (use_olap_server)
|
||||
{
|
||||
olap_parser.reset(new OLAP::QueryParser());
|
||||
olap_converter.reset(new OLAP::QueryConverter(config()));
|
||||
|
||||
Poco::Net::ServerSocket olap_http_socket(Poco::Net::SocketAddress(listen_host, config().getInt("olap_http_port")));
|
||||
Poco::Net::ServerSocket olap_http_socket(Poco::Net::SocketAddress(listen_host, config().getInt("olap_compatibility.port")));
|
||||
olap_http_socket.setReceiveTimeout(settings.receive_timeout);
|
||||
olap_http_socket.setSendTimeout(settings.send_timeout);
|
||||
olap_http_server = new Poco::Net::HTTPServer(
|
||||
|
Loading…
Reference in New Issue
Block a user