From f51762c72a7ed651695a7bb10409b1c85c55f5e3 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Tue, 21 Feb 2023 20:14:51 +0300 Subject: [PATCH] headers: Refine view_update_generator.hh and around The initial intent was to reduce the fanout of shared_sstable.hh through v.u.g.hh -> cql_test_env.hh chain, but it also resulted in some shots around v.u.g.hh -> database.hh inclusion. By and large: - v.u.g.hh doesn't need database.hh - cql_test_env.hh doesn't need v.u.g.hh (and thus -- the shared_sstable.hh) but needs database.hh instead - few other .cc files need v.u.g.hh directly as they pulled it via cql_test_env.hh before - add forward declarations in few other places Signed-off-by: Pavel Emelyanov Closes #12952 --- db/view/view_update_generator.cc | 1 + db/view/view_update_generator.hh | 9 ++++++++- streaming/consumer.cc | 1 + streaming/stream_session.cc | 2 +- test/boost/view_build_test.cc | 1 + test/lib/cql_test_env.cc | 1 + test/lib/cql_test_env.hh | 3 ++- 7 files changed, 15 insertions(+), 3 deletions(-) diff --git a/db/view/view_update_generator.cc b/db/view/view_update_generator.cc index 8b3528b1a1..08022b63bb 100644 --- a/db/view/view_update_generator.cc +++ b/db/view/view_update_generator.cc @@ -8,6 +8,7 @@ #include #include +#include "replica/database.hh" #include "view_update_generator.hh" #include "service/priority_manager.hh" #include "utils/error_injection.hh" diff --git a/db/view/view_update_generator.hh b/db/view/view_update_generator.hh index 6aae8177fb..066c7e258b 100644 --- a/db/view/view_update_generator.hh +++ b/db/view/view_update_generator.hh @@ -8,13 +8,20 @@ #pragma once -#include "replica/database.hh" #include "sstables/shared_sstable.hh" +#include #include #include #include +using namespace seastar; + +namespace replica { +class database; +class table; +} + namespace db::view { class view_update_generator { diff --git a/streaming/consumer.cc b/streaming/consumer.cc index 2db662b533..3115a9a03a 100644 --- a/streaming/consumer.cc +++ b/streaming/consumer.cc @@ -9,6 +9,7 @@ #include #include "consumer.hh" +#include "replica/database.hh" #include "mutation/mutation_source_metadata.hh" #include "service/priority_manager.hh" #include "db/view/view_update_generator.hh" diff --git a/streaming/stream_session.cc b/streaming/stream_session.cc index b19730b77d..474f921cd1 100644 --- a/streaming/stream_session.cc +++ b/streaming/stream_session.cc @@ -31,7 +31,7 @@ #include "db/view/view_update_checks.hh" #include #include -#include "../db/view/view_update_generator.hh" +#include "replica/database.hh" #include "mutation/mutation_source_metadata.hh" #include "streaming/stream_mutation_fragments_cmd.hh" #include "consumer.hh" diff --git a/test/boost/view_build_test.cc b/test/boost/view_build_test.cc index 20bd4f37fc..01715ce4a8 100644 --- a/test/boost/view_build_test.cc +++ b/test/boost/view_build_test.cc @@ -11,6 +11,7 @@ #include "replica/database.hh" #include "db/view/view_builder.hh" #include "db/view/view_updating_consumer.hh" +#include "db/view/view_update_generator.hh" #include "db/system_keyspace.hh" #include "db/system_keyspace_view_types.hh" #include "db/config.hh" diff --git a/test/lib/cql_test_env.cc b/test/lib/cql_test_env.cc index 50111f91a8..10854c4d25 100644 --- a/test/lib/cql_test_env.cc +++ b/test/lib/cql_test_env.cc @@ -49,6 +49,7 @@ #include "unit_test_service_levels_accessor.hh" #include "db/view/view_builder.hh" #include "db/view/node_view_update_backlog.hh" +#include "db/view/view_update_generator.hh" #include "replica/distributed_loader.hh" // TODO: remove (#293) #include "message/messaging_service.hh" diff --git a/test/lib/cql_test_env.hh b/test/lib/cql_test_env.hh index 8ba85f7858..20fa2cf67a 100644 --- a/test/lib/cql_test_env.hh +++ b/test/lib/cql_test_env.hh @@ -16,7 +16,7 @@ #include #include -#include "db/view/view_update_generator.hh" +#include "replica/database.hh" #include "transport/messages/result_message_base.hh" #include "cql3/query_options_fwd.hh" #include "cql3/values.hh" @@ -36,6 +36,7 @@ class batchlog_manager; namespace db::view { class view_builder; +class view_update_generator; } namespace auth {