diff --git a/api/storage_service.cc b/api/storage_service.cc index 0defa3a100..7d0f53ec7e 100644 --- a/api/storage_service.cc +++ b/api/storage_service.cc @@ -647,9 +647,9 @@ void set_storage_service(http_context& ctx, routes& r, sharded req) { + ss::get_current_generation_number.set(r, [&ss](std::unique_ptr req) { gms::inet_address ep(utils::fb_utilities::get_broadcast_address()); - return g.get_current_generation_number(ep).then([](gms::generation_type res) { + return ss.local().gossiper().get_current_generation_number(ep).then([](gms::generation_type res) { return make_ready_future(res.value()); }); }); @@ -894,11 +894,11 @@ void set_storage_service(http_context& ctx, routes& r, sharded(json_void()); }); - ss::is_initialized.set(r, [&ss, &g](std::unique_ptr req) { - return ss.local().get_operation_mode().then([&g] (auto mode) { + ss::is_initialized.set(r, [&ss](std::unique_ptr req) { + return ss.local().get_operation_mode().then([&ss] (auto mode) { bool is_initialized = mode >= service::storage_service::mode::STARTING; if (mode == service::storage_service::mode::NORMAL) { - is_initialized = g.is_enabled(); + is_initialized = ss.local().gossiper().is_enabled(); } return make_ready_future(is_initialized); }); @@ -1119,12 +1119,12 @@ void set_storage_service(http_context& ctx, routes& r, sharded(json_void()); }); - ss::get_cluster_name.set(r, [&g](const_req req) { - return g.get_cluster_name(); + ss::get_cluster_name.set(r, [&ss](const_req req) { + return ss.local().gossiper().get_cluster_name(); }); - ss::get_partitioner_name.set(r, [&g](const_req req) { - return g.get_partitioner_name(); + ss::get_partitioner_name.set(r, [&ss](const_req req) { + return ss.local().gossiper().get_partitioner_name(); }); ss::get_tombstone_warn_threshold.set(r, [](std::unique_ptr req) { diff --git a/service/storage_service.hh b/service/storage_service.hh index ec17b41b6c..b6bedd7051 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -228,6 +228,9 @@ private: return _batchlog_manager; } + friend struct ::node_ops_ctl; +public: + const gms::gossiper& gossiper() const noexcept { return _gossiper; }; @@ -236,9 +239,6 @@ private: return _gossiper; }; - friend struct ::node_ops_ctl; -public: - locator::effective_replication_map_factory& get_erm_factory() noexcept { return _erm_factory; }