From 21b59eeb0deb51f30d35c23cbdbe6df0dd8bac11 Mon Sep 17 00:00:00 2001 From: Pavel Kartavyy Date: Wed, 26 Nov 2014 21:58:51 +0300 Subject: [PATCH] style fix [#METR-13884] --- libs/libzkutil/include/zkutil/ZooKeeper.h | 8 ++++---- libs/libzkutil/src/ZooKeeper.cpp | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/libzkutil/include/zkutil/ZooKeeper.h b/libs/libzkutil/include/zkutil/ZooKeeper.h index 1aef3ee459a..302d8640ad4 100644 --- a/libs/libzkutil/include/zkutil/ZooKeeper.h +++ b/libs/libzkutil/include/zkutil/ZooKeeper.h @@ -29,7 +29,7 @@ class ZooKeeper public: typedef Poco::SharedPtr Ptr; - ZooKeeper(const std::string & hosts, int32_t sessionTimeoutMs = DEFAULT_SESSION_TIMEOUT); + ZooKeeper(const std::string & hosts, int32_t session_timeout_ms = DEFAULT_SESSION_TIMEOUT); /** конфиг вида @@ -245,7 +245,7 @@ private: friend struct WatchWithEvent; friend class EphemeralNodeHolder; - void init(const std::string & hosts, int32_t sessionTimeoutMs); + void init(const std::string & hosts, int32_t session_timeout_ms); void removeChildrenRecursive(const std::string & path); void tryRemoveChildrenRecursive(const std::string & path); void * watchForEvent(EventPtr event); @@ -265,7 +265,7 @@ private: /// если потеряно соединение подождем timeout/3, авось восстановится if (code == ZCONNECTIONLOSS) - usleep(sessionTimeoutMs * 1000 / 3); + usleep(session_timeout_ms * 1000 / 3); LOG_WARNING(log, "Error on attempt " << i << ": " << error2string(code) << ". Retry"); code = operation(); @@ -287,7 +287,7 @@ private: int32_t existsImpl(const std::string & path, Stat * stat_, EventPtr watch = nullptr); std::string hosts; - int32_t sessionTimeoutMs; + int32_t session_timeout_ms; Poco::FastMutex mutex; AclPtr default_acl; diff --git a/libs/libzkutil/src/ZooKeeper.cpp b/libs/libzkutil/src/ZooKeeper.cpp index 6086b3cd23b..60a23ca48d1 100644 --- a/libs/libzkutil/src/ZooKeeper.cpp +++ b/libs/libzkutil/src/ZooKeeper.cpp @@ -61,14 +61,14 @@ void ZooKeeper::processEvent(zhandle_t * zh, int type, int state, const char * p } } -void ZooKeeper::init(const std::string & hosts_, int32_t sessionTimeoutMs_) +void ZooKeeper::init(const std::string & hosts_, int32_t session_timeout_ms_) { log = &Logger::get("ZooKeeper"); zoo_set_debug_level(ZOO_LOG_LEVEL_ERROR); hosts = hosts_; - sessionTimeoutMs = sessionTimeoutMs_; + session_timeout_ms = session_timeout_ms_; - impl = zookeeper_init(hosts.c_str(), nullptr, sessionTimeoutMs, nullptr, nullptr, 0); + impl = zookeeper_init(hosts.c_str(), nullptr, session_timeout_ms, nullptr, nullptr, 0); ProfileEvents::increment(ProfileEvents::ZooKeeperInit); if (!impl) @@ -77,9 +77,9 @@ void ZooKeeper::init(const std::string & hosts_, int32_t sessionTimeoutMs_) default_acl = &ZOO_OPEN_ACL_UNSAFE; } -ZooKeeper::ZooKeeper(const std::string & hosts, int32_t sessionTimeoutMs) +ZooKeeper::ZooKeeper(const std::string & hosts, int32_t session_timeout_ms) { - init(hosts, sessionTimeoutMs); + init(hosts, session_timeout_ms); } struct ZooKeeperArgs @@ -566,7 +566,7 @@ ZooKeeper::~ZooKeeper() ZooKeeperPtr ZooKeeper::startNewSession() const { - return new ZooKeeper(hosts, sessionTimeoutMs); + return new ZooKeeper(hosts, session_timeout_ms); } Op::Create::Create(const std::string & path_, const std::string & value_, AclPtr acl, int32_t flags)