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 <kefu.chai@scylladb.com>

Closes scylladb/scylladb#21786
This commit is contained in:
Kefu Chai
2024-12-05 14:53:04 +08:00
committed by Pavel Emelyanov
parent 2491a31f4c
commit 6a18db0aea

View File

@@ -15,9 +15,6 @@
#include "tasks/virtual_task_hint.hh"
#include "utils/error_injection.hh"
#include <boost/range/adaptor/filtered.hpp>
#include <boost/range/adaptor/transformed.hpp>
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<gms::inet_address> task_manager_module::get_nodes() const noexcept {
return boost::copy_range<std::set<gms::inet_address>>(
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<std::set<gms::inet_address>>();
}
}