Files
zooqueen 0357c7e3ff datastore rebrand: lowercase clickhouse -> datastore in commands/prose/help
Completes the user-facing branding: lowercase `clickhouse` command/symlink names
(clickhouse-server/-client/-local/...), `clickhouse <subcommand>` usage strings, and bare-word
prose in messages/comments -> datastore (~238 occurrences across 227 files).

Intentionally KEPT (not branding):
- SQL dict-source keyword "clickhouse" (SOURCE(CLICKHOUSE(...)) compat) - 4 sites
- external URLs (clickhouse.com / github.com/ClickHouse)
- filesystem / ZooKeeper path conventions (/var/lib/clickhouse fallback default, /clickhouse/tables/
  ReplicatedMergeTree ZK path) - deployment convention, overridden by our datastore-* config

String/comment-literal changes only; no identifiers touched (verified no bare lowercase clickhouse
C++ symbol exists). Build was already green; verifying this is still green.
2026-06-21 23:46:30 -07:00

78 lines
1.8 KiB
C++

#pragma once
#include <Server/IServer.h>
#include <Daemon/BaseDaemon.h>
namespace Poco
{
namespace Net
{
class ServerSocket;
}
}
namespace DB
{
namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
}
/// standalone datastore-keeper server (replacement for ZooKeeper). Uses the same
/// config as datastore-server. Serves requests on TCP ports with or without
/// SSL using ZooKeeper protocol.
class Keeper : 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();
}
bool isCancelled() const override
{
return BaseDaemon::isCancelled();
}
/// Returns global application's context.
ContextMutablePtr context() const override
{
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot fetch context for Keeper");
}
void defineOptions(Poco::Util::OptionSet & _options) override;
protected:
void logRevision() const override;
void handleCustomArguments(const std::string & arg, const std::string & value);
int run() override;
void initialize(Application & self) override;
void uninitialize() override;
int main(const std::vector<std::string> & args) override;
std::string getDefaultConfigFileName() const override;
bool allowTextLog() const override;
private:
Poco::Net::SocketAddress socketBindListen(Poco::Net::ServerSocket & socket, const std::string & host, UInt16 port, [[maybe_unused]] bool secure = false) const;
using CreateServerFunc = std::function<void(UInt16)>;
void createServer(const std::string & listen_host, const char * port_name, bool listen_try, CreateServerFunc && func) const;
};
}