Merge pull request #11908 from ClickHouse/zookeeper-modernize

Slightly modernize code around ZooKeeper
This commit is contained in:
alexey-milovidov 2020-06-25 16:25:50 +03:00 committed by GitHub
commit 40755de412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,9 +5,11 @@
#include <random>
#include <functional>
#include <pcg-random/pcg_random.hpp>
#include <common/logger_useful.h>
#include <common/find_symbols.h>
#include <Common/randomSeed.h>
#include <Common/StringUtils/StringUtils.h>
#include <Common/PODArray.h>
#include <Common/thread_local_rng.h>
@ -168,9 +170,8 @@ struct ZooKeeperArgs
}
/// Shuffle the hosts to distribute the load among ZooKeeper nodes.
std::random_device rd;
std::mt19937 g(rd());
std::shuffle(hosts_strings.begin(), hosts_strings.end(), g);
pcg64 generator(randomSeed());
std::shuffle(hosts_strings.begin(), hosts_strings.end(), generator);
for (auto & host : hosts_strings)
{