ClickHouse/dbms/programs/server/InterserverIOHTTPHandler.h

42 lines
938 B
C++
Raw Normal View History

2014-03-21 13:42:14 +00:00
#pragma once
2017-08-09 14:33:07 +00:00
#include <Poco/Logger.h>
#include <Poco/Net/HTTPRequestHandler.h>
#include <Common/CurrentMetrics.h>
2014-03-21 13:42:14 +00:00
2017-08-09 14:33:07 +00:00
#include "IServer.h"
2014-03-21 13:42:14 +00:00
namespace CurrentMetrics
{
extern const Metric InterserverConnection;
}
2014-03-21 13:42:14 +00:00
namespace DB
{
class InterserverIOHTTPHandler : public Poco::Net::HTTPRequestHandler
{
public:
explicit InterserverIOHTTPHandler(IServer & server_)
: server(server_)
2017-08-09 14:33:07 +00:00
, log(&Poco::Logger::get("InterserverIOHTTPHandler"))
{
}
2014-03-21 13:42:14 +00:00
void handleRequest(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse & response) override;
2014-03-21 13:42:14 +00:00
private:
2017-08-09 11:57:09 +00:00
IServer & server;
2017-08-09 14:33:07 +00:00
Poco::Logger * log;
2014-03-21 13:42:14 +00:00
2017-08-09 11:57:09 +00:00
CurrentMetrics::Increment metric_increment{CurrentMetrics::InterserverConnection};
void processQuery(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse & response);
std::pair<String, bool> checkAuthentication(Poco::Net::HTTPServerRequest & request) const;
2014-03-21 13:42:14 +00:00
};
}