From 6a18db0aeafe0b3eecb20d3431ec6dbf3371f4ad Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 5 Dec 2024 14:53:04 +0800 Subject: [PATCH] node_ops: switch from boost::join() to std::ranges::join_view() Replace boost::join() with std::ranges::join_view() as an interim solution before C++26's std::views::concat becomes available. This change: - Reduces dependencies on the Boost Ranges library - Moves closer to standard library implementations - Improves code maintainability and future compatibility This is part of ongoing efforts to modernize our codebase and minimize external dependencies. Signed-off-by: Kefu Chai Closes scylladb/scylladb#21786 --- node_ops/task_manager_module.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/node_ops/task_manager_module.cc b/node_ops/task_manager_module.cc index 8ba55aeb83..c60bf08728 100644 --- a/node_ops/task_manager_module.cc +++ b/node_ops/task_manager_module.cc @@ -15,9 +15,6 @@ #include "tasks/virtual_task_hint.hh" #include "utils/error_injection.hh" -#include -#include - using namespace std::chrono_literals; namespace node_ops { @@ -207,16 +204,14 @@ task_manager_module::task_manager_module(tasks::task_manager& tm, service::stora {} std::set task_manager_module::get_nodes() const noexcept { - return boost::copy_range>( - boost::join( - _ss._topology_state_machine._topology.normal_nodes, - _ss._topology_state_machine._topology.transition_nodes - ) | boost::adaptors::transformed([&ss = _ss] (auto& node) { + return std::ranges::join_view(std::to_array({ + std::views::all(_ss._topology_state_machine._topology.normal_nodes), + std::views::all(_ss._topology_state_machine._topology.transition_nodes)}) + ) | std::views::transform([&ss = _ss] (auto& node) { return ss.host2ip(locator::host_id{node.first.uuid()}); - }) | boost::adaptors::filtered([&ss = _ss] (auto& ip) { + }) | std::views::filter([&ss = _ss] (gms::inet_address ip) { return ss._gossiper.is_alive(ip); - }) - ); + }) | std::ranges::to>(); } }