cross-tree: reduce dependency on db/config.hh and database.hh
Every time db/config.hh is modified (e.g., to add a new configuration option), 110 source files need to be recompiled. Many of those 110 didn't really care about configuration options, and just got the dependency accidentally by including some other header file. In this patch, I remove the include of "db/config.hh" from all header files. It is only needed in source files - and header files only need forward declarations. In some cases, source files were missing certain includes which they got incidentally from db/config.hh, so I had to add these includes explicitly. After this patch, the number of source files that get recompiled after a change to db/config.hh goes down from 110 to 45. It also means that 65 source files now compile faster because they don't include db/config.hh and whatever it included. Additionally, this patch also eliminates a few unnecessary inclusions of database.hh in other header files, which can use a forward declaration or database_fwd.hh. Some of the source files including one of those header files relied on one of the many header files brought in by database.hh, so we need to include those explicitly. In view_update_generator.hh something interesting happened - it *needs* database.hh because of code in the header file, but only included database_fwd.hh, and the only reason this worked was that the files including view_update_generator.hh already happened to unnecessarily include database.hh. So we fix that too. Refs #1 Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20210505102111.955470-1-nyh@scylladb.com>
This commit is contained in:
@@ -23,6 +23,8 @@
|
||||
#include "lua.hh"
|
||||
#include "log.hh"
|
||||
|
||||
#include <seastar/core/thread.hh>
|
||||
|
||||
namespace cql3 {
|
||||
namespace functions {
|
||||
|
||||
|
||||
@@ -49,10 +49,13 @@
|
||||
#include "types/map.hh"
|
||||
#include "query-result-set.hh"
|
||||
|
||||
#include <seastar/core/distributed.hh>
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
class keyspace_metadata;
|
||||
class database;
|
||||
|
||||
namespace query {
|
||||
class result_set;
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include <boost/range/adaptors.hpp>
|
||||
#include "db/snapshot-ctl.hh"
|
||||
#include "database.hh"
|
||||
|
||||
namespace db {
|
||||
|
||||
|
||||
@@ -44,7 +44,9 @@
|
||||
|
||||
#include <seastar/core/sharded.hh>
|
||||
#include <seastar/core/future.hh>
|
||||
#include "database.hh"
|
||||
#include "database_fwd.hh"
|
||||
#include <seastar/core/gate.hh>
|
||||
#include <seastar/core/rwlock.hh>
|
||||
|
||||
using namespace seastar;
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "database.hh"
|
||||
#include "dht/i_partitioner.hh"
|
||||
#include "keys.hh"
|
||||
#include "query-request.hh"
|
||||
@@ -56,6 +55,7 @@ class view_build_progress;
|
||||
|
||||
}
|
||||
|
||||
class database;
|
||||
|
||||
namespace db::view {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "database_fwd.hh"
|
||||
#include "database.hh"
|
||||
#include "sstables/sstables.hh"
|
||||
#include "db/view/view_updating_consumer.hh"
|
||||
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
#include "schema_fwd.hh"
|
||||
#include "mutation_fragment.hh"
|
||||
#include "sstables/shared_sstable.hh"
|
||||
#include "database.hh"
|
||||
#include "reader_permit.hh"
|
||||
#include "db/view/row_locking.hh"
|
||||
#include <seastar/core/abort_source.hh>
|
||||
|
||||
class evictable_reader_handle;
|
||||
|
||||
|
||||
2
init.hh
2
init.hh
@@ -24,13 +24,13 @@
|
||||
#include <seastar/core/future.hh>
|
||||
#include <seastar/core/distributed.hh>
|
||||
#include <seastar/core/abort_source.hh>
|
||||
#include "db/config.hh"
|
||||
#include "log.hh"
|
||||
#include "seastarx.hh"
|
||||
|
||||
namespace db {
|
||||
class extensions;
|
||||
class seed_provider_type;
|
||||
class config;
|
||||
namespace view {
|
||||
class view_update_generator;
|
||||
}
|
||||
|
||||
1
lua.cc
1
lua.cc
@@ -27,6 +27,7 @@
|
||||
#include "utils/date.h"
|
||||
#include <seastar/core/align.hh>
|
||||
#include <lua.hpp>
|
||||
#include "db/config.hh"
|
||||
|
||||
// Lua 5.4 added an extra parameter to lua_resume
|
||||
|
||||
|
||||
5
lua.hh
5
lua.hh
@@ -23,9 +23,12 @@
|
||||
|
||||
#include "types.hh"
|
||||
#include "utils/updateable_value.hh"
|
||||
#include "db/config.hh"
|
||||
#include <seastar/core/future.hh>
|
||||
|
||||
namespace db {
|
||||
class config;
|
||||
}
|
||||
|
||||
namespace lua {
|
||||
// type safe alias
|
||||
struct bitcode_view {
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "database.hh"
|
||||
#include "gms/gossiper.hh"
|
||||
#include <seastar/core/print.hh>
|
||||
#include "db/config.hh"
|
||||
|
||||
using namespace seastar;
|
||||
|
||||
|
||||
@@ -21,13 +21,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "db/config.hh"
|
||||
#include "seastar/core/sharded.hh"
|
||||
#include "seastar/core/future.hh"
|
||||
|
||||
namespace service {
|
||||
class migration_manager;
|
||||
}
|
||||
namespace db {
|
||||
class config;
|
||||
}
|
||||
|
||||
namespace redis {
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "message/messaging_service.hh"
|
||||
#include "sstables/sstables.hh"
|
||||
#include "database.hh"
|
||||
#include "db/config.hh"
|
||||
#include "hashers.hh"
|
||||
#include "locator/network_topology_strategy.hh"
|
||||
#include "utils/bit_cast.hh"
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
#include "cdc/stats.hh"
|
||||
#include "locator/token_metadata.hh"
|
||||
#include "db/hints/host_filter.hh"
|
||||
#include "db/config.hh"
|
||||
|
||||
class reconcilable_result;
|
||||
class frozen_mutation_and_schema;
|
||||
@@ -174,7 +173,7 @@ public:
|
||||
};
|
||||
using clock_type = lowres_clock;
|
||||
struct config {
|
||||
db::config::hinted_handoff_enabled_type hinted_handoff_enabled = {};
|
||||
db::hints::host_filter hinted_handoff_enabled = {};
|
||||
db::hints::directory_initializer hints_directory_initializer;
|
||||
size_t available_memory;
|
||||
smp_service_group read_smp_service_group = default_smp_service_group();
|
||||
|
||||
1
table.cc
1
table.cc
@@ -47,6 +47,7 @@
|
||||
#include "utils/fb_utilities.hh"
|
||||
#include "mutation_source_metadata.hh"
|
||||
#include "gms/gossiper.hh"
|
||||
#include "db/config.hh"
|
||||
|
||||
static logging::logger tlogger("table");
|
||||
static seastar::metrics::label column_family_label("cf");
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
|
||||
#include "transport/cql_protocol_extension.hh"
|
||||
#include "utils/bit_cast.hh"
|
||||
#include "db/config.hh"
|
||||
|
||||
namespace cql_transport {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user