raft_group0_client: uninclude "mutation/mutation.hh"

Lighten the dependency load. Some constructors and destructors
are uninlined to avoid the header depending on the mutation class.
This commit is contained in:
Avi Kivity
2024-09-28 14:05:58 +03:00
parent 5d68efe0bd
commit 93afc77307
8 changed files with 26 additions and 3 deletions

View File

@@ -23,6 +23,8 @@
#include "utils/rjson.hh"
#include "utils/updateable_value.hh"
#include "tracing/trace_state.hh"
namespace db {
class system_distributed_keyspace;
}
@@ -50,6 +52,8 @@ class gossiper;
}
class schema_builder;
namespace alternator {
class rmw_operation;

View File

@@ -12,6 +12,8 @@
#include "service/paxos/cas_request.hh"
#include "utils/rjson.hh"
#include "executor.hh"
#include "tracing/trace_state.hh"
#include "keys.hh"
namespace alternator {

View File

@@ -11,6 +11,7 @@
#include "types/set.hh"
#include "cql3/expr/evaluate.hh"
#include "cql3/expr/expr-utils.hh"
#include "mutation/mutation.hh"
namespace cql3 {
void

View File

@@ -17,6 +17,7 @@
#include "cas_request.hh"
#include "cql3/query_processor.hh"
#include "service/storage_proxy.hh"
#include "tracing/trace_state.hh"
#include <boost/algorithm/cxx11/any_of.hpp>
#include <boost/algorithm/cxx11/all_of.hpp>

View File

@@ -14,6 +14,7 @@
#include "log.hh"
#include "service_permit.hh"
#include "exceptions/coordinator_result.hh"
#include "tracing/trace_state.hh"
namespace cql_transport::messages {
class result_message;

View File

@@ -23,6 +23,7 @@
#include "utils/serialized_action.hh"
#include "service/raft/raft_group_registry.hh"
#include "service/raft/raft_group0_client.hh"
#include "db/timeout_clock.hh"
#include <vector>

View File

@@ -498,6 +498,16 @@ template group0_command raft_group0_client::prepare_command(broadcast_table_quer
template group0_command raft_group0_client::prepare_command(write_mutations change, std::string_view description);
template group0_command raft_group0_client::prepare_command(mixed_change change, group0_guard& guard, std::string_view description);
group0_batch::group0_batch(::service::group0_guard&& g)
: _guard(std::move(g)) {
}
group0_batch::group0_batch(std::optional<::service::group0_guard> g)
: _guard(std::move(g)) {
}
group0_batch::~group0_batch() = default;
api::timestamp_type group0_batch::write_timestamp() const {
if (!_guard) {
on_internal_error(logger, "group0_batch: write_timestamp without guard taken");

View File

@@ -25,10 +25,11 @@
#include "utils/UUID.hh"
#include "timestamp.hh"
#include "gc_clock.hh"
#include "mutation/mutation.hh"
#include "service/raft/group0_state_machine.hh"
#include "service/maintenance_mode.hh"
class mutation;
namespace db {
class system_keyspace;
@@ -221,11 +222,13 @@ private:
future<> materialize_mutations();
public:
explicit group0_batch(::service::group0_guard&& g) : _guard(std::move(g)) {}
explicit group0_batch(::service::group0_guard&& g);
// Constructor with optional guard used to handle both legacy and current code.
// There is no guard for legacy code but the whole class may be passed
// through to simplify the flow.
explicit group0_batch(std::optional<::service::group0_guard> g) : _guard(std::move(g)) {}
explicit group0_batch(std::optional<::service::group0_guard> g);
~group0_batch();
// Annotation helper for cases where we need collector (e.g. some interface)
// but the code is fully legacy and the collector won't be used.