mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-08 08:35:20 +00:00
414f470c79
* Refactoring: part 1 * Refactoring: part 2 * Handle request using ReadBuffer interface * Struggles with ReadBuffer's * Fix URI parsing * Implement parsing of multipart/form-data * Check HTTP_LENGTH_REQUIRED before eof() or will hang * Fix HTTPChunkedReadBuffer * Fix build and style * Fix test * Resist double-eof * Fix arcadian build
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <Interpreters/Context.h>
|
|
#include <Server/HTTP/HTTPRequestHandlerFactory.h>
|
|
#include "ColumnInfoHandler.h"
|
|
#include "IdentifierQuoteHandler.h"
|
|
#include "MainHandler.h"
|
|
#include "SchemaAllowedHandler.h"
|
|
|
|
#include <Poco/Logger.h>
|
|
|
|
#pragma GCC diagnostic push
|
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
#include <Poco/Data/SessionPool.h>
|
|
#pragma GCC diagnostic pop
|
|
|
|
|
|
namespace DB
|
|
{
|
|
/** Factory for '/ping', '/', '/columns_info', '/identifier_quote', '/schema_allowed' handlers.
|
|
* Also stores Session pools for ODBC connections
|
|
*/
|
|
class HandlerFactory : public HTTPRequestHandlerFactory
|
|
{
|
|
public:
|
|
HandlerFactory(const std::string & name_, size_t keep_alive_timeout_, Context & context_)
|
|
: log(&Poco::Logger::get(name_)), name(name_), keep_alive_timeout(keep_alive_timeout_), context(context_)
|
|
{
|
|
pool_map = std::make_shared<ODBCHandler::PoolMap>();
|
|
}
|
|
|
|
std::unique_ptr<HTTPRequestHandler> createRequestHandler(const HTTPServerRequest & request) override;
|
|
|
|
private:
|
|
Poco::Logger * log;
|
|
std::string name;
|
|
size_t keep_alive_timeout;
|
|
Context & context;
|
|
std::shared_ptr<ODBCHandler::PoolMap> pool_map;
|
|
};
|
|
}
|