Apply suggestions from code review

This commit is contained in:
Antonio Andelic 2023-07-17 12:50:02 +02:00 committed by GitHub
parent 5302b478a4
commit 9677cc5e2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View File

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

View File

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

View File

@ -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};

View File

@ -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;
}