diff --git a/api/storage_service.cc b/api/storage_service.cc index 7503537cea..3281c32f07 100644 --- a/api/storage_service.cc +++ b/api/storage_service.cc @@ -4,6 +4,7 @@ #include "storage_service.hh" #include "api/api-doc/storage_service.json.hh" +#include "db/config.hh" #include #include #include diff --git a/db/batchlog_manager.cc b/db/batchlog_manager.cc index 63940c9e76..74b109ee86 100644 --- a/db/batchlog_manager.cc +++ b/db/batchlog_manager.cc @@ -34,6 +34,7 @@ #include "db_clock.hh" #include "database.hh" #include "unimplemented.hh" +#include "db/config.hh" static logging::logger logger("BatchLog Manager"); diff --git a/db/config.hh b/db/config.hh index 865cb95539..41956b281b 100644 --- a/db/config.hh +++ b/db/config.hh @@ -14,6 +14,24 @@ class file; namespace db { +typedef std::unordered_map string_map; + +/* + * This type is not use, and probably never will be. + * So it makes sense to jump through hoops just to ensure + * it is in fact handled properly... + */ +struct seed_provider_type { + seed_provider_type() = default; + seed_provider_type(sstring n, + std::initializer_list opts = + { }) + : class_name(std::move(n)), parameters(std::move(opts)) { + } + sstring class_name; + string_map parameters; +}; + class config { public: enum class value_status { @@ -79,22 +97,7 @@ public: typedef std::unordered_map string_map; typedef std::vector string_list; - - /* - * This type is not use, and probably never will be. - * So it makes sense to jump through hoops just to ensure - * it is in fact handled properly... - */ - struct seed_provider_type { - seed_provider_type() = default; - seed_provider_type(sstring n, - std::initializer_list opts = - { }) - : class_name(std::move(n)), parameters(std::move(opts)) { - } - sstring class_name; - string_map parameters; - }; + using seed_provider_type = db::seed_provider_type; /* * All values and documentation taken from diff --git a/db/system_keyspace.cc b/db/system_keyspace.cc index f97abe55cf..6e6979c75a 100644 --- a/db/system_keyspace.cc +++ b/db/system_keyspace.cc @@ -41,6 +41,7 @@ #include "db/serializer.hh" #include "query_context.hh" #include "partition_slice_builder.hh" +#include "db/config.hh" using days = std::chrono::duration>; diff --git a/message/messaging_service.cc b/message/messaging_service.cc index 25a4393533..5333d67d75 100644 --- a/message/messaging_service.cc +++ b/message/messaging_service.cc @@ -15,6 +15,7 @@ #include "query-request.hh" #include "query-result.hh" #include "rpc/rpc.hh" +#include "db/config.hh" namespace net { @@ -85,7 +86,7 @@ future<> deinit_messaging_service() { }); } -future<> init_messaging_service(sstring listen_address, db::config::seed_provider_type seed_provider) { +future<> init_messaging_service(sstring listen_address, db::seed_provider_type seed_provider) { const gms::inet_address listen(listen_address); std::set seeds; if (seed_provider.parameters.count("seeds") > 0) { diff --git a/message/messaging_service.hh b/message/messaging_service.hh index d577376b42..25fca89f21 100644 --- a/message/messaging_service.hh +++ b/message/messaging_service.hh @@ -14,7 +14,6 @@ #include "gms/inet_address.hh" #include "rpc/rpc_types.hh" #include -#include "db/config.hh" #include "frozen_mutation.hh" #include "query-request.hh" #include "db/serializer.hh" @@ -38,6 +37,10 @@ namespace utils { class UUID; } +namespace db { +class seed_provider_type; +} + namespace net { /* All verb handler identifiers */ @@ -411,5 +414,5 @@ inline messaging_service& get_local_messaging_service() { return _the_messaging_service.local(); } -future<> init_messaging_service(sstring listen_address, db::config::seed_provider_type seed_provider); +future<> init_messaging_service(sstring listen_address, db::seed_provider_type seed_provider); } // namespace net diff --git a/service/storage_proxy.cc b/service/storage_proxy.cc index 2c9785e8d2..5daf7492f9 100644 --- a/service/storage_proxy.cc +++ b/service/storage_proxy.cc @@ -37,6 +37,7 @@ #include "storage_service.hh" #include "core/future-util.hh" #include "db/read_repair_decision.hh" +#include "db/config.hh" #include #include #include diff --git a/tests/urchin/cql_test_env.cc b/tests/urchin/cql_test_env.cc index ae53091f7f..b8666d8139 100644 --- a/tests/urchin/cql_test_env.cc +++ b/tests/urchin/cql_test_env.cc @@ -11,6 +11,7 @@ #include "utils/UUID_gen.hh" #include "message/messaging_service.hh" #include "service/storage_service.hh" +#include "db/config.hh" class in_memory_cql_env : public cql_test_env { public: