treewide: avoid including gms/feature_service.hh from headers
To avoid dependency proliferation, switch to forward declarations. In one case, we introduce indirection via std::unique_ptr and deinline the constructor and destructor. Ref #1 Closes scylladb/scylladb#25584
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gms/feature_service.hh"
|
||||
#include "schema/schema.hh"
|
||||
|
||||
#include "data_dictionary/data_dictionary.hh"
|
||||
@@ -26,6 +25,12 @@ enum class oper_t;
|
||||
|
||||
}
|
||||
|
||||
namespace gms {
|
||||
|
||||
class feature_service;
|
||||
|
||||
}
|
||||
|
||||
namespace secondary_index {
|
||||
|
||||
sstring index_table_name(const sstring& index_name);
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include "utils/log.hh"
|
||||
#include "raft/raft.hh"
|
||||
#include "gms/feature_service.hh"
|
||||
#include "service/endpoint_lifecycle_subscriber.hh"
|
||||
#include "service/topology_state_machine.hh"
|
||||
|
||||
@@ -26,6 +25,7 @@ class system_distributed_keyspace;
|
||||
|
||||
namespace gms {
|
||||
class gossiper;
|
||||
class feature_service;
|
||||
}
|
||||
|
||||
namespace netw {
|
||||
|
||||
@@ -10,10 +10,20 @@
|
||||
#include "readers/combined.hh"
|
||||
#include "replica/database.hh"
|
||||
#include "partition_slice_builder.hh"
|
||||
#include "gms/feature_service.hh"
|
||||
|
||||
#include <algorithm>
|
||||
#include <seastar/util/closeable.hh>
|
||||
|
||||
sstable_manager_service::sstable_manager_service(const db::config& dbcfg, sstable_compressor_factory& scf)
|
||||
: corrupt_data_handler(db::corrupt_data_handler::register_metrics::no)
|
||||
, feature_service_impl(std::make_unique<gms::feature_service>(gms::feature_config{get_disabled_features_from_db_config(dbcfg)}))
|
||||
, dir_sem(1)
|
||||
, sst_man("schema_loader", large_data_handler, corrupt_data_handler, dbcfg, feature_service, tracker, memory::stats().total_memory(), dir_sem, []{ return locator::host_id{}; }, scf, abort) {
|
||||
}
|
||||
|
||||
sstable_manager_service::~sstable_manager_service() = default;
|
||||
|
||||
future<std::filesystem::path> get_table_directory(std::filesystem::path scylla_data_path,
|
||||
std::string_view keyspace_name,
|
||||
std::string_view table_name) {
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "db/config.hh"
|
||||
#include "db/large_data_handler.hh"
|
||||
#include "db/corrupt_data_handler.hh"
|
||||
#include "gms/feature_service.hh"
|
||||
#include "schema/schema_fwd.hh"
|
||||
#include "sstables/sstable_directory.hh"
|
||||
#include "sstables/sstables_manager.hh"
|
||||
@@ -32,18 +31,15 @@ future<std::filesystem::path> get_table_directory(std::filesystem::path scylla_d
|
||||
struct sstable_manager_service {
|
||||
db::nop_large_data_handler large_data_handler;
|
||||
db::nop_corrupt_data_handler corrupt_data_handler;
|
||||
gms::feature_service feature_service;
|
||||
std::unique_ptr<gms::feature_service> feature_service_impl;
|
||||
gms::feature_service& feature_service = *feature_service_impl;
|
||||
cache_tracker tracker;
|
||||
sstables::directory_semaphore dir_sem;
|
||||
sstables::sstables_manager sst_man;
|
||||
abort_source abort;
|
||||
|
||||
explicit sstable_manager_service(const db::config& dbcfg, sstable_compressor_factory& scf)
|
||||
: corrupt_data_handler(db::corrupt_data_handler::register_metrics::no)
|
||||
, feature_service({get_disabled_features_from_db_config(dbcfg)})
|
||||
, dir_sem(1)
|
||||
, sst_man("schema_loader", large_data_handler, corrupt_data_handler, dbcfg, feature_service, tracker, memory::stats().total_memory(), dir_sem, []{ return locator::host_id{}; }, scf, abort) {
|
||||
}
|
||||
explicit sstable_manager_service(const db::config& dbcfg, sstable_compressor_factory& scf);
|
||||
~sstable_manager_service();
|
||||
|
||||
future<> stop() {
|
||||
return sst_man.close();
|
||||
|
||||
Reference in New Issue
Block a user