From 82c76832df29c019a7082debac25bbd5073c15bb Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 4 Apr 2021 13:36:57 +0300 Subject: [PATCH] treewide: don't include "db/system_distributed_keyspace.hh" from headers This just causes unneeded and slower recompliations. Instead replace with forward declarations, or includes of smaller headers that were incidentally brought in by the one removed. The .cc files that really need it gain the include, but they are few. Ref #1. Closes #8403 --- database.cc | 1 + db/view/view.cc | 1 + db/view/view_builder.hh | 7 ++++++- db/view/view_update_checks.hh | 7 ++++++- message/messaging_service.hh | 1 + repair/repair.cc | 1 + repair/repair.hh | 1 + repair/row_level.cc | 1 + repair/row_level.hh | 7 ++++++- service/storage_proxy.cc | 1 + service/storage_service.cc | 1 + streaming/stream_session.cc | 1 + streaming/stream_session.hh | 7 ++++++- 13 files changed, 33 insertions(+), 4 deletions(-) diff --git a/database.cc b/database.cc index 94dce787ad..d746f7a065 100644 --- a/database.cc +++ b/database.cc @@ -26,6 +26,7 @@ #include #include "db/commitlog/commitlog_entry.hh" #include "db/system_keyspace.hh" +#include "db/system_distributed_keyspace.hh" #include "db/commitlog/commitlog.hh" #include "db/config.hh" #include "to_string.hh" diff --git a/db/view/view.cc b/db/view/view.cc index 1799908804..3464db97cc 100644 --- a/db/view/view.cc +++ b/db/view/view.cc @@ -61,6 +61,7 @@ #include "db/view/view_updating_consumer.hh" #include "db/system_keyspace_view_types.hh" #include "db/system_keyspace.hh" +#include "db/system_distributed_keyspace.hh" #include "frozen_mutation.hh" #include "gms/inet_address.hh" #include "keys.hh" diff --git a/db/view/view_builder.hh b/db/view/view_builder.hh index 1364571806..a74150f625 100644 --- a/db/view/view_builder.hh +++ b/db/view/view_builder.hh @@ -22,7 +22,6 @@ #pragma once #include "database.hh" -#include "db/system_distributed_keyspace.hh" #include "dht/i_partitioner.hh" #include "keys.hh" #include "query-request.hh" @@ -44,6 +43,12 @@ #include #include +namespace db { + +class system_distributed_keyspace; + +} + namespace db::system_keyspace { using view_name = std::pair; diff --git a/db/view/view_update_checks.hh b/db/view/view_update_checks.hh index a2bab3d118..f77b951954 100644 --- a/db/view/view_update_checks.hh +++ b/db/view/view_update_checks.hh @@ -21,11 +21,16 @@ #pragma once -#include "db/system_distributed_keyspace.hh" #include "streaming/stream_reason.hh" #include #include +namespace db { + +class system_distributed_keyspace; + +} + namespace db::view { future check_view_build_ongoing(db::system_distributed_keyspace& sys_dist_ks, const sstring& ks_name, const sstring& cf_name); diff --git a/message/messaging_service.hh b/message/messaging_service.hh index 44dc0a4271..dd557bffef 100644 --- a/message/messaging_service.hh +++ b/message/messaging_service.hh @@ -74,6 +74,7 @@ class update_backlog; class frozen_mutation; class frozen_schema; class partition_checksum; +class canonical_mutation; namespace dht { class token; diff --git a/repair/repair.cc b/repair/repair.cc index 0cd7bf36c1..6a2b8f4f74 100644 --- a/repair/repair.cc +++ b/repair/repair.cc @@ -37,6 +37,7 @@ #include "hashers.hh" #include "locator/network_topology_strategy.hh" #include "utils/bit_cast.hh" +#include "service/migration_manager.hh" #include #include diff --git a/repair/repair.hh b/repair/repair.hh index 19a42a7c0d..a02b3d30cd 100644 --- a/repair/repair.hh +++ b/repair/repair.hh @@ -30,6 +30,7 @@ #include #include #include +#include #include "database_fwd.hh" #include "frozen_mutation.hh" diff --git a/repair/row_level.cc b/repair/row_level.cc index 936a713d74..ffbdb4213f 100644 --- a/repair/row_level.cc +++ b/repair/row_level.cc @@ -51,6 +51,7 @@ #include "repair/row_level.hh" #include "mutation_source_metadata.hh" #include "utils/stall_free.hh" +#include "service/migration_manager.hh" extern logging::logger rlogger; diff --git a/repair/row_level.hh b/repair/row_level.hh index 9cac523548..ce6c0ca618 100644 --- a/repair/row_level.hh +++ b/repair/row_level.hh @@ -23,12 +23,17 @@ #include #include "gms/inet_address.hh" -#include "db/system_distributed_keyspace.hh" #include "repair/repair.hh" #include class row_level_repair_gossip_helper; +namespace db { + +class system_distributed_keyspace; + +} + namespace gms { class gossiper; } diff --git a/service/storage_proxy.cc b/service/storage_proxy.cc index e66d4f0d94..bad335fc97 100644 --- a/service/storage_proxy.cc +++ b/service/storage_proxy.cc @@ -93,6 +93,7 @@ #include "cdc/cdc_options.hh" #include "utils/histogram_metrics_helper.hh" #include "service/paxos/prepare_summary.hh" +#include "service/migration_manager.hh" #include "service/paxos/proposal.hh" #include "locator/token_metadata.hh" #include "seastar/core/coroutine.hh" diff --git a/service/storage_service.cc b/service/storage_service.cc index 96f1ce8a5c..83c5d51364 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -42,6 +42,7 @@ #include #include "locator/snitch_base.hh" #include "db/system_keyspace.hh" +#include "db/system_distributed_keyspace.hh" #include "utils/UUID.hh" #include "gms/inet_address.hh" #include "log.hh" diff --git a/streaming/stream_session.cc b/streaming/stream_session.cc index b382060d2c..fff9001557 100644 --- a/streaming/stream_session.cc +++ b/streaming/stream_session.cc @@ -55,6 +55,7 @@ #include "streaming/stream_exception.hh" #include "service/storage_proxy.hh" #include "service/priority_manager.hh" +#include "service/migration_manager.hh" #include "query-request.hh" #include "schema_registry.hh" #include "mutation_writer/multishard_writer.hh" diff --git a/streaming/stream_session.hh b/streaming/stream_session.hh index 4d1656fb42..b59f3db0a7 100644 --- a/streaming/stream_session.hh +++ b/streaming/stream_session.hh @@ -53,11 +53,16 @@ #include "streaming/session_info.hh" #include "query-request.hh" #include "dht/i_partitioner.hh" -#include "db/system_distributed_keyspace.hh" #include #include #include +namespace db { + +class system_distributed_keyspace; + +} + namespace db::view { class view_update_generator;