███████████: fixed small errrors and better logging [#METR-13222]

This commit is contained in:
Pavel Kartavyy 2014-12-26 13:40:49 +03:00
parent b288819e2e
commit 1de925d879

View File

@ -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