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>
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#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
|
|
|
|
2016-10-24 04:06:27 +00:00
|
|
|
namespace CurrentMetrics
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
extern const Metric InterserverConnection;
|
2016-10-24 04:06:27 +00:00
|
|
|
}
|
|
|
|
|
2014-03-21 13:42:14 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class InterserverIOHTTPHandler : public Poco::Net::HTTPRequestHandler
|
|
|
|
{
|
|
|
|
public:
|
2017-09-07 21:04:48 +00:00
|
|
|
explicit InterserverIOHTTPHandler(IServer & server_)
|
2017-04-01 07:20:54 +00:00
|
|
|
: server(server_)
|
2017-08-09 14:33:07 +00:00
|
|
|
, log(&Poco::Logger::get("InterserverIOHTTPHandler"))
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
|
|
|
}
|
2014-03-21 13:42:14 +00:00
|
|
|
|
2017-04-01 07:20:54 +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);
|
2014-03-21 13:42:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|