forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterserverIOHTTPHandler.h
More file actions
48 lines (33 loc) · 1.1 KB
/
InterserverIOHTTPHandler.h
File metadata and controls
48 lines (33 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include <Interpreters/InterserverCredentials.h>
#include <Server/HTTP/HTTPRequestHandler.h>
#include <Common/CurrentMetrics.h>
#include <Poco/Logger.h>
#include <memory>
#include <string>
namespace CurrentMetrics
{
extern const Metric InterserverConnection;
}
namespace DB
{
class IServer;
class WriteBufferFromHTTPServerResponse;
class InterserverIOHTTPHandler : public HTTPRequestHandler
{
public:
explicit InterserverIOHTTPHandler(IServer & server_)
: server(server_)
, log(getLogger("InterserverIOHTTPHandler"))
{
}
void handleRequest(HTTPServerRequest & request, HTTPServerResponse & response, const ProfileEvents::Event & write_event) override;
private:
using OutputPtr = std::shared_ptr<WriteBufferFromHTTPServerResponse>;
IServer & server;
LoggerPtr log;
CurrentMetrics::Increment metric_increment{CurrentMetrics::InterserverConnection};
void processQuery(HTTPServerRequest & request, HTTPServerResponse & response, OutputPtr used_output);
std::pair<String, bool> checkAuthentication(HTTPServerRequest & request) const;
};
}