From 76bea231743dc1736319421f71ca62ab67afb351 Mon Sep 17 00:00:00 2001 From: Pavel Solodovnikov Date: Fri, 4 Jun 2021 12:49:37 +0300 Subject: [PATCH] treewide: reduce header interdependencies Use forward declarations wherever possible. Signed-off-by: Pavel Solodovnikov Closes #8813 --- atomic_cell.hh | 1 - cache_flat_mutation_reader.hh | 3 +- canonical_mutation.cc | 2 ++ canonical_mutation.hh | 7 +++-- cdc/generation.cc | 1 + cell_locking.hh | 1 - compaction_garbage_collector.hh | 3 +- compaction_strategy.hh | 2 +- compatible_ring_position.hh | 2 +- converting_mutation_partition_applier.hh | 5 ++++ cql3/attributes.cc | 1 + cql3/authorized_prepared_statements_cache.hh | 1 + cql3/cql_statement.hh | 27 +++++++++--------- cql3/expr/expression.cc | 2 ++ cql3/expr/expression.hh | 16 ++++++++--- cql3/functions/abstract_function.hh | 2 ++ cql3/functions/as_json_function.hh | 1 + cql3/functions/function.hh | 3 +- cql3/functions/function_call.hh | 1 + cql3/functions/token_fct.hh | 1 + cql3/operation.hh | 1 + cql3/prepared_statements_cache.hh | 2 ++ cql3/query_options.cc | 1 + cql3/query_options.hh | 4 +-- cql3/query_processor.cc | 1 + cql3/query_processor.hh | 8 ++++-- cql3/selection/abstract_function_selector.cc | 1 + cql3/selection/abstract_function_selector.hh | 4 ++- cql3/selection/aggregate_function_selector.hh | 1 + cql3/selection/selector_factories.hh | 3 +- cql3/statements/alter_keyspace_statement.cc | 1 + cql3/statements/alter_keyspace_statement.hh | 3 +- .../alter_service_level_statement.cc | 2 ++ cql3/statements/alter_table_statement.hh | 1 + cql3/statements/alter_type_statement.hh | 1 + cql3/statements/alter_view_statement.hh | 2 +- .../attach_service_level_statement.cc | 2 ++ cql3/statements/authentication_statement.hh | 1 - cql3/statements/authorization_statement.cc | 2 ++ cql3/statements/authorization_statement.hh | 1 - cql3/statements/batch_statement.hh | 11 ++++---- cql3/statements/cf_statement.cc | 1 + cql3/statements/create_function_statement.cc | 1 + cql3/statements/create_function_statement.hh | 9 +++++- cql3/statements/create_index_statement.cc | 2 ++ cql3/statements/create_index_statement.hh | 11 +++----- cql3/statements/create_keyspace_statement.cc | 1 + cql3/statements/create_keyspace_statement.hh | 3 +- .../create_service_level_statement.cc | 2 ++ cql3/statements/create_table_statement.cc | 1 + cql3/statements/create_table_statement.hh | 3 +- cql3/statements/create_type_statement.hh | 1 + cql3/statements/create_view_statement.cc | 1 + cql3/statements/create_view_statement.hh | 12 ++++---- cql3/statements/delete_statement.hh | 5 ++-- .../detach_service_level_statement.cc | 2 ++ cql3/statements/drop_function_statement.cc | 1 + cql3/statements/drop_index_statement.cc | 1 + cql3/statements/drop_index_statement.hh | 5 ++-- .../drop_service_level_statement.cc | 2 ++ cql3/statements/drop_table_statement.hh | 3 +- cql3/statements/drop_type_statement.hh | 1 - cql3/statements/drop_view_statement.hh | 2 +- cql3/statements/function_statement.cc | 1 + cql3/statements/function_statement.hh | 8 +++++- cql3/statements/grant_statement.cc | 2 ++ cql3/statements/ks_prop_defs.cc | 1 + cql3/statements/ks_prop_defs.hh | 5 +++- ...ist_service_level_attachments_statement.cc | 2 ++ .../list_service_level_statement.cc | 2 ++ cql3/statements/modification_statement.hh | 13 ++------- cql3/statements/prepared_statement.hh | 28 +++++++++---------- cql3/statements/raw/batch_statement.hh | 14 ++++------ cql3/statements/raw/delete_statement.hh | 5 +++- cql3/statements/raw/insert_statement.hh | 4 +-- cql3/statements/raw/modification_statement.hh | 8 ------ cql3/statements/raw/parsed_statement.cc | 1 + cql3/statements/raw/parsed_statement.hh | 8 ++++-- cql3/statements/raw/select_statement.hh | 19 +++++++------ cql3/statements/raw/update_statement.hh | 6 ++-- cql3/statements/raw/use_statement.hh | 2 ++ cql3/statements/revoke_statement.cc | 2 ++ cql3/statements/select_statement.cc | 3 ++ cql3/statements/select_statement.hh | 24 ++++++++++------ cql3/statements/update_statement.cc | 1 + cql3/statements/update_statement.hh | 4 ++- cql3/statements/use_statement.cc | 1 + cql3/statements/use_statement.hh | 12 ++++---- cql3/term.hh | 4 +-- cql3/tuples.hh | 1 + cql3/type_cast.hh | 1 + db/commitlog/commitlog_extensions.hh | 7 ++--- db/commitlog/commitlog_replayer.cc | 1 + db/consistency_level.hh | 1 - db/data_listeners.hh | 3 +- db/hints/host_filter.hh | 10 ++++--- db/hints/manager.cc | 1 + db/hints/manager.hh | 4 +-- db/hints/resource_manager.hh | 6 +++- db/system_distributed_keyspace.cc | 1 + db/system_distributed_keyspace.hh | 2 +- db/system_keyspace.cc | 1 + db/system_keyspace.hh | 11 ++++++-- db/view/row_locking.cc | 1 + db/view/row_locking.hh | 2 -- db/view/view.cc | 2 ++ db/view/view.hh | 6 ++-- db/view/view_builder.hh | 8 ++++-- db/view/view_update_generator.cc | 1 + db/view/view_update_generator.hh | 3 +- flat_mutation_reader.cc | 2 ++ flat_mutation_reader.hh | 3 +- frozen_mutation.cc | 1 + hashing_partition_visitor.hh | 1 + memtable-sstable.hh | 20 ++++++------- memtable.cc | 1 + multishard_mutation_query.hh | 19 ++++++++++++- mutation_partition.cc | 2 ++ mutation_partition.hh | 10 ++++--- mutation_partition_serializer.hh | 2 -- mutation_partition_view.hh | 1 + mutation_partition_visitor.hh | 17 ++++++----- mutation_query.hh | 6 ++-- mutation_reader.hh | 1 - partition_builder.hh | 7 ++++- partition_snapshot_reader.hh | 1 + partition_version.hh | 3 +- query-result-reader.hh | 2 -- query-result-set.hh | 7 +++-- range_tombstone_list.hh | 3 +- reader_permit.hh | 6 ++-- release.cc | 4 +-- row_cache.hh | 2 -- schema.hh | 1 - service/raft/raft_sys_table_storage.cc | 1 + service/storage_proxy.cc | 2 ++ sstables/compaction.cc | 1 + sstables/mutation_fragment_filter.hh | 1 + table_helper.cc | 1 + table_helper.hh | 3 +- test/boost/cdc_test.cc | 2 ++ test/boost/counter_test.cc | 1 + test/boost/cql_query_test.cc | 1 + test/boost/flat_mutation_reader_test.cc | 1 + test/boost/frozen_mutation_test.cc | 1 + test/boost/logalloc_test.cc | 3 ++ test/boost/view_build_test.cc | 1 + test/lib/cql_test_env.cc | 1 + test/lib/mutation_source_test.cc | 1 + test/manual/sstable_scan_footprint_test.cc | 1 + test/perf/perf_fast_forward.cc | 4 +++ test/perf/perf_idl.cc | 1 + thrift/handler.hh | 1 + thrift/server.hh | 1 + tracing/trace_keyspace_helper.hh | 1 + transport/messages/result_message.hh | 1 + transport/server.cc | 1 + transport/server.hh | 2 ++ utils/large_bitset.hh | 5 ---- utils/logalloc.cc | 2 ++ utils/logalloc.hh | 4 --- utils/phased_barrier.hh | 1 - version.hh | 8 ++---- 163 files changed, 396 insertions(+), 238 deletions(-) diff --git a/atomic_cell.hh b/atomic_cell.hh index 62d52d8b67..808fcb6764 100644 --- a/atomic_cell.hh +++ b/atomic_cell.hh @@ -26,7 +26,6 @@ #include "tombstone.hh" #include "gc_clock.hh" #include "utils/managed_bytes.hh" -#include "utils/fragment_range.hh" #include #include #include diff --git a/cache_flat_mutation_reader.hh b/cache_flat_mutation_reader.hh index 0e515b53af..a2efc719ee 100644 --- a/cache_flat_mutation_reader.hh +++ b/cache_flat_mutation_reader.hh @@ -25,12 +25,11 @@ #include "row_cache.hh" #include "mutation_reader.hh" #include "mutation_fragment.hh" -#include "partition_version.hh" -#include "utils/logalloc.hh" #include "query-request.hh" #include "partition_snapshot_row_cursor.hh" #include "read_context.hh" #include "flat_mutation_reader.hh" +#include "clustering_key_filter.hh" namespace cache { diff --git a/canonical_mutation.cc b/canonical_mutation.cc index 3749ce37a9..2eb42bce1f 100644 --- a/canonical_mutation.cc +++ b/canonical_mutation.cc @@ -21,6 +21,8 @@ #include "canonical_mutation.hh" #include "mutation.hh" +#include "mutation_partition_view.hh" +#include "mutation_partition_visitor.hh" #include "mutation_partition_serializer.hh" #include "counters.hh" #include "converting_mutation_partition_applier.hh" diff --git a/canonical_mutation.hh b/canonical_mutation.hh index 703cc651c3..c98a284101 100644 --- a/canonical_mutation.hh +++ b/canonical_mutation.hh @@ -24,10 +24,13 @@ #include "bytes.hh" #include "schema_fwd.hh" #include "database_fwd.hh" -#include "mutation_partition_visitor.hh" -#include "mutation_partition_serializer.hh" +#include "bytes_ostream.hh" #include +namespace utils { + class UUID; +} // namespace utils + // Immutable mutation form which can be read using any schema version of the same table. // Safe to access from other shards via const&. // Safe to pass serialized across nodes. diff --git a/cdc/generation.cc b/cdc/generation.cc index cea7de23ad..7d24fc5d64 100644 --- a/cdc/generation.cc +++ b/cdc/generation.cc @@ -38,6 +38,7 @@ #include "gms/inet_address.hh" #include "gms/gossiper.hh" #include "gms/feature_service.hh" +#include "utils/UUID_gen.hh" #include "cdc/generation.hh" #include "cdc/cdc_options.hh" diff --git a/cell_locking.hh b/cell_locking.hh index 5ff8b8874b..3802453bcd 100644 --- a/cell_locking.hh +++ b/cell_locking.hh @@ -24,7 +24,6 @@ #include #include "utils/small_vector.hh" -#include "mutation_fragment.hh" #include "mutation_partition.hh" #include "xx_hasher.hh" diff --git a/compaction_garbage_collector.hh b/compaction_garbage_collector.hh index 84f4fab13a..c486cc4503 100644 --- a/compaction_garbage_collector.hh +++ b/compaction_garbage_collector.hh @@ -21,10 +21,11 @@ #pragma once -#include "collection_mutation.hh" +#include "schema_fwd.hh" class atomic_cell; class row_marker; +struct collection_mutation_description; class compaction_garbage_collector { public: diff --git a/compaction_strategy.hh b/compaction_strategy.hh index 98955a551d..f09921fe69 100644 --- a/compaction_strategy.hh +++ b/compaction_strategy.hh @@ -28,7 +28,6 @@ #include "schema_fwd.hh" #include "sstables/shared_sstable.hh" #include "exceptions/exceptions.hh" -#include "sstables/compaction_backlog_manager.hh" #include "compaction_strategy_type.hh" class table; @@ -36,6 +35,7 @@ using column_family = table; class flat_mutation_reader; struct mutation_source_metadata; +class compaction_backlog_tracker; namespace sstables { diff --git a/compatible_ring_position.hh b/compatible_ring_position.hh index e27cbe90f9..929acd82ee 100644 --- a/compatible_ring_position.hh +++ b/compatible_ring_position.hh @@ -22,7 +22,7 @@ #pragma once -#include "query-request.hh" +#include "dht/i_partitioner.hh" #include #include diff --git a/converting_mutation_partition_applier.hh b/converting_mutation_partition_applier.hh index 71fbcfba19..8c7980b6ff 100644 --- a/converting_mutation_partition_applier.hh +++ b/converting_mutation_partition_applier.hh @@ -22,12 +22,17 @@ #pragma once #include "mutation_partition_visitor.hh" +#include "atomic_cell.hh" +#include "schema.hh" // temporary: bring in definition of `column_kind` class schema; class row; class mutation_partition; class column_mapping; class deletable_row; +class column_definition; +class abstract_type; +class atomic_cell_or_collection; // Mutation partition visitor which applies visited data into // existing mutation_partition. The visited data may be of a different schema. diff --git a/cql3/attributes.cc b/cql3/attributes.cc index df21a8eb7a..13a7eef626 100644 --- a/cql3/attributes.cc +++ b/cql3/attributes.cc @@ -40,6 +40,7 @@ */ #include "cql3/attributes.hh" +#include "cql3/column_identifier.hh" namespace cql3 { diff --git a/cql3/authorized_prepared_statements_cache.hh b/cql3/authorized_prepared_statements_cache.hh index 1906df9e3d..e9449fb65c 100644 --- a/cql3/authorized_prepared_statements_cache.hh +++ b/cql3/authorized_prepared_statements_cache.hh @@ -22,6 +22,7 @@ #pragma once #include "cql3/prepared_statements_cache.hh" +#include "auth/authenticated_user.hh" namespace cql3 { diff --git a/cql3/cql_statement.hh b/cql3/cql_statement.hh index 680232aab5..0346c60635 100644 --- a/cql3/cql_statement.hh +++ b/cql3/cql_statement.hh @@ -41,14 +41,13 @@ #pragma once -#include "service/client_state.hh" -#include "service/query_state.hh" -#include "cql3/query_options.hh" #include "timeout_config.hh" namespace service { class storage_proxy; +class query_state; +class client_state; } @@ -67,13 +66,15 @@ namespace cql3 { class query_processor; class metadata; -shared_ptr make_empty_metadata(); +seastar::shared_ptr make_empty_metadata(); + +class query_options; class cql_statement { timeout_config_selector _timeout_config_selector; public: // CQL statement text - sstring raw_cql_statement; + seastar::sstring raw_cql_statement; explicit cql_statement(timeout_config_selector timeout_selector) : _timeout_config_selector(timeout_selector) {} @@ -89,7 +90,7 @@ public: * * @param state the current client state */ - virtual future<> check_access(service::storage_proxy& proxy, const service::client_state& state) const = 0; + virtual seastar::future<> check_access(service::storage_proxy& proxy, const service::client_state& state) const = 0; /** * Perform additional validation required by the statment. @@ -105,14 +106,14 @@ public: * @param state the current query state * @param options options for this query (consistency, variables, pageSize, ...) */ - virtual future<::shared_ptr> + virtual seastar::future> execute(query_processor& qp, service::query_state& state, const query_options& options) const = 0; - virtual bool depends_on_keyspace(const sstring& ks_name) const = 0; + virtual bool depends_on_keyspace(const seastar::sstring& ks_name) const = 0; - virtual bool depends_on_column_family(const sstring& cf_name) const = 0; + virtual bool depends_on_column_family(const seastar::sstring& cf_name) const = 0; - virtual shared_ptr get_result_metadata() const = 0; + virtual seastar::shared_ptr get_result_metadata() const = 0; virtual bool is_conditional() const { return false; @@ -122,7 +123,7 @@ public: class cql_statement_no_metadata : public cql_statement { public: using cql_statement::cql_statement; - virtual shared_ptr get_result_metadata() const override { + virtual seastar::shared_ptr get_result_metadata() const override { return make_empty_metadata(); } }; @@ -133,10 +134,10 @@ public: class cql_statement_opt_metadata : public cql_statement { protected: // Result set metadata, may be empty for simple updates and batches - shared_ptr _metadata; + seastar::shared_ptr _metadata; public: using cql_statement::cql_statement; - virtual shared_ptr get_result_metadata() const override { + virtual seastar::shared_ptr get_result_metadata() const override { if (_metadata) { return _metadata; } diff --git a/cql3/expr/expression.cc b/cql3/expr/expression.cc index 2867d3fc9f..314ae42086 100644 --- a/cql3/expr/expression.cc +++ b/cql3/expr/expression.cc @@ -34,11 +34,13 @@ #include "cql3/lists.hh" #include "cql3/statements/request_validations.hh" #include "cql3/tuples.hh" +#include "cql3/selection/selection.hh" #include "index/secondary_index_manager.hh" #include "types/list.hh" #include "types/map.hh" #include "types/set.hh" #include "utils/like_matcher.hh" +#include "query-result-reader.hh" namespace cql3 { namespace expr { diff --git a/cql3/expr/expression.hh b/cql3/expr/expression.hh index f64d6e5e2d..3ec90176cf 100644 --- a/cql3/expr/expression.hh +++ b/cql3/expr/expression.hh @@ -28,25 +28,33 @@ #include #include "bytes.hh" -#include "cql3/query_options.hh" -#include "cql3/selection/selection.hh" #include "cql3/statements/bound.hh" #include "cql3/term.hh" #include "database_fwd.hh" #include "gc_clock.hh" -#include "mutation_partition.hh" -#include "query-result-reader.hh" #include "range.hh" #include "seastarx.hh" #include "utils/overloaded_functor.hh" +class row; + namespace secondary_index { class index; class secondary_index_manager; } // namespace secondary_index +namespace query { + class result_row_view; +} // namespace query + namespace cql3 { +class query_options; + +namespace selection { + class selection; +} // namespace selection + namespace expr { struct allow_local_index_tag {}; diff --git a/cql3/functions/abstract_function.hh b/cql3/functions/abstract_function.hh index 891a5f75da..908974683d 100644 --- a/cql3/functions/abstract_function.hh +++ b/cql3/functions/abstract_function.hh @@ -48,6 +48,8 @@ #include #include +#include "cql3/functions/function_name.hh" + namespace std { std::ostream& operator<<(std::ostream& os, const std::vector& arg_types); } diff --git a/cql3/functions/as_json_function.hh b/cql3/functions/as_json_function.hh index 7959e6fea8..d7c656efa9 100644 --- a/cql3/functions/as_json_function.hh +++ b/cql3/functions/as_json_function.hh @@ -43,6 +43,7 @@ #include "cql3/functions/function.hh" #include "cql3/functions/scalar_function.hh" +#include "cql3/functions/function_name.hh" #include "cql3/cql3_type.hh" #include "cql3/type_json.hh" diff --git a/cql3/functions/function.hh b/cql3/functions/function.hh index 8dfe91fef2..969470b225 100644 --- a/cql3/functions/function.hh +++ b/cql3/functions/function.hh @@ -41,7 +41,6 @@ #pragma once -#include "function_name.hh" #include "types.hh" #include #include @@ -49,6 +48,8 @@ namespace cql3 { namespace functions { +class function_name; + class function { public: using opt_bytes = std::optional; diff --git a/cql3/functions/function_call.hh b/cql3/functions/function_call.hh index e60422fa7f..d4c4fec9df 100644 --- a/cql3/functions/function_call.hh +++ b/cql3/functions/function_call.hh @@ -45,6 +45,7 @@ #include "scalar_function.hh" #include "cql3/term.hh" #include "exceptions/exceptions.hh" +#include "cql3/functions/function_name.hh" namespace cql3 { namespace functions { diff --git a/cql3/functions/token_fct.hh b/cql3/functions/token_fct.hh index 34401cff78..e3447977e9 100644 --- a/cql3/functions/token_fct.hh +++ b/cql3/functions/token_fct.hh @@ -45,6 +45,7 @@ #include "native_scalar_function.hh" #include "dht/i_partitioner.hh" #include "utils/UUID.hh" +#include "unimplemented.hh" namespace cql3 { namespace functions { diff --git a/cql3/operation.hh b/cql3/operation.hh index 4b964f5c59..936b513dd7 100644 --- a/cql3/operation.hh +++ b/cql3/operation.hh @@ -46,6 +46,7 @@ #include "database_fwd.hh" #include "term.hh" #include "update_parameters.hh" +#include "cql3/column_identifier.hh" #include diff --git a/cql3/prepared_statements_cache.hh b/cql3/prepared_statements_cache.hh index 50c9613011..86d35cc449 100644 --- a/cql3/prepared_statements_cache.hh +++ b/cql3/prepared_statements_cache.hh @@ -24,7 +24,9 @@ #pragma once #include "utils/loading_cache.hh" +#include "utils/hash.hh" #include "cql3/statements/prepared_statement.hh" +#include "cql3/column_specification.hh" namespace cql3 { diff --git a/cql3/query_options.cc b/cql3/query_options.cc index f5f260fb0e..1f85076b46 100644 --- a/cql3/query_options.cc +++ b/cql3/query_options.cc @@ -43,6 +43,7 @@ #include "query_options.hh" #include "version.hh" #include "db/consistency_level_type.hh" +#include "cql3/column_identifier.hh" namespace cql3 { diff --git a/cql3/query_options.hh b/cql3/query_options.hh index 4d92c8f98a..0c3e665dd3 100644 --- a/cql3/query_options.hh +++ b/cql3/query_options.hh @@ -47,8 +47,6 @@ #include "db/consistency_level_type.hh" #include "service/query_state.hh" #include "service/pager/paging_state.hh" -#include "cql3/column_specification.hh" -#include "cql3/column_identifier.hh" #include "cql3/values.hh" #include "cql_serialization_format.hh" @@ -57,6 +55,8 @@ namespace cql3 { class cql_config; extern const cql_config default_cql_config; +class column_specification; + /** * Options for a query. */ diff --git a/cql3/query_processor.cc b/cql3/query_processor.cc index ae6bf9ce7f..af007e9062 100644 --- a/cql3/query_processor.cc +++ b/cql3/query_processor.cc @@ -46,6 +46,7 @@ #include "cql3/CqlParser.hpp" #include "cql3/error_collector.hh" #include "cql3/statements/batch_statement.hh" +#include "cql3/statements/modification_statement.hh" #include "cql3/util.hh" #include "cql3/untyped_result_set.hh" #include "db/config.hh" diff --git a/cql3/query_processor.hh b/cql3/query_processor.hh index 5cd65d7a90..55ca39a9d6 100644 --- a/cql3/query_processor.hh +++ b/cql3/query_processor.hh @@ -50,16 +50,16 @@ #include "cql3/prepared_statements_cache.hh" #include "cql3/authorized_prepared_statements_cache.hh" -#include "cql3/query_options.hh" #include "cql3/statements/prepared_statement.hh" #include "exceptions/exceptions.hh" -#include "log.hh" #include "service/migration_listener.hh" -#include "service/query_state.hh" #include "transport/messages/result_message.hh" +#include "service/qos/service_level_controller.hh" +#include "service/client_state.hh" namespace service { class migration_manager; +class query_state; } namespace cql3 { @@ -105,6 +105,8 @@ public: }; class cql_config; +class query_options; +class cql_statement; class query_processor { public: diff --git a/cql3/selection/abstract_function_selector.cc b/cql3/selection/abstract_function_selector.cc index c175058729..7367ce452b 100644 --- a/cql3/selection/abstract_function_selector.cc +++ b/cql3/selection/abstract_function_selector.cc @@ -41,6 +41,7 @@ #include "aggregate_function_selector.hh" #include "scalar_function_selector.hh" #include "to_string.hh" +#include "cql3/selection/selector_factories.hh" namespace cql3 { diff --git a/cql3/selection/abstract_function_selector.hh b/cql3/selection/abstract_function_selector.hh index cb98d2efe0..25e02e91b6 100644 --- a/cql3/selection/abstract_function_selector.hh +++ b/cql3/selection/abstract_function_selector.hh @@ -40,13 +40,15 @@ #pragma once #include "selector.hh" -#include "selector_factories.hh" #include "cql3/functions/function.hh" +#include "cql3/functions/function_name.hh" #include namespace cql3 { namespace selection { +class selector_factories; + class abstract_function_selector : public selector { protected: shared_ptr _fun; diff --git a/cql3/selection/aggregate_function_selector.hh b/cql3/selection/aggregate_function_selector.hh index 58931e7ad8..eb695a9cc6 100644 --- a/cql3/selection/aggregate_function_selector.hh +++ b/cql3/selection/aggregate_function_selector.hh @@ -39,6 +39,7 @@ #include "abstract_function_selector.hh" #include "cql3/functions/aggregate_function.hh" +#include "cql_serialization_format.hh" #pragma once diff --git a/cql3/selection/selector_factories.hh b/cql3/selection/selector_factories.hh index b601d79e80..8c42dbfff3 100644 --- a/cql3/selection/selector_factories.hh +++ b/cql3/selection/selector_factories.hh @@ -43,13 +43,14 @@ #include #include "cql3/selection/selector.hh" -#include "cql3/selection/selectable.hh" #include "schema.hh" namespace cql3 { namespace selection { +class selectable; + /** * A set of selector factories. */ diff --git a/cql3/statements/alter_keyspace_statement.cc b/cql3/statements/alter_keyspace_statement.cc index 84b8820489..25e7ee439b 100644 --- a/cql3/statements/alter_keyspace_statement.cc +++ b/cql3/statements/alter_keyspace_statement.cc @@ -46,6 +46,7 @@ #include "db/system_keyspace.hh" #include "database.hh" #include "cql3/query_processor.hh" +#include "cql3/statements/ks_prop_defs.hh" bool is_system_keyspace(std::string_view keyspace); diff --git a/cql3/statements/alter_keyspace_statement.hh b/cql3/statements/alter_keyspace_statement.hh index b9aa14ef07..5b7003790d 100644 --- a/cql3/statements/alter_keyspace_statement.hh +++ b/cql3/statements/alter_keyspace_statement.hh @@ -44,7 +44,6 @@ #include #include "cql3/statements/schema_altering_statement.hh" -#include "cql3/statements/ks_prop_defs.hh" namespace cql3 { @@ -52,6 +51,8 @@ class query_processor; namespace statements { +class ks_prop_defs; + class alter_keyspace_statement : public schema_altering_statement { sstring _name; ::shared_ptr _attrs; diff --git a/cql3/statements/alter_service_level_statement.cc b/cql3/statements/alter_service_level_statement.cc index fd621c3320..cccdb84dd6 100644 --- a/cql3/statements/alter_service_level_statement.cc +++ b/cql3/statements/alter_service_level_statement.cc @@ -23,6 +23,8 @@ #include "cql3/statements/alter_service_level_statement.hh" #include "service/qos/service_level_controller.hh" #include "transport/messages/result_message.hh" +#include "service/client_state.hh" +#include "service/query_state.hh" namespace cql3 { diff --git a/cql3/statements/alter_table_statement.hh b/cql3/statements/alter_table_statement.hh index 87db443ebb..3480c120db 100644 --- a/cql3/statements/alter_table_statement.hh +++ b/cql3/statements/alter_table_statement.hh @@ -44,6 +44,7 @@ #include "cql3/statements/schema_altering_statement.hh" #include "cql3/statements/cf_prop_defs.hh" #include "cql3/cql3_type.hh" +#include "cql3/column_identifier.hh" #include "database_fwd.hh" namespace cql3 { diff --git a/cql3/statements/alter_type_statement.hh b/cql3/statements/alter_type_statement.hh index 21e87a9389..66e4155185 100644 --- a/cql3/statements/alter_type_statement.hh +++ b/cql3/statements/alter_type_statement.hh @@ -44,6 +44,7 @@ #include "cql3/statements/schema_altering_statement.hh" #include "cql3/cql3_type.hh" #include "cql3/ut_name.hh" +#include "database_fwd.hh" namespace service { class migration_manager; diff --git a/cql3/statements/alter_view_statement.hh b/cql3/statements/alter_view_statement.hh index 50e08cbece..2c413d4135 100644 --- a/cql3/statements/alter_view_statement.hh +++ b/cql3/statements/alter_view_statement.hh @@ -46,11 +46,11 @@ #include "database_fwd.hh" #include "cql3/statements/cf_prop_defs.hh" #include "cql3/statements/schema_altering_statement.hh" -#include "cql3/cf_name.hh" namespace cql3 { class query_processor; +class cf_name; namespace statements { diff --git a/cql3/statements/attach_service_level_statement.cc b/cql3/statements/attach_service_level_statement.cc index 8cd6399748..1cadb8e800 100644 --- a/cql3/statements/attach_service_level_statement.cc +++ b/cql3/statements/attach_service_level_statement.cc @@ -24,6 +24,8 @@ #include "service/qos/service_level_controller.hh" #include "exceptions/exceptions.hh" #include "transport/messages/result_message.hh" +#include "service/client_state.hh" +#include "service/query_state.hh" namespace cql3 { diff --git a/cql3/statements/authentication_statement.hh b/cql3/statements/authentication_statement.hh index 9ee218b7f6..dba04b4a32 100644 --- a/cql3/statements/authentication_statement.hh +++ b/cql3/statements/authentication_statement.hh @@ -42,7 +42,6 @@ #pragma once #include "cql3/cql_statement.hh" -#include "prepared_statement.hh" #include "raw/parsed_statement.hh" #include "transport/messages_fwd.hh" diff --git a/cql3/statements/authorization_statement.cc b/cql3/statements/authorization_statement.cc index 719d35545c..85942a09de 100644 --- a/cql3/statements/authorization_statement.cc +++ b/cql3/statements/authorization_statement.cc @@ -41,6 +41,8 @@ #include "authorization_statement.hh" #include "transport/messages/result_message.hh" +#include "service/client_state.hh" +#include "auth/resource.hh" uint32_t cql3::statements::authorization_statement::get_bound_terms() const { return 0; diff --git a/cql3/statements/authorization_statement.hh b/cql3/statements/authorization_statement.hh index 2987699cb8..2575c923f7 100644 --- a/cql3/statements/authorization_statement.hh +++ b/cql3/statements/authorization_statement.hh @@ -42,7 +42,6 @@ #pragma once #include "cql3/cql_statement.hh" -#include "prepared_statement.hh" #include "raw/parsed_statement.hh" #include "transport/messages_fwd.hh" diff --git a/cql3/statements/batch_statement.hh b/cql3/statements/batch_statement.hh index 96f88946d6..a9c80947c0 100644 --- a/cql3/statements/batch_statement.hh +++ b/cql3/statements/batch_statement.hh @@ -36,17 +36,16 @@ * You should have received a copy of the GNU General Public License * along with Scylla. If not, see . */ +#pragma once #include "cql3/cql_statement.hh" -#include "modification_statement.hh" -#include "raw/modification_statement.hh" #include "raw/batch_statement.hh" -#include "transport/messages/result_message.hh" #include "timestamp.hh" #include "log.hh" -#include "to_string.hh" -#pragma once +namespace cql_transport::messages { + class result_message; +} namespace cql3 { @@ -54,6 +53,8 @@ class query_processor; namespace statements { +class modification_statement; + /** * A BATCH statement parsed from a CQL query. * diff --git a/cql3/statements/cf_statement.cc b/cql3/statements/cf_statement.cc index 44e1636dd4..a06fcc9359 100644 --- a/cql3/statements/cf_statement.cc +++ b/cql3/statements/cf_statement.cc @@ -41,6 +41,7 @@ #include "raw/cf_statement.hh" #include "service/client_state.hh" +#include "cql3/column_specification.hh" namespace cql3 { diff --git a/cql3/statements/create_function_statement.cc b/cql3/statements/create_function_statement.cc index 30dddfac70..d53341f10f 100644 --- a/cql3/statements/create_function_statement.cc +++ b/cql3/statements/create_function_statement.cc @@ -21,6 +21,7 @@ #include "cql3/statements/create_function_statement.hh" #include "cql3/functions/functions.hh" +#include "cql3/functions/user_function.hh" #include "prepared_statement.hh" #include "service/migration_manager.hh" #include "service/storage_proxy.hh" diff --git a/cql3/statements/create_function_statement.hh b/cql3/statements/create_function_statement.hh index 97399534be..d68c477fff 100644 --- a/cql3/statements/create_function_statement.hh +++ b/cql3/statements/create_function_statement.hh @@ -22,11 +22,18 @@ #pragma once #include "cql3/statements/function_statement.hh" -#include "cql3/functions/user_function.hh" +#include "cql3/cql3_type.hh" namespace cql3 { + class query_processor; + +namespace functions { + class user_function; +} + namespace statements { + class create_function_statement final : public create_function_statement_base { virtual std::unique_ptr prepare(database& db, cql_stats& stats) override; virtual future> announce_migration( diff --git a/cql3/statements/create_index_statement.cc b/cql3/statements/create_index_statement.cc index df77cd83b0..a36b8e2b3b 100644 --- a/cql3/statements/create_index_statement.cc +++ b/cql3/statements/create_index_statement.cc @@ -51,6 +51,8 @@ #include "index/target_parser.hh" #include "gms/feature_service.hh" #include "cql3/query_processor.hh" +#include "cql3/index_name.hh" +#include "cql3/statements/index_prop_defs.hh" #include #include diff --git a/cql3/statements/create_index_statement.hh b/cql3/statements/create_index_statement.hh index aa41b0e14c..0f9e6ef174 100644 --- a/cql3/statements/create_index_statement.hh +++ b/cql3/statements/create_index_statement.hh @@ -42,15 +42,9 @@ #pragma once #include "schema_altering_statement.hh" -#include "index_prop_defs.hh" #include "index_target.hh" -#include "raw/cf_statement.hh" -#include "cql3/index_name.hh" -#include "cql3/cql3_type.hh" - -#include "service/migration_manager.hh" -#include "schema.hh" +#include "schema_fwd.hh" #include @@ -63,9 +57,12 @@ namespace cql3 { class query_processor; +class index_name; namespace statements { +class index_prop_defs; + /** A CREATE INDEX statement parsed from a CQL query. */ class create_index_statement : public schema_altering_statement { const sstring _index_name; diff --git a/cql3/statements/create_keyspace_statement.cc b/cql3/statements/create_keyspace_statement.cc index 2ed5b7292d..0bd746a776 100644 --- a/cql3/statements/create_keyspace_statement.cc +++ b/cql3/statements/create_keyspace_statement.cc @@ -40,6 +40,7 @@ */ #include "cql3/statements/create_keyspace_statement.hh" +#include "cql3/statements/ks_prop_defs.hh" #include "prepared_statement.hh" #include "database.hh" #include "service/migration_manager.hh" diff --git a/cql3/statements/create_keyspace_statement.hh b/cql3/statements/create_keyspace_statement.hh index 4c8d9e7ee3..c171d70e6d 100644 --- a/cql3/statements/create_keyspace_statement.hh +++ b/cql3/statements/create_keyspace_statement.hh @@ -42,7 +42,6 @@ #pragma once #include "cql3/statements/schema_altering_statement.hh" -#include "cql3/statements/ks_prop_defs.hh" #include "transport/event.hh" #include "log.hh" @@ -54,6 +53,8 @@ class query_processor; namespace statements { +class ks_prop_defs; + /** A CREATE KEYSPACE statement parsed from a CQL query. */ class create_keyspace_statement : public schema_altering_statement { private: diff --git a/cql3/statements/create_service_level_statement.cc b/cql3/statements/create_service_level_statement.cc index c1b3ce1f93..0508c0031c 100644 --- a/cql3/statements/create_service_level_statement.cc +++ b/cql3/statements/create_service_level_statement.cc @@ -23,6 +23,8 @@ #include "cql3/statements/create_service_level_statement.hh" #include "service/qos/service_level_controller.hh" #include "transport/messages/result_message.hh" +#include "service/client_state.hh" +#include "service/query_state.hh" namespace cql3 { diff --git a/cql3/statements/create_table_statement.cc b/cql3/statements/create_table_statement.cc index 2056573563..4758c8b4eb 100644 --- a/cql3/statements/create_table_statement.cc +++ b/cql3/statements/create_table_statement.cc @@ -57,6 +57,7 @@ #include "database.hh" #include "types/user.hh" #include "gms/feature_service.hh" +#include "service/migration_manager.hh" namespace cql3 { diff --git a/cql3/statements/create_table_statement.hh b/cql3/statements/create_table_statement.hh index 4a05523bac..c0cf9628ef 100644 --- a/cql3/statements/create_table_statement.hh +++ b/cql3/statements/create_table_statement.hh @@ -42,12 +42,10 @@ #pragma once #include "cql3/statements/schema_altering_statement.hh" -#include "cql3/statements/cf_prop_defs.hh" #include "cql3/statements/cf_properties.hh" #include "cql3/statements/raw/cf_statement.hh" #include "cql3/cql3_type.hh" -#include "service/migration_manager.hh" #include "schema_fwd.hh" #include @@ -62,6 +60,7 @@ namespace cql3 { class query_processor; +class cf_prop_defs; namespace statements { diff --git a/cql3/statements/create_type_statement.hh b/cql3/statements/create_type_statement.hh index ca37e4b8db..7c2667a459 100644 --- a/cql3/statements/create_type_statement.hh +++ b/cql3/statements/create_type_statement.hh @@ -42,6 +42,7 @@ #include "cql3/statements/schema_altering_statement.hh" #include "cql3/cql3_type.hh" #include "cql3/ut_name.hh" +#include "database_fwd.hh" namespace cql3 { diff --git a/cql3/statements/create_view_statement.cc b/cql3/statements/create_view_statement.cc index 63e24c339e..19d9b12c25 100644 --- a/cql3/statements/create_view_statement.cc +++ b/cql3/statements/create_view_statement.cc @@ -66,6 +66,7 @@ #include "database.hh" #include "gms/feature_service.hh" #include "db/view/view.hh" +#include "service/migration_manager.hh" namespace cql3 { diff --git a/cql3/statements/create_view_statement.hh b/cql3/statements/create_view_statement.hh index de59dfb582..9925492d24 100644 --- a/cql3/statements/create_view_statement.hh +++ b/cql3/statements/create_view_statement.hh @@ -20,16 +20,9 @@ #pragma once #include "cql3/statements/schema_altering_statement.hh" -#include "cql3/statements/cf_prop_defs.hh" #include "cql3/statements/cf_properties.hh" -#include "cql3/cql3_type.hh" -#include "cql3/selection/raw_selector.hh" -#include "cql3/relation.hh" #include "cql3/cf_name.hh" -#include "service/migration_manager.hh" -#include "schema.hh" - #include #include @@ -39,6 +32,11 @@ namespace cql3 { class query_processor; +class relation; + +namespace selection { + class raw_selector; +} // namespace selection namespace statements { diff --git a/cql3/statements/delete_statement.hh b/cql3/statements/delete_statement.hh index 9ba7f114ac..cc70ad5d9a 100644 --- a/cql3/statements/delete_statement.hh +++ b/cql3/statements/delete_statement.hh @@ -42,13 +42,12 @@ #pragma once #include "cql3/statements/modification_statement.hh" -#include "cql3/statements/raw/modification_statement.hh" -#include "cql3/attributes.hh" -#include "cql3/operation.hh" #include "database_fwd.hh" namespace cql3 { +class attributes; + namespace statements { /** diff --git a/cql3/statements/detach_service_level_statement.cc b/cql3/statements/detach_service_level_statement.cc index ded7766ff3..e0aa0c9f6f 100644 --- a/cql3/statements/detach_service_level_statement.cc +++ b/cql3/statements/detach_service_level_statement.cc @@ -23,6 +23,8 @@ #include "cql3/statements/detach_service_level_statement.hh" #include "service/qos/service_level_controller.hh" #include "transport/messages/result_message.hh" +#include "service/client_state.hh" +#include "service/query_state.hh" namespace cql3 { diff --git a/cql3/statements/drop_function_statement.cc b/cql3/statements/drop_function_statement.cc index dda8393ffa..13069fe32a 100644 --- a/cql3/statements/drop_function_statement.cc +++ b/cql3/statements/drop_function_statement.cc @@ -21,6 +21,7 @@ #include "cql3/statements/drop_function_statement.hh" #include "cql3/functions/functions.hh" +#include "cql3/functions/user_function.hh" #include "prepared_statement.hh" #include "service/migration_manager.hh" #include "cql3/query_processor.hh" diff --git a/cql3/statements/drop_index_statement.cc b/cql3/statements/drop_index_statement.cc index f3a2568117..6283ac2f62 100644 --- a/cql3/statements/drop_index_statement.cc +++ b/cql3/statements/drop_index_statement.cc @@ -47,6 +47,7 @@ #include "database.hh" #include "gms/feature_service.hh" #include "cql3/query_processor.hh" +#include "cql3/index_name.hh" namespace cql3 { diff --git a/cql3/statements/drop_index_statement.hh b/cql3/statements/drop_index_statement.hh index 2284280664..6f0c6174ce 100644 --- a/cql3/statements/drop_index_statement.hh +++ b/cql3/statements/drop_index_statement.hh @@ -42,16 +42,17 @@ #pragma once #include "cql3/statements/schema_altering_statement.hh" -#include "cql3/index_name.hh" -#include #include #include #include +#include "schema_fwd.hh" + namespace cql3 { class query_processor; +class index_name; namespace statements { diff --git a/cql3/statements/drop_service_level_statement.cc b/cql3/statements/drop_service_level_statement.cc index c64802d724..5c32842ca3 100644 --- a/cql3/statements/drop_service_level_statement.cc +++ b/cql3/statements/drop_service_level_statement.cc @@ -23,6 +23,8 @@ #include "cql3/statements/drop_service_level_statement.hh" #include "service/qos/service_level_controller.hh" #include "transport/messages/result_message.hh" +#include "service/client_state.hh" +#include "service/query_state.hh" namespace cql3 { diff --git a/cql3/statements/drop_table_statement.hh b/cql3/statements/drop_table_statement.hh index 7323129e52..95f93edfee 100644 --- a/cql3/statements/drop_table_statement.hh +++ b/cql3/statements/drop_table_statement.hh @@ -43,11 +43,10 @@ #include "cql3/statements/schema_altering_statement.hh" -#include "cql3/cf_name.hh" - namespace cql3 { class query_processor; +class cf_name; namespace statements { diff --git a/cql3/statements/drop_type_statement.hh b/cql3/statements/drop_type_statement.hh index 874b255fc1..15fb774d04 100644 --- a/cql3/statements/drop_type_statement.hh +++ b/cql3/statements/drop_type_statement.hh @@ -40,7 +40,6 @@ #pragma once #include "cql3/statements/schema_altering_statement.hh" -#include "cql3/cql3_type.hh" #include "cql3/ut_name.hh" namespace cql3 { diff --git a/cql3/statements/drop_view_statement.hh b/cql3/statements/drop_view_statement.hh index 5c73ca780a..23ad6d1823 100644 --- a/cql3/statements/drop_view_statement.hh +++ b/cql3/statements/drop_view_statement.hh @@ -44,13 +44,13 @@ #include #include "cql3/statements/schema_altering_statement.hh" -#include "cql3/cf_name.hh" #include "database_fwd.hh" namespace cql3 { class query_processor; +class cf_name; namespace statements { diff --git a/cql3/statements/function_statement.cc b/cql3/statements/function_statement.cc index f4684ab693..7154626286 100644 --- a/cql3/statements/function_statement.cc +++ b/cql3/statements/function_statement.cc @@ -21,6 +21,7 @@ #include "cql3/statements/function_statement.hh" #include "cql3/functions/functions.hh" +#include "cql3/functions/user_function.hh" #include "db/config.hh" #include "database.hh" #include "gms/feature_service.hh" diff --git a/cql3/statements/function_statement.hh b/cql3/statements/function_statement.hh index f83fefa4b2..9d39e36a4a 100644 --- a/cql3/statements/function_statement.hh +++ b/cql3/statements/function_statement.hh @@ -22,9 +22,15 @@ #pragma once #include "cql3/statements/schema_altering_statement.hh" -#include "cql3/functions/user_function.hh" +#include "cql3/functions/function_name.hh" +#include "cql3/cql3_type.hh" namespace cql3 { + +namespace functions { + class function; +} // namespace functions + namespace statements { class function_statement : public schema_altering_statement { diff --git a/cql3/statements/grant_statement.cc b/cql3/statements/grant_statement.cc index 50d7b5dd54..0ecdc89b5d 100644 --- a/cql3/statements/grant_statement.cc +++ b/cql3/statements/grant_statement.cc @@ -41,6 +41,8 @@ #include "grant_statement.hh" #include "auth/authorizer.hh" +#include "cql3/statements/prepared_statement.hh" +#include "service/query_state.hh" std::unique_ptr cql3::statements::grant_statement::prepare( database& db, cql_stats& stats) { diff --git a/cql3/statements/ks_prop_defs.cc b/cql3/statements/ks_prop_defs.cc index b747d9c7f8..e6562974b6 100644 --- a/cql3/statements/ks_prop_defs.cc +++ b/cql3/statements/ks_prop_defs.cc @@ -41,6 +41,7 @@ #include "cql3/statements/ks_prop_defs.hh" #include "database.hh" +#include "locator/token_metadata.hh" namespace cql3 { diff --git a/cql3/statements/ks_prop_defs.hh b/cql3/statements/ks_prop_defs.hh index f168f1d158..75eae8c8a5 100644 --- a/cql3/statements/ks_prop_defs.hh +++ b/cql3/statements/ks_prop_defs.hh @@ -42,7 +42,6 @@ #pragma once #include "cql3/statements/property_definitions.hh" -#include "locator/token_metadata.hh" #include #include @@ -50,6 +49,10 @@ class keyspace_metadata; +namespace locator { + class token_metadata; +} // namespace locator + namespace cql3 { namespace statements { diff --git a/cql3/statements/list_service_level_attachments_statement.cc b/cql3/statements/list_service_level_attachments_statement.cc index 7e64d04ec6..3313e53281 100644 --- a/cql3/statements/list_service_level_attachments_statement.cc +++ b/cql3/statements/list_service_level_attachments_statement.cc @@ -23,6 +23,8 @@ #include "cql3/statements/list_service_level_attachments_statement.hh" #include "service/qos/service_level_controller.hh" #include "transport/messages/result_message.hh" +#include "service/client_state.hh" +#include "service/query_state.hh" namespace cql3 { diff --git a/cql3/statements/list_service_level_statement.cc b/cql3/statements/list_service_level_statement.cc index 2bf0b4d804..7719384bc2 100644 --- a/cql3/statements/list_service_level_statement.cc +++ b/cql3/statements/list_service_level_statement.cc @@ -24,6 +24,8 @@ #include "service/qos/service_level_controller.hh" #include "transport/messages/result_message.hh" #include "utils/overloaded_functor.hh" +#include "service/client_state.hh" +#include "service/query_state.hh" namespace cql3 { diff --git a/cql3/statements/modification_statement.hh b/cql3/statements/modification_statement.hh index e1e4e2004f..87a69c0662 100644 --- a/cql3/statements/modification_statement.hh +++ b/cql3/statements/modification_statement.hh @@ -41,25 +41,16 @@ #pragma once -#include "cql3/restrictions/restriction.hh" -#include "cql3/statements/raw/cf_statement.hh" -#include "cql3/statements/bound.hh" +#include "cql3/stats.hh" #include "cql3/column_identifier.hh" #include "cql3/update_parameters.hh" #include "cql3/column_condition.hh" #include "cql3/cql_statement.hh" -#include "cql3/attributes.hh" -#include "cql3/operation.hh" #include "cql3/relation.hh" #include "cql3/restrictions/statement_restrictions.hh" -#include "cql3/single_column_relation.hh" #include "cql3/statements/statement_type.hh" #include -#include - -#include "unimplemented.hh" -#include "validation.hh" #include #include @@ -67,6 +58,8 @@ namespace cql3 { class query_processor; +class attributes; +class operation; namespace statements { diff --git a/cql3/statements/prepared_statement.hh b/cql3/statements/prepared_statement.hh index 7e93fcd9cd..fe28aea9b1 100644 --- a/cql3/statements/prepared_statement.hh +++ b/cql3/statements/prepared_statement.hh @@ -41,20 +41,20 @@ #pragma once -#include "cql3/variable_specifications.hh" -#include "cql3/column_specification.hh" -#include "cql3/column_identifier.hh" -#include "cql3/cql_statement.hh" - #include - #include #include #include #include +#include "exceptions/exceptions.hh" + namespace cql3 { +class variable_specifications; +class column_specification; +class cql_statement; + namespace statements { struct invalidated_prepared_usage_attempt { @@ -63,22 +63,22 @@ struct invalidated_prepared_usage_attempt { } }; -class prepared_statement : public weakly_referencable { +class prepared_statement : public seastar::weakly_referencable { public: - typedef seastar::checked_ptr> checked_weak_ptr; + typedef seastar::checked_ptr> checked_weak_ptr; public: - const ::shared_ptr statement; - const std::vector> bound_names; + const seastar::shared_ptr statement; + const std::vector> bound_names; std::vector partition_key_bind_indices; - prepared_statement(::shared_ptr statement_, std::vector> bound_names_, std::vector partition_key_bind_indices); + prepared_statement(seastar::shared_ptr statement_, std::vector> bound_names_, std::vector partition_key_bind_indices); - prepared_statement(::shared_ptr statement_, const variable_specifications& names, const std::vector& partition_key_bind_indices); + prepared_statement(seastar::shared_ptr statement_, const variable_specifications& names, const std::vector& partition_key_bind_indices); - prepared_statement(::shared_ptr statement_, variable_specifications&& names, std::vector&& partition_key_bind_indices); + prepared_statement(seastar::shared_ptr statement_, variable_specifications&& names, std::vector&& partition_key_bind_indices); - prepared_statement(::shared_ptr&& statement_); + prepared_statement(seastar::shared_ptr&& statement_); checked_weak_ptr checked_weak_from_this() { return checked_weak_ptr(this->weak_from_this()); diff --git a/cql3/statements/raw/batch_statement.hh b/cql3/statements/raw/batch_statement.hh index 59409e6472..688e76dc8f 100644 --- a/cql3/statements/raw/batch_statement.hh +++ b/cql3/statements/raw/batch_statement.hh @@ -36,22 +36,20 @@ * You should have received a copy of the GNU General Public License * along with Scylla. If not, see . */ - -#include "cql3/cql_statement.hh" -#include "modification_statement.hh" -#include "transport/messages/result_message.hh" -#include "timestamp.hh" -#include "log.hh" -#include "to_string.hh" - #pragma once +#include "cql3/statements/raw/cf_statement.hh" +#include "cql3/statements/raw/modification_statement.hh" +#include "service/client_state.hh" + namespace cql3 { namespace statements { namespace raw { +class modification_statement; + class batch_statement : public raw::cf_statement { public: enum class type { diff --git a/cql3/statements/raw/delete_statement.hh b/cql3/statements/raw/delete_statement.hh index b9d6d2928f..0d1e273985 100644 --- a/cql3/statements/raw/delete_statement.hh +++ b/cql3/statements/raw/delete_statement.hh @@ -41,7 +41,6 @@ #pragma once -#include "cql3/statements/modification_statement.hh" #include "cql3/statements/raw/modification_statement.hh" #include "cql3/attributes.hh" #include "cql3/operation.hh" @@ -49,8 +48,12 @@ namespace cql3 { +class relation; + namespace statements { +class modification_statement; + namespace raw { class delete_statement : public modification_statement { diff --git a/cql3/statements/raw/insert_statement.hh b/cql3/statements/raw/insert_statement.hh index 5413c92efd..5ec5d58b76 100644 --- a/cql3/statements/raw/insert_statement.hh +++ b/cql3/statements/raw/insert_statement.hh @@ -41,7 +41,6 @@ #pragma once -#include "cql3/statements/modification_statement.hh" #include "cql3/statements/raw/modification_statement.hh" #include "cql3/column_identifier.hh" #include "cql3/term.hh" @@ -49,12 +48,13 @@ #include "database_fwd.hh" #include -#include "unimplemented.hh" namespace cql3 { namespace statements { +class modification_statement; + namespace raw { class insert_statement : public raw::modification_statement { diff --git a/cql3/statements/raw/modification_statement.hh b/cql3/statements/raw/modification_statement.hh index de71cb7285..a4da08671a 100644 --- a/cql3/statements/raw/modification_statement.hh +++ b/cql3/statements/raw/modification_statement.hh @@ -41,21 +41,13 @@ #pragma once -#include "cql3/restrictions/restriction.hh" #include "cql3/statements/raw/cf_statement.hh" #include "cql3/column_identifier.hh" -#include "cql3/update_parameters.hh" #include "cql3/column_condition.hh" -#include "cql3/cql_statement.hh" #include "cql3/attributes.hh" -#include "cql3/operation.hh" -#include "cql3/relation.hh" #include -#include -#include "unimplemented.hh" -#include "validation.hh" #include diff --git a/cql3/statements/raw/parsed_statement.cc b/cql3/statements/raw/parsed_statement.cc index 7903617e10..dc58ef7811 100644 --- a/cql3/statements/raw/parsed_statement.cc +++ b/cql3/statements/raw/parsed_statement.cc @@ -42,6 +42,7 @@ #include "parsed_statement.hh" #include "cql3/statements/prepared_statement.hh" +#include "cql3/column_specification.hh" namespace cql3 { diff --git a/cql3/statements/raw/parsed_statement.hh b/cql3/statements/raw/parsed_statement.hh index ba4ae22550..3643a7e9ab 100644 --- a/cql3/statements/raw/parsed_statement.hh +++ b/cql3/statements/raw/parsed_statement.hh @@ -42,16 +42,20 @@ #pragma once #include "cql3/variable_specifications.hh" -#include "cql3/column_identifier.hh" -#include "cql3/stats.hh" +#include "cql3/column_specification.hh" #include #include #include +class database; + namespace cql3 { +class column_identifier; +class cql_stats; + namespace statements { class prepared_statement; diff --git a/cql3/statements/raw/select_statement.hh b/cql3/statements/raw/select_statement.hh index 12790c704d..9c6bcb0df1 100644 --- a/cql3/statements/raw/select_statement.hh +++ b/cql3/statements/raw/select_statement.hh @@ -43,20 +43,21 @@ #include "cql3/statements/raw/cf_statement.hh" #include "cql3/statements/prepared_statement.hh" -#include "cql3/cql_statement.hh" -#include "cql3/selection/selection.hh" -#include "cql3/selection/raw_selector.hh" -#include "cql3/restrictions/statement_restrictions.hh" -#include "cql3/result_set.hh" +#include "cql3/relation.hh" #include "cql3/attributes.hh" -#include "exceptions/unrecognized_entity_exception.hh" -#include "service/client_state.hh" #include -#include -#include "validation.hh" namespace cql3 { +namespace selection { + class selection; + class raw_selector; +} // namespace selection + +namespace restrictions { + class statement_restrictions; +} // namespace restrictions + namespace statements { namespace raw { diff --git a/cql3/statements/raw/update_statement.hh b/cql3/statements/raw/update_statement.hh index 1344d7a86d..d03aa055ef 100644 --- a/cql3/statements/raw/update_statement.hh +++ b/cql3/statements/raw/update_statement.hh @@ -41,21 +41,21 @@ #pragma once -#include "cql3/statements/modification_statement.hh" #include "cql3/statements/raw/modification_statement.hh" #include "cql3/column_identifier.hh" -#include "cql3/term.hh" +#include "cql3/operation.hh" +#include "cql3/relation.hh" #include "database_fwd.hh" #include -#include "unimplemented.hh" namespace cql3 { namespace statements { class update_statement; +class modification_statement; namespace raw { diff --git a/cql3/statements/raw/use_statement.hh b/cql3/statements/raw/use_statement.hh index 9398599852..4027f89d1c 100644 --- a/cql3/statements/raw/use_statement.hh +++ b/cql3/statements/raw/use_statement.hh @@ -43,6 +43,8 @@ #include "cql3/statements/raw/parsed_statement.hh" +#include + namespace cql3 { namespace statements { diff --git a/cql3/statements/revoke_statement.cc b/cql3/statements/revoke_statement.cc index f4f4ad685e..49e8bea1ee 100644 --- a/cql3/statements/revoke_statement.cc +++ b/cql3/statements/revoke_statement.cc @@ -41,6 +41,8 @@ #include "revoke_statement.hh" #include "auth/authorizer.hh" +#include "cql3/statements/prepared_statement.hh" +#include "service/query_state.hh" std::unique_ptr cql3::statements::revoke_statement::prepare( database& db, cql_stats& stats) { diff --git a/cql3/statements/select_statement.cc b/cql3/statements/select_statement.cc index b83309f83b..15d6ac0e3b 100644 --- a/cql3/statements/select_statement.cc +++ b/cql3/statements/select_statement.cc @@ -47,7 +47,10 @@ #include "cql3/selection/selection.hh" #include "cql3/util.hh" #include "cql3/restrictions/single_column_primary_key_restrictions.hh" +#include "cql3/restrictions/statement_restrictions.hh" #include "cql3/selection/selector_factories.hh" +#include "validation.hh" +#include "exceptions/unrecognized_entity_exception.hh" #include #include "query-result-reader.hh" #include "query_result_merger.hh" diff --git a/cql3/statements/select_statement.hh b/cql3/statements/select_statement.hh index d254fb6cf3..cdf212d9ee 100644 --- a/cql3/statements/select_statement.hh +++ b/cql3/statements/select_statement.hh @@ -41,24 +41,30 @@ #pragma once -#include "cql3/statements/raw/cf_statement.hh" #include "cql3/statements/raw/select_statement.hh" #include "cql3/cql_statement.hh" -#include "cql3/selection/selection.hh" -#include "cql3/selection/raw_selector.hh" -#include "cql3/restrictions/statement_restrictions.hh" -#include "cql3/result_set.hh" -#include "exceptions/unrecognized_entity_exception.hh" -#include "service/client_state.hh" +#include "cql3/stats.hh" #include -#include -#include "validation.hh" #include "transport/messages/result_message.hh" +#include "index/secondary_index_manager.hh" + +namespace service { + class client_state; +} // namespace service namespace cql3 { class query_processor; +namespace selection { + class selection; +} // namespace selection + +namespace restrictions { + class restrictions; + class statement_restrictions; +} // namespace restrictions + namespace statements { /** diff --git a/cql3/statements/update_statement.cc b/cql3/statements/update_statement.cc index bdd9606c39..ea2de9b4e9 100644 --- a/cql3/statements/update_statement.cc +++ b/cql3/statements/update_statement.cc @@ -47,6 +47,7 @@ #include "cql3/operation_impl.hh" #include "cql3/type_json.hh" +#include "cql3/single_column_relation.hh" #include "types/map.hh" #include "types/set.hh" #include "types/list.hh" diff --git a/cql3/statements/update_statement.hh b/cql3/statements/update_statement.hh index c4688c713e..b6d38d3291 100644 --- a/cql3/statements/update_statement.hh +++ b/cql3/statements/update_statement.hh @@ -42,12 +42,14 @@ #pragma once #include "cql3/statements/modification_statement.hh" -#include "cql3/term.hh" +#include "cql3/attributes.hh" #include "database_fwd.hh" namespace cql3 { +class term; + namespace statements { /** diff --git a/cql3/statements/use_statement.cc b/cql3/statements/use_statement.cc index cc3a7bf417..3bac447228 100644 --- a/cql3/statements/use_statement.cc +++ b/cql3/statements/use_statement.cc @@ -43,6 +43,7 @@ #include "cql3/statements/raw/use_statement.hh" #include "cql3/query_processor.hh" #include "transport/messages/result_message.hh" +#include "service/query_state.hh" namespace cql3 { diff --git a/cql3/statements/use_statement.hh b/cql3/statements/use_statement.hh index 8480297f10..3426bd6ef2 100644 --- a/cql3/statements/use_statement.hh +++ b/cql3/statements/use_statement.hh @@ -52,22 +52,22 @@ namespace statements { class use_statement : public cql_statement_no_metadata { private: - const sstring _keyspace; + const seastar::sstring _keyspace; public: - use_statement(sstring keyspace); + use_statement(seastar::sstring keyspace); virtual uint32_t get_bound_terms() const override; - virtual bool depends_on_keyspace(const sstring& ks_name) const override; + virtual bool depends_on_keyspace(const seastar::sstring& ks_name) const override; - virtual bool depends_on_column_family(const sstring& cf_name) const override; + virtual bool depends_on_column_family(const seastar::sstring& cf_name) const override; - virtual future<> check_access(service::storage_proxy& proxy, const service::client_state& state) const override; + virtual seastar::future<> check_access(service::storage_proxy& proxy, const service::client_state& state) const override; virtual void validate(service::storage_proxy&, const service::client_state& state) const override; - virtual future<::shared_ptr> + virtual seastar::future> execute(query_processor& qp, service::query_state& state, const query_options& options) const override; }; diff --git a/cql3/term.hh b/cql3/term.hh index d02cab739d..145da86f15 100644 --- a/cql3/term.hh +++ b/cql3/term.hh @@ -41,16 +41,14 @@ #pragma once -#include -#include "variable_specifications.hh" #include "cql3/assignment_testable.hh" #include "cql3/query_options.hh" #include "cql3/values.hh" -#include "types.hh" namespace cql3 { class terminal; +class variable_specifications; /** * A CQL3 term, i.e. a column value with or without bind variables. diff --git a/cql3/tuples.hh b/cql3/tuples.hh index d0723c9cdc..4ef78d6029 100644 --- a/cql3/tuples.hh +++ b/cql3/tuples.hh @@ -44,6 +44,7 @@ #include "types/tuple.hh" #include "types/collection.hh" #include "utils/chunked_vector.hh" +#include "cql3/column_identifier.hh" class list_type_impl; diff --git a/cql3/type_cast.hh b/cql3/type_cast.hh index cdeb20bd3a..668df410cc 100644 --- a/cql3/type_cast.hh +++ b/cql3/type_cast.hh @@ -41,6 +41,7 @@ #include "term.hh" #include "cql3_type.hh" +#include "cql3/column_identifier.hh" namespace cql3 { diff --git a/db/commitlog/commitlog_extensions.hh b/db/commitlog/commitlog_extensions.hh index fa45897638..355588302b 100644 --- a/db/commitlog/commitlog_extensions.hh +++ b/db/commitlog/commitlog_extensions.hh @@ -25,14 +25,13 @@ #include #include -#include "commitlog.hh" - namespace db { class commitlog_file_extension { public: virtual ~commitlog_file_extension() {} - virtual future wrap_file(const sstring& filename, file, open_flags flags) = 0; - virtual future<> before_delete(const sstring& filename) = 0; + virtual seastar::future wrap_file(const seastar::sstring& filename, + seastar::file, seastar::open_flags flags) = 0; + virtual seastar::future<> before_delete(const seastar::sstring& filename) = 0; }; } diff --git a/db/commitlog/commitlog_replayer.cc b/db/commitlog/commitlog_replayer.cc index 8a51cde3bc..145c144114 100644 --- a/db/commitlog/commitlog_replayer.cc +++ b/db/commitlog/commitlog_replayer.cc @@ -61,6 +61,7 @@ #include "db/extensions.hh" #include "utils/fragmented_temporary_buffer.hh" #include "validation.hh" +#include "mutation_partition_view.hh" static logging::logger rlogger("commitlog_replayer"); diff --git a/db/consistency_level.hh b/db/consistency_level.hh index a8a1b16c7e..009c2a5e37 100644 --- a/db/consistency_level.hh +++ b/db/consistency_level.hh @@ -44,7 +44,6 @@ #include "db/consistency_level_type.hh" #include "db/read_repair_decision.hh" #include "exceptions/exceptions.hh" -#include "utils/fb_utilities.hh" #include "gms/inet_address.hh" #include "inet_address_vectors.hh" #include "log.hh" diff --git a/db/data_listeners.hh b/db/data_listeners.hh index 8b1841cf4d..450950633d 100755 --- a/db/data_listeners.hh +++ b/db/data_listeners.hh @@ -30,13 +30,14 @@ #include "schema_fwd.hh" #include "flat_mutation_reader.hh" #include "mutation_reader.hh" -#include "frozen_mutation.hh" #include "utils/top_k.hh" #include "schema_registry.hh" #include #include +class frozen_mutation; + namespace db { class data_listener { diff --git a/db/hints/host_filter.hh b/db/hints/host_filter.hh index f15fdfa5e1..a236d2e20b 100644 --- a/db/hints/host_filter.hh +++ b/db/hints/host_filter.hh @@ -21,17 +21,19 @@ #pragma once -#include #include -#include -#include +#include +#include #include #include -#include "gms/inet_address.hh" #include "locator/snitch_base.hh" #include "seastarx.hh" +namespace gms { + class inet_address; +} // namespace gms + namespace db { namespace hints { diff --git a/db/hints/manager.cc b/db/hints/manager.cc index efe90d15dd..683f872b3a 100644 --- a/db/hints/manager.cc +++ b/db/hints/manager.cc @@ -42,6 +42,7 @@ #include "utils/directories.hh" #include "utils/UUID_gen.hh" #include "locator/abstract_replication_strategy.hh" +#include "mutation_partition_view.hh" using namespace std::literals::chrono_literals; diff --git a/db/hints/manager.hh b/db/hints/manager.hh index b0d715ff49..05ed049545 100644 --- a/db/hints/manager.hh +++ b/db/hints/manager.hh @@ -33,17 +33,17 @@ #include #include #include -#include "lister.hh" #include "gms/gossiper.hh" #include "locator/snitch_base.hh" #include "inet_address_vectors.hh" #include "service/endpoint_lifecycle_subscriber.hh" #include "db/commitlog/commitlog.hh" #include "utils/loading_shared_values.hh" -#include "utils/fragmented_temporary_buffer.hh" #include "db/hints/resource_manager.hh" #include "db/hints/host_filter.hh" +class fragmented_temporary_buffer; + namespace service { class storage_service; } diff --git a/db/hints/resource_manager.hh b/db/hints/resource_manager.hh index 239dfe869a..ff02be828e 100644 --- a/db/hints/resource_manager.hh +++ b/db/hints/resource_manager.hh @@ -29,7 +29,6 @@ #include #include "seastarx.hh" #include -#include "gms/gossiper.hh" #include "utils/small_vector.hh" #include "lister.hh" #include "enum_set.hh" @@ -39,6 +38,11 @@ class storage_proxy; class storage_service; } +namespace gms { + class gossiper; + class inet_address; +} // namespace gms + namespace db { namespace hints { diff --git a/db/system_distributed_keyspace.cc b/db/system_distributed_keyspace.cc index 218b3f78d0..2769dba770 100644 --- a/db/system_distributed_keyspace.cc +++ b/db/system_distributed_keyspace.cc @@ -33,6 +33,7 @@ #include "cdc/generation.hh" #include "cql3/query_processor.hh" #include "service/storage_proxy.hh" +#include "service/migration_manager.hh" #include #include diff --git a/db/system_distributed_keyspace.hh b/db/system_distributed_keyspace.hh index 973d14efd1..da074d46db 100644 --- a/db/system_distributed_keyspace.hh +++ b/db/system_distributed_keyspace.hh @@ -23,7 +23,6 @@ #include "bytes.hh" #include "schema_fwd.hh" -#include "service/migration_manager.hh" #include "service/qos/qos_common.hh" #include "utils/UUID.hh" #include "cdc/generation_id.hh" @@ -45,6 +44,7 @@ namespace cdc { namespace service { class storage_proxy; + class migration_manager; } namespace db { diff --git a/db/system_keyspace.cc b/db/system_keyspace.cc index 996ecc913b..5993d5662f 100644 --- a/db/system_keyspace.cc +++ b/db/system_keyspace.cc @@ -84,6 +84,7 @@ #include "db/virtual_table.hh" #include "service/storage_service.hh" #include "gms/gossiper.hh" +#include "service/paxos/paxos_state.hh" #include "idl/frozen_mutation.dist.hh" #include "serializer_impl.hh" diff --git a/db/system_keyspace.hh b/db/system_keyspace.hh index a7c4cbac12..247af0774a 100644 --- a/db/system_keyspace.hh +++ b/db/system_keyspace.hh @@ -48,13 +48,11 @@ #include "utils/UUID.hh" #include "gms/inet_address.hh" #include "query-result-set.hh" -#include "locator/token_metadata.hh" #include "db_clock.hh" #include "db/commitlog/replay_position.hh" #include "mutation_query.hh" #include #include -#include "service/paxos/paxos_state.hh" #include "cdc/generation_id.hh" namespace service { @@ -62,6 +60,11 @@ namespace service { class storage_proxy; class storage_service; +namespace paxos { + class paxos_state; + class proposal; +} // namespace service::paxos + } namespace netw { @@ -77,6 +80,10 @@ namespace gms { class feature_service; } +namespace locator { + class endpoint_dc_rack; +} // namespace locator + bool is_system_keyspace(std::string_view ks_name); namespace db { diff --git a/db/view/row_locking.cc b/db/view/row_locking.cc index f46c8a46c7..155f04d2dd 100644 --- a/db/view/row_locking.cc +++ b/db/view/row_locking.cc @@ -21,6 +21,7 @@ #include "row_locking.hh" #include "log.hh" +#include "utils/latency.hh" #include diff --git a/db/view/row_locking.hh b/db/view/row_locking.hh index 8b6733dacc..33b681e84c 100644 --- a/db/view/row_locking.hh +++ b/db/view/row_locking.hh @@ -43,8 +43,6 @@ #include "dht/i_partitioner.hh" #include "query-request.hh" #include "utils/estimated_histogram.hh" -#include "utils/histogram.hh" -#include "utils/latency.hh" class row_locker { public: diff --git a/db/view/view.cc b/db/view/view.cc index 166cf95d8a..b34ce9d5e9 100644 --- a/db/view/view.cc +++ b/db/view/view.cc @@ -59,6 +59,7 @@ #include "clustering_bounds_comparator.hh" #include "cql3/statements/select_statement.hh" #include "cql3/util.hh" +#include "cql3/restrictions/statement_restrictions.hh" #include "db/view/view.hh" #include "db/view/view_builder.hh" #include "db/view/view_updating_consumer.hh" @@ -80,6 +81,7 @@ #include "types/list.hh" #include "types/map.hh" #include "utils/error_injection.hh" +#include "utils/exponential_backoff_retry.hh" using namespace std::chrono_literals; diff --git a/db/view/view.hh b/db/view/view.hh index b4d47b3d2e..88aba876df 100644 --- a/db/view/view.hh +++ b/db/view/view.hh @@ -21,16 +21,12 @@ #pragma once -#include "view_stats.hh" #include "dht/i_partitioner.hh" #include "gc_clock.hh" #include "query-request.hh" #include "schema_fwd.hh" -#include "mutation_fragment.hh" #include "flat_mutation_reader.hh" -#include - class frozen_mutation_and_schema; struct cf_stats; @@ -43,6 +39,8 @@ namespace db { namespace view { +class stats; + // Part of the view description which depends on the base schema version. // // This structure may change even though the view schema doesn't change, so diff --git a/db/view/view_builder.hh b/db/view/view_builder.hh index 501a53ccd1..dd4f6721b6 100644 --- a/db/view/view_builder.hh +++ b/db/view/view_builder.hh @@ -22,11 +22,8 @@ #pragma once #include "dht/i_partitioner.hh" -#include "keys.hh" #include "query-request.hh" #include "service/migration_listener.hh" -#include "service/migration_manager.hh" -#include "utils/exponential_backoff_retry.hh" #include "utils/serialized_action.hh" #include "utils/UUID.hh" #include "database.hh" @@ -56,7 +53,12 @@ class view_build_progress; } +namespace service { + class migration_manager; +} // namespace service + class database; +class exponential_backoff_retry; namespace db::view { diff --git a/db/view/view_update_generator.cc b/db/view/view_update_generator.cc index 471a355944..d6c8924d01 100644 --- a/db/view/view_update_generator.cc +++ b/db/view/view_update_generator.cc @@ -23,6 +23,7 @@ #include "view_update_generator.hh" #include "service/priority_manager.hh" #include "utils/error_injection.hh" +#include "db/view/view_updating_consumer.hh" static logging::logger vug_logger("view_update_generator"); diff --git a/db/view/view_update_generator.hh b/db/view/view_update_generator.hh index 6a8537276e..8b9826cccc 100644 --- a/db/view/view_update_generator.hh +++ b/db/view/view_update_generator.hh @@ -22,8 +22,7 @@ #pragma once #include "database.hh" -#include "sstables/sstables.hh" -#include "db/view/view_updating_consumer.hh" +#include "sstables/shared_sstable.hh" #include #include diff --git a/flat_mutation_reader.cc b/flat_mutation_reader.cc index fbcd36a6b1..f0e9baa7e0 100644 --- a/flat_mutation_reader.cc +++ b/flat_mutation_reader.cc @@ -33,6 +33,8 @@ #include "utils/exceptions.hh" #include +#include "clustering_key_filter.hh" + logging::logger fmr_logger("flat_mutation_reader"); flat_mutation_reader& flat_mutation_reader::operator=(flat_mutation_reader&& o) noexcept { diff --git a/flat_mutation_reader.hh b/flat_mutation_reader.hh index ac91677365..c8718e4b93 100644 --- a/flat_mutation_reader.hh +++ b/flat_mutation_reader.hh @@ -25,11 +25,9 @@ #include #include "dht/i_partitioner.hh" -#include "position_in_partition.hh" #include "mutation_fragment.hh" #include "tracing/trace_state.hh" #include "mutation.hh" -#include "query_class_config.hh" #include "mutation_consumer_concepts.hh" #include @@ -42,6 +40,7 @@ using seastar::future; class mutation_source; +class position_in_partition; /* * Allows iteration on mutations using mutation_fragments. diff --git a/frozen_mutation.cc b/frozen_mutation.cc index 5914ed0c3b..6022ac29bb 100644 --- a/frozen_mutation.cc +++ b/frozen_mutation.cc @@ -42,6 +42,7 @@ #include "idl/mutation.dist.impl.hh" #include "flat_mutation_reader.hh" #include "converting_mutation_partition_applier.hh" +#include "mutation_partition_view.hh" // // Representation layout: diff --git a/hashing_partition_visitor.hh b/hashing_partition_visitor.hh index 65c27bf949..36ae106f08 100644 --- a/hashing_partition_visitor.hh +++ b/hashing_partition_visitor.hh @@ -27,6 +27,7 @@ #include "atomic_cell_hash.hh" #include "keys.hh" #include "counters.hh" +#include "position_in_partition.hh" // Calculates a hash of a mutation_partition which is consistent with // mutation equality. For any equal mutations, no matter which schema diff --git a/memtable-sstable.hh b/memtable-sstable.hh index 5ba8f8c4d7..8a89ac07d5 100644 --- a/memtable-sstable.hh +++ b/memtable-sstable.hh @@ -25,34 +25,34 @@ #pragma once -#include "memtable.hh" #include "sstables/shared_sstable.hh" -#include "sstables/progress_monitor.hh" #include -#include -#include -#include +#include + +class memtable; +class flat_mutation_reader; namespace sstables { class sstables_manager; class sstable_writer_config; +class write_monitor; } -future<> +seastar::future<> write_memtable_to_sstable(flat_mutation_reader reader, memtable& mt, sstables::shared_sstable sst, sstables::write_monitor& monitor, sstables::sstable_writer_config& cfg, - const io_priority_class& pc); + const seastar::io_priority_class& pc); -future<> +seastar::future<> write_memtable_to_sstable(memtable& mt, sstables::shared_sstable sst, sstables::write_monitor& mon, sstables::sstable_writer_config& cfg, - const io_priority_class& pc = default_priority_class()); + const seastar::io_priority_class& pc = seastar::default_priority_class()); -future<> +seastar::future<> write_memtable_to_sstable(memtable& mt, sstables::shared_sstable sst, sstables::sstable_writer_config cfg); diff --git a/memtable.cc b/memtable.cc index 4bef550961..90f53c8e74 100644 --- a/memtable.cc +++ b/memtable.cc @@ -26,6 +26,7 @@ #include "frozen_mutation.hh" #include "partition_snapshot_reader.hh" #include "partition_builder.hh" +#include "mutation_partition_view.hh" namespace { diff --git a/multishard_mutation_query.hh b/multishard_mutation_query.hh index e92ac6225d..47256a35a7 100644 --- a/multishard_mutation_query.hh +++ b/multishard_mutation_query.hh @@ -23,11 +23,28 @@ #include "database_fwd.hh" #include "schema_fwd.hh" -#include "mutation_query.hh" #include "cache_temperature.hh" +#include "db/timeout_clock.hh" +#include "dht/i_partitioner.hh" #include +#include "seastarx.hh" + +class reconcilable_result; + +namespace query { + +class read_command; +class result; +class result_options; + +} // namespace query + +namespace tracing { + class trace_state_ptr; +} // namespace tracing + /// Run the mutation query on all shards. /// /// Under the hood it uses a multishard_combining_reader for reading the diff --git a/mutation_partition.cc b/mutation_partition.cc index 59ddaf7045..df8824e72e 100644 --- a/mutation_partition.cc +++ b/mutation_partition.cc @@ -40,6 +40,8 @@ #include "types/map.hh" #include "compaction_garbage_collector.hh" #include "utils/exceptions.hh" +#include "clustering_key_filter.hh" +#include "mutation_partition_view.hh" logging::logger mplog("mutation_partition"); diff --git a/mutation_partition.hh b/mutation_partition.hh index d46bb36356..23626ff535 100644 --- a/mutation_partition.hh +++ b/mutation_partition.hh @@ -37,18 +37,20 @@ #include "position_in_partition.hh" #include "atomic_cell_or_collection.hh" #include "query-result.hh" -#include "mutation_partition_view.hh" -#include "mutation_partition_visitor.hh" -#include "utils/managed_vector.hh" #include "hashing_partition_visitor.hh" #include "range_tombstone_list.hh" -#include "clustering_key_filter.hh" #include "utils/intrusive_btree.hh" #include "utils/preempt.hh" #include "utils/managed_ref.hh" #include "utils/compact-radix-tree.hh" class mutation_fragment; +class mutation_partition_view; +class mutation_partition_visitor; + +namespace query { + class clustering_key_filter_ranges; +} // namespace query struct cell_hash { using size_type = uint64_t; diff --git a/mutation_partition_serializer.hh b/mutation_partition_serializer.hh index c527df9a9b..bc13482543 100644 --- a/mutation_partition_serializer.hh +++ b/mutation_partition_serializer.hh @@ -21,9 +21,7 @@ #pragma once -#include "utils/data_input.hh" #include "database_fwd.hh" -#include "mutation_partition_view.hh" #include "bytes_ostream.hh" #include "mutation_fragment.hh" diff --git a/mutation_partition_view.hh b/mutation_partition_view.hh index 715d05bc55..82da1559e9 100644 --- a/mutation_partition_view.hh +++ b/mutation_partition_view.hh @@ -24,6 +24,7 @@ #include "database_fwd.hh" #include "mutation_partition_visitor.hh" #include "utils/input_stream.hh" +#include "atomic_cell.hh" namespace ser { class mutation_partition_view; diff --git a/mutation_partition_visitor.hh b/mutation_partition_visitor.hh index 5b1001effd..d34c12d221 100644 --- a/mutation_partition_visitor.hh +++ b/mutation_partition_visitor.hh @@ -21,27 +21,30 @@ #pragma once -#include "atomic_cell.hh" -#include "collection_mutation.hh" -#include "tombstone.hh" -#include "range_tombstone.hh" -#include "keys.hh" +#include +#include "schema_fwd.hh" + +class atomic_cell_view; +class collection_mutation_view; class row_marker; class row_tombstone; +class range_tombstone; +class tombstone; +class position_in_partition_view; // When used on an entry, marks the range between this entry and the previous // one as continuous or discontinuous, excluding the keys of both entries. // This information doesn't apply to continuity of the entries themselves, // that is specified by is_dummy flag. // See class doc of mutation_partition. -using is_continuous = bool_class; +using is_continuous = seastar::bool_class; // Dummy entry is an entry which is incomplete. // Typically used for marking bounds of continuity range. // See class doc of mutation_partition. class dummy_tag {}; -using is_dummy = bool_class; +using is_dummy = seastar::bool_class; // Guarantees: // diff --git a/mutation_query.hh b/mutation_query.hh index 76a01d8fa2..75fe36a12c 100644 --- a/mutation_query.hh +++ b/mutation_query.hh @@ -23,16 +23,14 @@ #include "query-request.hh" #include "query-result.hh" -#include "mutation_reader.hh" #include "frozen_mutation.hh" #include "db/timeout_clock.hh" -#include "querier.hh" +#include "mutation.hh" #include "utils/chunked_vector.hh" -#include "query_class_config.hh" -#include class reconcilable_result; class frozen_reconcilable_result; +class mutation_source; // Can be read by other cores after publishing. struct partition { diff --git a/mutation_reader.hh b/mutation_reader.hh index 9bcb79cf2c..e0f4da51a7 100644 --- a/mutation_reader.hh +++ b/mutation_reader.hh @@ -23,7 +23,6 @@ #include -#include "clustering_key_filter.hh" #include #include #include diff --git a/partition_builder.hh b/partition_builder.hh index a325b74c28..b4c7683604 100644 --- a/partition_builder.hh +++ b/partition_builder.hh @@ -21,8 +21,13 @@ #pragma once +#include "schema.hh" #include "mutation_partition.hh" -#include "mutation_partition_view.hh" +#include "mutation_partition_visitor.hh" +#include "tombstone.hh" +#include "atomic_cell.hh" +#include "range_tombstone.hh" +#include "collection_mutation.hh" // Partition visitor which builds mutation_partition corresponding to the data its fed with. class partition_builder final : public mutation_partition_visitor { diff --git a/partition_snapshot_reader.hh b/partition_snapshot_reader.hh index 0d7044b0d1..9d31777c35 100644 --- a/partition_snapshot_reader.hh +++ b/partition_snapshot_reader.hh @@ -23,6 +23,7 @@ #include "partition_version.hh" #include "flat_mutation_reader.hh" +#include "clustering_key_filter.hh" #include struct partition_snapshot_reader_dummy_accounter { diff --git a/partition_version.hh b/partition_version.hh index 30cc3a7dce..d565215753 100644 --- a/partition_version.hh +++ b/partition_version.hh @@ -22,7 +22,6 @@ #pragma once #include "mutation_partition.hh" -#include "mutation_fragment.hh" #include "utils/anchorless_list.hh" #include "utils/logalloc.hh" #include "utils/coroutine.hh" @@ -31,6 +30,8 @@ #include #include +class static_row; + // This is MVCC implementation for mutation_partitions. // // It is assumed that mutation_partitions are stored in some sort of LSA-managed diff --git a/query-result-reader.hh b/query-result-reader.hh index bfcc1b88e3..52bfa9a97d 100644 --- a/query-result-reader.hh +++ b/query-result-reader.hh @@ -24,9 +24,7 @@ #include #include -#include "query-request.hh" #include "query-result.hh" -#include "utils/data_input.hh" #include "digest_algorithm.hh" #include "idl/uuid.dist.hh" diff --git a/query-result-set.hh b/query-result-set.hh index 93ed8e811a..7aa166f3fd 100644 --- a/query-result-set.hh +++ b/query-result-set.hh @@ -23,9 +23,8 @@ #include -#include "query-request.hh" -#include "query-result.hh" -#include "schema_fwd.hh" +#include "types.hh" +#include "schema.hh" #include #include @@ -34,6 +33,8 @@ class mutation; namespace query { +class result; + class no_value : public std::runtime_error { public: using runtime_error::runtime_error; diff --git a/range_tombstone_list.hh b/range_tombstone_list.hh index 26fb5e973d..42c3efebd2 100644 --- a/range_tombstone_list.hh +++ b/range_tombstone_list.hh @@ -24,11 +24,12 @@ #include #include "range_tombstone.hh" #include "query-request.hh" -#include "position_in_partition.hh" #include "utils/preempt.hh" #include #include +class position_in_partition_view; + class range_tombstone_list final { using range_tombstones_type = range_tombstone::container_type; class insert_undo_op { diff --git a/reader_permit.hh b/reader_permit.hh index 6db634bc22..f7e8240955 100644 --- a/reader_permit.hh +++ b/reader_permit.hh @@ -21,13 +21,15 @@ #pragma once -#include -#include #include "seastarx.hh" #include "db/timeout_clock.hh" #include "schema_fwd.hh" +namespace seastar { + class file; +} // namespace seastar + struct reader_resources { int count = 0; ssize_t memory = 0; diff --git a/release.cc b/release.cc index 6530f6c34c..7f1d885248 100644 --- a/release.cc +++ b/release.cc @@ -29,12 +29,12 @@ static const char scylla_build_mode_str[] = SCYLLA_BUILD_MODE; std::string scylla_version() { - return format("{}-{}", scylla_version_str, scylla_release_str); + return seastar::format("{}-{}", scylla_version_str, scylla_release_str); } std::string scylla_build_mode() { - return format("{}", scylla_build_mode_str); + return seastar::format("{}", scylla_build_mode_str); } // get the version number into writeable memory, so we can grep for it if we get a core dump diff --git a/row_cache.hh b/row_cache.hh index c692ffd848..20afc3a365 100644 --- a/row_cache.hh +++ b/row_cache.hh @@ -26,7 +26,6 @@ #include #include -#include #include #include "mutation_reader.hh" @@ -34,7 +33,6 @@ #include "utils/phased_barrier.hh" #include "utils/histogram.hh" #include "partition_version.hh" -#include "utils/estimated_histogram.hh" #include "tracing/trace_state.hh" #include #include "mutation_cleaner.hh" diff --git a/schema.hh b/schema.hh index c60d1cc388..8b4d37d4a6 100644 --- a/schema.hh +++ b/schema.hh @@ -35,7 +35,6 @@ #include "types.hh" #include "compound.hh" #include "gc_clock.hh" -#include "unimplemented.hh" #include "utils/UUID.hh" #include "compress.hh" #include "compaction_strategy_type.hh" diff --git a/service/raft/raft_sys_table_storage.cc b/service/raft/raft_sys_table_storage.cc index f55e9547a6..ef65b7f244 100644 --- a/service/raft/raft_sys_table_storage.cc +++ b/service/raft/raft_sys_table_storage.cc @@ -30,6 +30,7 @@ #include "idl/raft.dist.impl.hh" #include "cql3/statements/batch_statement.hh" +#include "cql3/statements/modification_statement.hh" #include "cql3/query_processor.hh" #include diff --git a/service/storage_proxy.cc b/service/storage_proxy.cc index 55bab5f0f3..a3e231df4d 100644 --- a/service/storage_proxy.cc +++ b/service/storage_proxy.cc @@ -104,6 +104,8 @@ #include "seastar/core/with_timeout.hh" #include "locator/abstract_replication_strategy.hh" #include "service/paxos/cas_request.hh" +#include "mutation_partition_view.hh" +#include "service/paxos/paxos_state.hh" namespace bi = boost::intrusive; diff --git a/sstables/compaction.cc b/sstables/compaction.cc index 05d69eec87..90a9a539ad 100644 --- a/sstables/compaction.cc +++ b/sstables/compaction.cc @@ -71,6 +71,7 @@ #include "mutation_writer/partition_based_splitting_writer.hh" #include "mutation_source_metadata.hh" #include "mutation_fragment_stream_validator.hh" +#include "utils/UUID_gen.hh" namespace sstables { diff --git a/sstables/mutation_fragment_filter.hh b/sstables/mutation_fragment_filter.hh index 7b43b7caa2..97f95bf09b 100644 --- a/sstables/mutation_fragment_filter.hh +++ b/sstables/mutation_fragment_filter.hh @@ -23,6 +23,7 @@ #include "mutation_fragment.hh" #include "clustering_ranges_walker.hh" +#include "clustering_key_filter.hh" namespace sstables { diff --git a/table_helper.cc b/table_helper.cc index bbc8842730..59263b1bc2 100644 --- a/table_helper.cc +++ b/table_helper.cc @@ -25,6 +25,7 @@ #include "cql3/statements/create_table_statement.hh" #include "cql3/statements/modification_statement.hh" #include "database.hh" +#include "service/migration_manager.hh" future<> table_helper::setup_table(cql3::query_processor& qp) const { auto& db = qp.db(); diff --git a/table_helper.hh b/table_helper.hh index 272cbe4004..ca5023b413 100644 --- a/table_helper.hh +++ b/table_helper.hh @@ -23,8 +23,7 @@ #pragma once #include "cql3/statements/prepared_statement.hh" -#include "service/migration_manager.hh" - +#include "service/query_state.hh" namespace cql3 { class query_processor; diff --git a/test/boost/cdc_test.cc b/test/boost/cdc_test.cc index 44bcbb0086..a425efe91a 100644 --- a/test/boost/cdc_test.cc +++ b/test/boost/cdc_test.cc @@ -40,6 +40,8 @@ #include "types/set.hh" #include "types/user.hh" +#include "utils/UUID_gen.hh" + using namespace std::string_literals; namespace cdc { diff --git a/test/boost/counter_test.cc b/test/boost/counter_test.cc index ba3a7f2bc0..eef9317cb7 100644 --- a/test/boost/counter_test.cc +++ b/test/boost/counter_test.cc @@ -34,6 +34,7 @@ #include "keys.hh" #include "mutation.hh" #include "frozen_mutation.hh" +#include "mutation_partition_view.hh" void verify_shard_order(counter_cell_view ccv) { if (ccv.shards().begin() == ccv.shards().end()) { diff --git a/test/boost/cql_query_test.cc b/test/boost/cql_query_test.cc index 01bd7dcda2..3efa0cc897 100644 --- a/test/boost/cql_query_test.cc +++ b/test/boost/cql_query_test.cc @@ -55,6 +55,7 @@ #include "gms/feature.hh" #include "db/query_context.hh" #include "service/qos/qos_common.hh" +#include "utils/UUID_gen.hh" using namespace std::literals::chrono_literals; diff --git a/test/boost/flat_mutation_reader_test.cc b/test/boost/flat_mutation_reader_test.cc index 737e2d1195..356c9e0c09 100644 --- a/test/boost/flat_mutation_reader_test.cc +++ b/test/boost/flat_mutation_reader_test.cc @@ -35,6 +35,7 @@ #include "row_cache.hh" #include "test/lib/tmpdir.hh" #include "repair/repair.hh" +#include "mutation_partition_view.hh" #include "test/lib/simple_schema.hh" #include "test/lib/flat_mutation_reader_assertions.hh" diff --git a/test/boost/frozen_mutation_test.cc b/test/boost/frozen_mutation_test.cc index b69633c253..654760b3b8 100644 --- a/test/boost/frozen_mutation_test.cc +++ b/test/boost/frozen_mutation_test.cc @@ -28,6 +28,7 @@ #include "frozen_mutation.hh" #include "schema_builder.hh" +#include "mutation_partition_view.hh" #include "test/lib/mutation_assertions.hh" #include "test/lib/mutation_source_test.hh" diff --git a/test/boost/logalloc_test.cc b/test/boost/logalloc_test.cc index b6ffc269c4..306eafb2bf 100644 --- a/test/boost/logalloc_test.cc +++ b/test/boost/logalloc_test.cc @@ -26,11 +26,14 @@ #include #include +#include #include #include #include #include #include +#include +#include #include #include #include diff --git a/test/boost/view_build_test.cc b/test/boost/view_build_test.cc index 195bffb8fd..2bcd03d6cf 100644 --- a/test/boost/view_build_test.cc +++ b/test/boost/view_build_test.cc @@ -23,6 +23,7 @@ #include "database.hh" #include "db/view/view_builder.hh" +#include "db/view/view_updating_consumer.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 1a1a771a93..7c875b2cc5 100644 --- a/test/lib/cql_test_env.cc +++ b/test/lib/cql_test_env.cc @@ -31,6 +31,7 @@ #include "cql3/query_processor.hh" #include "cql3/query_options.hh" #include "cql3/statements/batch_statement.hh" +#include "cql3/statements/modification_statement.hh" #include "cql3/cql_config.hh" #include #include diff --git a/test/lib/mutation_source_test.cc b/test/lib/mutation_source_test.cc index 49865a46f6..c0f79d0af5 100644 --- a/test/lib/mutation_source_test.cc +++ b/test/lib/mutation_source_test.cc @@ -42,6 +42,7 @@ #include "types/list.hh" #include "types/set.hh" #include +#include "utils/UUID_gen.hh" // partitions must be sorted by decorated key static void require_no_token_duplicates(const std::vector& partitions) { diff --git a/test/manual/sstable_scan_footprint_test.cc b/test/manual/sstable_scan_footprint_test.cc index c1555b724c..8057e99717 100644 --- a/test/manual/sstable_scan_footprint_test.cc +++ b/test/manual/sstable_scan_footprint_test.cc @@ -35,6 +35,7 @@ #include #include #include +#include #include app_template app; diff --git a/test/perf/perf_fast_forward.cc b/test/perf/perf_fast_forward.cc index ef64a0a81f..8f4bcb55d8 100644 --- a/test/perf/perf_fast_forward.cc +++ b/test/perf/perf_fast_forward.cc @@ -53,6 +53,10 @@ using namespace seastar; namespace fs = std::filesystem; using int_range = nonwrapping_range; +namespace sstables { + extern bool use_binary_search_in_promoted_index; +} // namespace sstables + reactor::io_stats s; static bool errors_found = false; diff --git a/test/perf/perf_idl.cc b/test/perf/perf_idl.cc index e10937a851..11eb6311c1 100644 --- a/test/perf/perf_idl.cc +++ b/test/perf/perf_idl.cc @@ -25,6 +25,7 @@ #include "test/lib/simple_schema.hh" #include "frozen_mutation.hh" +#include "mutation_partition_view.hh" namespace tests { diff --git a/thrift/handler.hh b/thrift/handler.hh index 53614461b2..0340000505 100644 --- a/thrift/handler.hh +++ b/thrift/handler.hh @@ -30,6 +30,7 @@ #include struct timeout_config; +class service_permit; std::unique_ptr<::cassandra::CassandraCobSvIfFactory> create_handler_factory(distributed& db, distributed& qp, auth::service&, timeout_config, service_permit& current_permit); diff --git a/thrift/server.hh b/thrift/server.hh index d400bbdce6..3cccf7e657 100644 --- a/thrift/server.hh +++ b/thrift/server.hh @@ -33,6 +33,7 @@ #include #include "database_fwd.hh" #include "utils/updateable_value.hh" +#include "service_permit.hh" class thrift_server; class thrift_stats; diff --git a/tracing/trace_keyspace_helper.hh b/tracing/trace_keyspace_helper.hh index 4120a2ddf1..3ec2b2ea99 100644 --- a/tracing/trace_keyspace_helper.hh +++ b/tracing/trace_keyspace_helper.hh @@ -45,6 +45,7 @@ #include #include "tracing/tracing.hh" #include "table_helper.hh" +#include "cql3/values.hh" namespace tracing { diff --git a/transport/messages/result_message.hh b/transport/messages/result_message.hh index f78c68b7c4..0ba03d68ce 100644 --- a/transport/messages/result_message.hh +++ b/transport/messages/result_message.hh @@ -24,6 +24,7 @@ #include "cql3/result_set.hh" #include "cql3/statements/prepared_statement.hh" +#include "cql3/cql_statement.hh" #include "transport/messages/result_message_base.hh" #include "transport/event.hh" diff --git a/transport/server.cc b/transport/server.cc index 2ea2bcd1fa..028c62eefe 100644 --- a/transport/server.cc +++ b/transport/server.cc @@ -28,6 +28,7 @@ #include #include "cql3/statements/batch_statement.hh" +#include "cql3/statements/modification_statement.hh" #include "types/collection.hh" #include "types/list.hh" #include "types/set.hh" diff --git a/transport/server.hh b/transport/server.hh index eeee8d0d61..f47ecd6aa6 100644 --- a/transport/server.hh +++ b/transport/server.hh @@ -41,6 +41,8 @@ #include #include "utils/updateable_value.hh" #include "generic_server.hh" +#include "service/query_state.hh" +#include "cql3/query_options.hh" namespace scollectd { diff --git a/utils/large_bitset.hh b/utils/large_bitset.hh index 2172789bac..d2bceeb0c8 100644 --- a/utils/large_bitset.hh +++ b/utils/large_bitset.hh @@ -24,12 +24,7 @@ #pragma once -#include -#include #include -#include -#include -#include #include #include "utils/chunked_vector.hh" diff --git a/utils/logalloc.cc b/utils/logalloc.cc index 5480688839..9d61cbb74c 100644 --- a/utils/logalloc.cc +++ b/utils/logalloc.cc @@ -35,8 +35,10 @@ #include #include #include +#include #include #include +#include #include "utils/logalloc.hh" #include "log.hh" diff --git a/utils/logalloc.hh b/utils/logalloc.hh index 8d566b773f..0654ce8c32 100644 --- a/utils/logalloc.hh +++ b/utils/logalloc.hh @@ -23,14 +23,10 @@ #include #include -#include #include #include #include #include -#include -#include -#include #include #include "allocation_strategy.hh" #include diff --git a/utils/phased_barrier.hh b/utils/phased_barrier.hh index 5d8b2898b5..b48b80d3f4 100644 --- a/utils/phased_barrier.hh +++ b/utils/phased_barrier.hh @@ -22,7 +22,6 @@ #pragma once #include -#include #include #include #include "seastarx.hh" diff --git a/version.hh b/version.hh index 362f55b5b1..69901f2ffb 100644 --- a/version.hh +++ b/version.hh @@ -26,16 +26,14 @@ #include #include -#include "seastarx.hh" - namespace version { class version { std::tuple _version; public: version(uint16_t x, uint16_t y = 0, uint16_t z = 0): _version(std::make_tuple(x, y, z)) {} - sstring to_sstring() { - return format("{:d}.{:d}.{:d}", std::get<0>(_version), std::get<1>(_version), std::get<2>(_version)); + seastar::sstring to_sstring() { + return seastar::format("{:d}.{:d}.{:d}", std::get<0>(_version), std::get<1>(_version), std::get<2>(_version)); } static version current() { @@ -65,7 +63,7 @@ public: } }; -inline const sstring& release() { +inline const seastar::sstring& release() { static thread_local auto str_ver = version::current().to_sstring(); return str_ver; }