ClickHouse/dbms/src/Server/Server.h

66 lines
1.6 KiB
C++
Raw Normal View History

2012-03-09 03:06:09 +00:00
#pragma once
#include <Poco/URI.h>
2012-03-09 03:06:09 +00:00
#include <Poco/Util/LayeredConfiguration.h>
#include <Poco/Net/HTTPServer.h>
#include <Poco/Net/HTTPRequestHandlerFactory.h>
#include <Poco/Net/HTTPRequestHandler.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPServerParams.h>
#include <Poco/Net/HTTPServerRequest.h>
#include <Poco/Net/HTTPServerResponse.h>
#include <Poco/Net/HTMLForm.h>
2012-03-09 03:06:09 +00:00
2012-03-09 15:46:52 +00:00
#include <Poco/Net/TCPServer.h>
#include <Poco/Net/TCPServerConnectionFactory.h>
#include <Poco/Net/TCPServerConnection.h>
2015-09-29 19:19:54 +00:00
#include <common/logger_useful.h>
#include <daemon/BaseDaemon.h>
#include <Common/HTMLForm.h>
2012-03-09 03:06:09 +00:00
#include <Interpreters/Context.h>
2012-03-09 03:06:09 +00:00
/** Server provides three interfaces:
* 1. HTTP - simple interface for any applications.
* 2. TCP - interface for native clickhouse-client and for server to server internal communications.
* More rich and efficient, but less compatible
* - data is transferred by columns;
* - data is transferred compressed;
* Allows to get more information in response.
* 3. Interserver HTTP - for replication.
2012-03-09 03:06:09 +00:00
*/
namespace DB
{
class Server : public BaseDaemon
2012-03-09 03:06:09 +00:00
{
public:
/// Global settings of server.
std::unique_ptr<Context> global_context;
2015-10-05 01:26:43 +00:00
protected:
void initialize(Application & self) override
{
BaseDaemon::initialize(self);
logger().information("starting up");
}
2015-10-05 01:26:43 +00:00
void uninitialize() override
{
logger().information("shutting down");
BaseDaemon::uninitialize();
}
2012-03-09 03:06:09 +00:00
int main(const std::vector<std::string> & args) override;
private:
std::string getDefaultCorePath() const override;
2012-03-09 03:06:09 +00:00
};
}