From fa2f0dfa4ddb04403cc1c34f77e993da9ac5a6ac Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Mon, 28 Aug 2017 20:12:43 +0300 Subject: [PATCH] added root and identity section to zookeeper configuration [#CLICKHOUSE-3031] --- dbms/src/Common/ZooKeeper/ZooKeeper.cpp | 5 +++-- dbms/src/Common/ZooKeeper/ZooKeeper.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dbms/src/Common/ZooKeeper/ZooKeeper.cpp b/dbms/src/Common/ZooKeeper/ZooKeeper.cpp index e32b11b868..5cc3bb2f19 100644 --- a/dbms/src/Common/ZooKeeper/ZooKeeper.cpp +++ b/dbms/src/Common/ZooKeeper/ZooKeeper.cpp @@ -71,11 +71,12 @@ void ZooKeeper::processCallback(zhandle_t * zh, int type, int state, const char destroyContext(context); } -void ZooKeeper::init(const std::string & hosts_, const std::string & identity, int32_t session_timeout_ms_) +void ZooKeeper::init(const std::string & hosts_, const std::string & identity_, int32_t session_timeout_ms_) { log = &Logger::get("ZooKeeper"); zoo_set_debug_level(ZOO_LOG_LEVEL_ERROR); hosts = hosts_; + identity = identity_; session_timeout_ms = session_timeout_ms_; impl = zookeeper_init(hosts.c_str(), nullptr, session_timeout_ms, nullptr, nullptr, 0); @@ -727,7 +728,7 @@ ZooKeeper::~ZooKeeper() ZooKeeperPtr ZooKeeper::startNewSession() const { - return std::make_shared(hosts, session_timeout_ms); + return std::make_shared(hosts, identity, session_timeout_ms); } Op::Create::Create(const std::string & path_, const std::string & value_, ACLPtr acl_, int32_t flags_) diff --git a/dbms/src/Common/ZooKeeper/ZooKeeper.h b/dbms/src/Common/ZooKeeper/ZooKeeper.h index 6a070f21f4..d374d9aca3 100644 --- a/dbms/src/Common/ZooKeeper/ZooKeeper.h +++ b/dbms/src/Common/ZooKeeper/ZooKeeper.h @@ -397,6 +397,7 @@ private: MultiFuture asyncMultiImpl(const zkutil::Ops & ops_, bool throw_exception); std::string hosts; + std::string identity; int32_t session_timeout_ms; std::mutex mutex; -- GitLab