Remove exists and use existsWatch instead for WatchCallbacks

This commit is contained in:
Silviu Caragea 2018-03-26 22:46:14 +03:00
parent 31874ed172
commit 4361df913b
4 changed files with 2 additions and 8 deletions

View File

@ -137,7 +137,7 @@ private:
return;
}
if (!zookeeper.exists(path + "/" + *(it - 1), nullptr, task_handle->getWatchCallback()))
if (!zookeeper.existsWatch(path + "/" + *(it - 1), nullptr, task_handle->getWatchCallback()))
task_handle->schedule();
success = true;

View File

@ -451,11 +451,6 @@ bool ZooKeeper::exists(const std::string & path, Stat * stat_, const EventPtr &
return existsWatch(path, stat_, callbackForEvent(watch));
}
bool ZooKeeper::exists(const std::string & path, Stat * stat, const WatchCallback & watch_callback)
{
return existsWatch(path, stat, watch_callback);
}
bool ZooKeeper::existsWatch(const std::string & path, Stat * stat_, const WatchCallback & watch_callback)
{
int32_t code = retry(std::bind(&ZooKeeper::existsImpl, this, path, stat_, watch_callback));

View File

@ -160,7 +160,6 @@ public:
int32_t tryRemoveEphemeralNodeWithRetries(const std::string & path, int32_t version = -1, size_t * attempt = nullptr);
bool exists(const std::string & path, Stat * stat = nullptr, const EventPtr & watch = nullptr);
bool exists(const std::string & path, Stat * stat, const WatchCallback & watch_callback);
bool existsWatch(const std::string & path, Stat * stat, const WatchCallback & watch_callback);
std::string get(const std::string & path, Stat * stat = nullptr, const EventPtr & watch = nullptr);

View File

@ -402,7 +402,7 @@ bool ReplicatedMergeTreeQueue::pullLogsToQueue(zkutil::ZooKeeperPtr zookeeper, B
if (next_update_task_handle)
{
if (zookeeper->exists(zookeeper_path + "/log/log-" + padIndex(index), nullptr, next_update_task_handle->getWatchCallback()))
if (zookeeper->existsWatch(zookeeper_path + "/log/log-" + padIndex(index), nullptr, next_update_task_handle->getWatchCallback()))
next_update_task_handle->schedule();
}