database: Remove compaction_manager.hh inclusion into database.hh
The only reason why it's there (right next to compaction_fwd.hh) is because the database::table_truncate_state subclass needs the definition of compaction_manager::compaction_reenabler subclass. However, the former sub is not used outside of database.cc and can be defined in .cc. Keeping it outside of the header allows dropping the compaction_manager.hh from database.hh thus greatly reducing its fanout over the code (from ~180 indirect inclusions down to ~20). Signed-off-by: Pavel Emelyanov <xemul@scylladb.com> Closes #13622
This commit is contained in:
committed by
Nadav Har'El
parent
bd0b299322
commit
5e201b9120
@@ -17,6 +17,7 @@
|
|||||||
#include "db/system_keyspace.hh"
|
#include "db/system_keyspace.hh"
|
||||||
#include "db/data_listeners.hh"
|
#include "db/data_listeners.hh"
|
||||||
#include "storage_service.hh"
|
#include "storage_service.hh"
|
||||||
|
#include "compaction/compaction_manager.hh"
|
||||||
#include "unimplemented.hh"
|
#include "unimplemented.hh"
|
||||||
|
|
||||||
extern logging::logger apilog;
|
extern logging::logger apilog;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "compaction/task_manager_module.hh"
|
#include "compaction/task_manager_module.hh"
|
||||||
|
#include "compaction/compaction_manager.hh"
|
||||||
#include "replica/database.hh"
|
#include "replica/database.hh"
|
||||||
|
|
||||||
namespace compaction {
|
namespace compaction {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
#include "mutation/mutation_partition.hh"
|
#include "mutation/mutation_partition.hh"
|
||||||
#include "service/migration_manager.hh"
|
#include "service/migration_manager.hh"
|
||||||
#include "service/storage_proxy.hh"
|
#include "service/storage_proxy.hh"
|
||||||
|
#include "compaction/compaction_manager.hh"
|
||||||
#include "utils/small_vector.hh"
|
#include "utils/small_vector.hh"
|
||||||
#include "view_info.hh"
|
#include "view_info.hh"
|
||||||
#include "view_update_checks.hh"
|
#include "view_update_checks.hh"
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
#include "repair/decorated_key_with_hash.hh"
|
#include "repair/decorated_key_with_hash.hh"
|
||||||
#include "repair/row.hh"
|
#include "repair/row.hh"
|
||||||
#include "repair/writer.hh"
|
#include "repair/writer.hh"
|
||||||
|
#include "compaction/compaction_manager.hh"
|
||||||
#include "utils/xx_hasher.hh"
|
#include "utils/xx_hasher.hh"
|
||||||
|
|
||||||
extern logging::logger rlogger;
|
extern logging::logger rlogger;
|
||||||
|
|||||||
@@ -2330,6 +2330,14 @@ future<> database::truncate_table_on_all_shards(sharded<database>& sharded_db, s
|
|||||||
co_return co_await truncate_table_on_all_shards(sharded_db, table_shards, truncated_at_opt, with_snapshot, std::move(snapshot_name_opt));
|
co_return co_await truncate_table_on_all_shards(sharded_db, table_shards, truncated_at_opt, with_snapshot, std::move(snapshot_name_opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct database::table_truncate_state {
|
||||||
|
gate::holder holder;
|
||||||
|
db_clock::time_point low_mark_at;
|
||||||
|
db::replay_position low_mark;
|
||||||
|
std::vector<compaction_manager::compaction_reenabler> cres;
|
||||||
|
bool did_flush;
|
||||||
|
};
|
||||||
|
|
||||||
future<> database::truncate_table_on_all_shards(sharded<database>& sharded_db, const std::vector<foreign_ptr<lw_shared_ptr<table>>>& table_shards, std::optional<db_clock::time_point> truncated_at_opt, bool with_snapshot, std::optional<sstring> snapshot_name_opt) {
|
future<> database::truncate_table_on_all_shards(sharded<database>& sharded_db, const std::vector<foreign_ptr<lw_shared_ptr<table>>>& table_shards, std::optional<db_clock::time_point> truncated_at_opt, bool with_snapshot, std::optional<sstring> snapshot_name_opt) {
|
||||||
auto& cf = *table_shards[this_shard_id()];
|
auto& cf = *table_shards[this_shard_id()];
|
||||||
auto s = cf.schema();
|
auto s = cf.schema();
|
||||||
|
|||||||
@@ -64,7 +64,6 @@
|
|||||||
#include "db/operation_type.hh"
|
#include "db/operation_type.hh"
|
||||||
#include "utils/serialized_action.hh"
|
#include "utils/serialized_action.hh"
|
||||||
#include "compaction/compaction_fwd.hh"
|
#include "compaction/compaction_fwd.hh"
|
||||||
#include "compaction/compaction_manager.hh"
|
|
||||||
#include "utils/disk-error-handler.hh"
|
#include "utils/disk-error-handler.hh"
|
||||||
#include "rust/wasmtime_bindings.hh"
|
#include "rust/wasmtime_bindings.hh"
|
||||||
|
|
||||||
@@ -1672,13 +1671,7 @@ private:
|
|||||||
|
|
||||||
static future<std::vector<foreign_ptr<lw_shared_ptr<table>>>> get_table_on_all_shards(sharded<database>& db, table_id uuid);
|
static future<std::vector<foreign_ptr<lw_shared_ptr<table>>>> get_table_on_all_shards(sharded<database>& db, table_id uuid);
|
||||||
|
|
||||||
struct table_truncate_state {
|
struct table_truncate_state;
|
||||||
gate::holder holder;
|
|
||||||
db_clock::time_point low_mark_at;
|
|
||||||
db::replay_position low_mark;
|
|
||||||
std::vector<compaction_manager::compaction_reenabler> cres;
|
|
||||||
bool did_flush;
|
|
||||||
};
|
|
||||||
|
|
||||||
static future<> truncate_table_on_all_shards(sharded<database>& db, const std::vector<foreign_ptr<lw_shared_ptr<table>>>&, std::optional<db_clock::time_point> truncated_at_opt, bool with_snapshot, std::optional<sstring> snapshot_name_opt);
|
static future<> truncate_table_on_all_shards(sharded<database>& db, const std::vector<foreign_ptr<lw_shared_ptr<table>>>&, std::optional<db_clock::time_point> truncated_at_opt, bool with_snapshot, std::optional<sstring> snapshot_name_opt);
|
||||||
future<> truncate(column_family& cf, const table_truncate_state&, db_clock::time_point truncated_at);
|
future<> truncate(column_family& cf, const table_truncate_state&, db_clock::time_point truncated_at);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "database.hh" // for memtable_list
|
#include "database.hh" // for memtable_list
|
||||||
#include <seastar/core/metrics_api.hh>
|
#include <seastar/core/metrics_api.hh>
|
||||||
#include <seastar/util/later.hh>
|
#include <seastar/util/later.hh>
|
||||||
|
#include <seastar/core/sleep.hh>
|
||||||
#include <seastar/core/with_scheduling_group.hh>
|
#include <seastar/core/with_scheduling_group.hh>
|
||||||
#include <seastar/coroutine/maybe_yield.hh>
|
#include <seastar/coroutine/maybe_yield.hh>
|
||||||
#include "seastarx.hh"
|
#include "seastarx.hh"
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include "db/data_listeners.hh"
|
#include "db/data_listeners.hh"
|
||||||
#include "multishard_mutation_query.hh"
|
#include "multishard_mutation_query.hh"
|
||||||
#include "transport/messages/result_message.hh"
|
#include "transport/messages/result_message.hh"
|
||||||
|
#include "compaction/compaction_manager.hh"
|
||||||
#include "db/snapshot-ctl.hh"
|
#include "db/snapshot-ctl.hh"
|
||||||
|
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "exceptions/exceptions.hh"
|
#include "exceptions/exceptions.hh"
|
||||||
#include "locator/abstract_replication_strategy.hh"
|
#include "locator/abstract_replication_strategy.hh"
|
||||||
#include "replica/database.hh"
|
#include "replica/database.hh"
|
||||||
|
#include "compaction/compaction_manager.hh"
|
||||||
#include "data_dictionary/data_dictionary.hh"
|
#include "data_dictionary/data_dictionary.hh"
|
||||||
#include "gms/feature_service.hh"
|
#include "gms/feature_service.hh"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user