ClickHouse/programs/server/Server.h
Ivan 5b858de374
Split programs/server into actual program and library (#11186)
* Split programs/server into actual program and library
2020-05-27 20:52:52 +03:00

63 lines
1.3 KiB
C++

#pragma once
#include <Server/IServer.h>
#include <daemon/BaseDaemon.h>
/** 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.
*/
namespace DB
{
class Server : public BaseDaemon, public IServer
{
public:
using ServerApplication::run;
Poco::Util::LayeredConfiguration & config() const override
{
return BaseDaemon::config();
}
Poco::Logger & logger() const override
{
return BaseDaemon::logger();
}
Context & context() const override
{
return *global_context_ptr;
}
bool isCancelled() const override
{
return BaseDaemon::isCancelled();
}
void defineOptions(Poco::Util::OptionSet & _options) override;
protected:
int run() override;
void initialize(Application & self) override;
void uninitialize() override;
int main(const std::vector<std::string> & args) override;
std::string getDefaultCorePath() const override;
private:
Context * global_context_ptr = nullptr;
};
}