Skip to content

Commit

Permalink
secondary_index_manager: stop including expression.hh
Browse files Browse the repository at this point in the history
Use a forward declaration of cql3::expr::oper_t to reduce the
number of translation units depending on expression.hh.

Before:

    $ find build/dev -name '*.d' | xargs cat | grep -c expression.hh
    272

After:

    $ find build/dev -name '*.d' | xargs cat | grep -c expression.hh
    154

Some translation units adjust their includes to restore access
to required headers.

Closes scylladb#9229
  • Loading branch information
avikivity authored and nyh committed Aug 22, 2021
1 parent 7bd1bcd commit 6221b90
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/column_family.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "db/system_keyspace_view_types.hh"
#include "db/data_listeners.hh"
#include "storage_service.hh"
#include "unimplemented.hh"

extern logging::logger apilog;

Expand Down
1 change: 1 addition & 0 deletions api/compaction_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "api/api-doc/compaction_manager.json.hh"
#include "db/system_keyspace.hh"
#include "column_family.hh"
#include "unimplemented.hh"
#include <utility>

namespace api {
Expand Down
1 change: 1 addition & 0 deletions index/secondary_index_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

#include "cql3/statements/index_target.hh"
#include "cql3/util.hh"
#include "cql3/expr/expression.hh"
#include "index/target_parser.hh"
#include "db/query_context.hh"
#include "schema_builder.hh"
Expand Down
7 changes: 6 additions & 1 deletion index/secondary_index_manager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,17 @@

#include "schema.hh"

#include "cql3/expr/expression.hh"
#include "database_fwd.hh"

#include <vector>
#include <set>

namespace cql3::expr {

enum class oper_t;

}

namespace secondary_index {

sstring index_table_name(const sstring& index_name);
Expand Down
1 change: 1 addition & 0 deletions service/client_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include "db/system_distributed_keyspace.hh"
#include "database.hh"
#include "cdc/log.hh"
#include "utils/overloaded_functor.hh"
#include <seastar/core/coroutine.hh>

thread_local api::timestamp_type service::client_state::_last_timestamp_micros = 0;
Expand Down
1 change: 1 addition & 0 deletions test/boost/cql_query_like_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "types/set.hh"
#include "test/lib/exception_utils.hh"
#include "schema_builder.hh"
#include "cql3/query_options.hh"

using namespace std::literals::chrono_literals;

Expand Down
1 change: 1 addition & 0 deletions test/boost/error_injection_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "test/lib/cql_assertions.hh"
#include "types/list.hh"
#include "log.hh"
#include "cql3/query_options.hh"
#include <chrono>

using namespace std::literals::chrono_literals;
Expand Down
1 change: 1 addition & 0 deletions test/boost/restrictions_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "cql3/cql_config.hh"
#include "cql3/values.hh"
#include "cql3/query_options.hh"
#include "test/lib/cql_assertions.hh"
#include "test/lib/cql_test_env.hh"
#include "test/lib/exception_utils.hh"
Expand Down
1 change: 1 addition & 0 deletions test/boost/view_build_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "db/system_keyspace.hh"
#include "db/system_keyspace_view_types.hh"
#include "db/config.hh"
#include "cql3/query_options.hh"

#include <seastar/testing/test_case.hh>
#include <seastar/testing/thread_test_case.hh>
Expand Down
6 changes: 6 additions & 0 deletions test/lib/cql_test_env.hh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ namespace cql3 {
class query_processor;
}

namespace service {

class client_state;

}

class not_prepared_exception : public std::runtime_error {
public:
not_prepared_exception(const cql3::prepared_cache_key_type& id) : std::runtime_error(format("Not prepared: {}", id)) {}
Expand Down

0 comments on commit 6221b90

Please sign in to comment.