style fix [#METR-13884]

This commit is contained in:
Pavel Kartavyy 2014-11-26 21:58:51 +03:00
parent 7aa585af85
commit 21b59eeb0d
2 changed files with 10 additions and 10 deletions

View File

@ -29,7 +29,7 @@ class ZooKeeper
public:
typedef Poco::SharedPtr<ZooKeeper> 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);
/** конфиг вида
<zookeeper>
@ -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;

View File

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