mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
███████████: fixed small errrors and better logging [#METR-13222]
This commit is contained in:
parent
b288819e2e
commit
1de925d879
@ -11,12 +11,19 @@ namespace zkutil
|
||||
public:
|
||||
/// lock_prefix - относительный путь до блокировки в ZK. Начинается со слеша
|
||||
/// lock_name - имя ноды блокировки в ZK
|
||||
Lock(zkutil::ZooKeeperPtr zk, const std::string & lock_prefix_, const std::string & lock_name_, const std::string & lock_message_ = "") :
|
||||
Lock(zkutil::ZooKeeperPtr zk, const std::string & lock_prefix_, const std::string & lock_name_, const std::string & lock_message_ = "",
|
||||
bool create_parent_path = false) :
|
||||
zookeeper(zk), lock_path(lock_prefix_ + "/" + lock_name_), lock_message(lock_message_), log(&Logger::get("zkutil::Lock"))
|
||||
{
|
||||
if (create_parent_path)
|
||||
zookeeper->createAncestors(lock_prefix_);
|
||||
|
||||
zookeeper->createIfNotExists(lock_prefix_, "");
|
||||
}
|
||||
|
||||
Lock(const Lock &) = delete;
|
||||
Lock & operator=(const Lock &) = delete;
|
||||
|
||||
~Lock()
|
||||
{
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user