dbms: limited queries to OLAP compatibility layer [#METR-18008].

This commit is contained in:
Alexey Milovidov 2015-10-02 21:02:56 +03:00
parent 05a759468b
commit fba839199a
4 changed files with 9 additions and 7 deletions

View File

@ -51,6 +51,7 @@ void OLAPHTTPHandler::processQuery(Poco::Net::HTTPServerRequest & request, Poco:
context.setGlobalContext(*server.global_context); context.setGlobalContext(*server.global_context);
context.setUser(user, password, request.clientAddress().host(), quota_key); context.setUser(user, password, request.clientAddress().host(), quota_key);
context.setSetting("profile", profile);
context.setInterface(Context::Interface::OLAP_HTTP); context.setInterface(Context::Interface::OLAP_HTTP);
context.setHTTPMethod(Context::HTTPMethod::POST); context.setHTTPMethod(Context::HTTPMethod::POST);

View File

@ -11,8 +11,9 @@ class OLAPHTTPHandler : public Poco::Net::HTTPRequestHandler
{ {
public: public:
OLAPHTTPHandler(Server & server_) OLAPHTTPHandler(Server & server_)
: server(server_) : server(server_),
, log(&Logger::get("OLAPHTTPHandler")) log(&Logger::get("OLAPHTTPHandler")),
profile(Poco::Util::Application::instance().config().getString("olap_compatibility.profile"))
{ {
} }
@ -20,8 +21,8 @@ public:
private: private:
Server & server; Server & server;
Logger * log; Logger * log;
const String profile;
void processQuery(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse & response); void processQuery(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse & response);
}; };

View File

@ -10,8 +10,8 @@ namespace OLAP
QueryConverter::QueryConverter(Poco::Util::AbstractConfiguration & config) QueryConverter::QueryConverter(Poco::Util::AbstractConfiguration & config)
{ {
table_for_single_counter = config.getString("olap_table_for_single_counter"); table_for_single_counter = config.getString("olap_compatibility.table_for_single_counter");
table_for_all_counters = config.getString("olap_table_for_all_counters"); table_for_all_counters = config.getString("olap_compatibility.table_for_all_counters");
fillFormattedAttributeMap(); fillFormattedAttributeMap();
fillNumericAttributeMap(); fillNumericAttributeMap();

View File

@ -613,7 +613,6 @@ int Server::main(const std::vector<std::string> & args)
const std::string listen_host = config().getString("listen_host", "::"); 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::Timespan keep_alive_timeout(config().getInt("keep_alive_timeout", 10), 0);
Poco::ThreadPool server_pool(3, config().getInt("max_connections", 1024)); 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 /// OLAP HTTP
Poco::SharedPtr<Poco::Net::HTTPServer> olap_http_server; Poco::SharedPtr<Poco::Net::HTTPServer> olap_http_server;
bool use_olap_server = config().has("olap_compatibility.port");
if (use_olap_server) if (use_olap_server)
{ {
olap_parser.reset(new OLAP::QueryParser()); olap_parser.reset(new OLAP::QueryParser());
olap_converter.reset(new OLAP::QueryConverter(config())); 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.setReceiveTimeout(settings.receive_timeout);
olap_http_socket.setSendTimeout(settings.send_timeout); olap_http_socket.setSendTimeout(settings.send_timeout);
olap_http_server = new Poco::Net::HTTPServer( olap_http_server = new Poco::Net::HTTPServer(