mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Apply suggestions from code review
This commit is contained in:
parent
5302b478a4
commit
9677cc5e2b
@ -135,7 +135,7 @@ public:
|
||||
bool isServerActive() const;
|
||||
|
||||
void updateConfiguration(const Poco::Util::AbstractConfiguration & config, const MultiVersion<Macros>::Version & macros);
|
||||
void pushClusterUpdates(ClusterUpdateActions&& actions);
|
||||
void pushClusterUpdates(ClusterUpdateActions && actions);
|
||||
bool reconfigEnabled() const;
|
||||
|
||||
/// Shutdown internal keeper parts (server, state machine, log storage, etc)
|
||||
|
@ -39,7 +39,7 @@ ClusterUpdateActions leavingToClusterUpdates(const ClusterConfigPtr & cfg, std::
|
||||
if (leaving_arr.size() >= cfg->get_servers().size())
|
||||
return {};
|
||||
|
||||
std::unordered_set<int> remove_ids;
|
||||
std::unordered_set<int32_t> remove_ids;
|
||||
ClusterUpdateActions out;
|
||||
|
||||
for (std::string_view leaving_server : leaving_arr)
|
||||
@ -65,7 +65,7 @@ ClusterUpdateActions leavingToClusterUpdates(const ClusterConfigPtr & cfg, std::
|
||||
String serializeClusterConfig(const ClusterConfigPtr & cfg, const ClusterUpdateActions & updates)
|
||||
{
|
||||
RaftServers new_config;
|
||||
std::unordered_set<int> remove_update_ids;
|
||||
std::unordered_set<int32_t> remove_update_ids;
|
||||
|
||||
for (const auto & update : updates)
|
||||
{
|
||||
|
@ -789,7 +789,7 @@ std::vector<int64_t> KeeperServer::getDeadSessions()
|
||||
return state_machine->getDeadSessions();
|
||||
}
|
||||
|
||||
bool KeeperServer::applyConfigUpdate(const ClusterUpdateAction& action)
|
||||
bool KeeperServer::applyConfigUpdate(const ClusterUpdateAction & action)
|
||||
{
|
||||
std::lock_guard _{server_write_mutex};
|
||||
|
||||
|
@ -69,11 +69,12 @@ std::optional<RaftServerConfig> RaftServerConfig::parse(std::string_view server)
|
||||
RaftServers parseRaftServers(std::string_view servers)
|
||||
{
|
||||
std::vector<std::string_view> server_arr;
|
||||
std::unordered_set<int> ids;
|
||||
std::unordered_set<int32_t> ids;
|
||||
std::unordered_set<String> endpoints;
|
||||
RaftServers out;
|
||||
|
||||
for (auto & server : splitInto<','>(server_arr, servers))
|
||||
{
|
||||
if (auto maybe_server = RaftServerConfig::parse(server))
|
||||
{
|
||||
String endpoint = maybe_server->endpoint;
|
||||
@ -89,6 +90,7 @@ RaftServers parseRaftServers(std::string_view servers)
|
||||
}
|
||||
else
|
||||
return {};
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user