service/raft: Refactor mutation writing helper functions.

We use these changes in following commit.
This commit is contained in:
Abhi
2025-02-07 14:01:12 +05:30
parent 0092bb5831
commit 4748125a48
2 changed files with 8 additions and 2 deletions

View File

@@ -99,7 +99,7 @@ static future<> mutate_locally(utils::chunked_vector<canonical_mutation> muts, s
});
}
static bool should_flush_system_topology_after_applying(const mutation& mut, const data_dictionary::database db) {
bool should_flush_system_topology_after_applying(const mutation& mut, const data_dictionary::database db) {
if (!db.has_schema(db::system_keyspace::NAME, db::system_keyspace::TOPOLOGY)) {
return false;
}
@@ -120,7 +120,7 @@ static bool should_flush_system_topology_after_applying(const mutation& mut, con
return false;
}
static future<> write_mutations_to_database(storage_proxy& proxy, gms::inet_address from, std::vector<canonical_mutation> cms) {
future<> write_mutations_to_database(storage_proxy& proxy, gms::inet_address from, std::vector<canonical_mutation> cms) {
std::vector<frozen_mutation_and_schema> mutations;
mutations.reserve(cms.size());
bool need_system_topology_flush = false;

View File

@@ -10,6 +10,7 @@
#include <seastar/core/gate.hh>
#include <seastar/core/abort_source.hh>
#include "data_dictionary/data_dictionary.hh"
#include "service/broadcast_tables/experimental/lang.hh"
#include "raft/raft.hh"
#include "service/raft/group0_state_id_handler.hh"
@@ -122,4 +123,9 @@ public:
future<> abort() override;
};
bool should_flush_system_topology_after_applying(const mutation& mut, const data_dictionary::database db);
// Used to write data to topology and other tables except schema tables.
future<> write_mutations_to_database(storage_proxy& proxy, gms::inet_address from, std::vector<canonical_mutation> cms);
} // end of namespace service