From 53b00ecefecc36d58e4bcf231bd26500d5cb07e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Fri, 1 Apr 2022 09:49:04 +0300 Subject: [PATCH] db/system_distributed_keyspace: add all tables methods Add methods to get the schema of all distributed and distribyted everywhere tables respectively. --- db/system_distributed_keyspace.cc | 8 ++++++++ db/system_distributed_keyspace.hh | 3 +++ 2 files changed, 11 insertions(+) diff --git a/db/system_distributed_keyspace.cc b/db/system_distributed_keyspace.cc index 359fc39234..93cc0b14bd 100644 --- a/db/system_distributed_keyspace.cc +++ b/db/system_distributed_keyspace.cc @@ -182,6 +182,14 @@ bool system_distributed_keyspace::is_extra_durable(const sstring& cf_name) { return cf_name == CDC_TOPOLOGY_DESCRIPTION || cf_name == CDC_GENERATIONS_V2; } +std::vector system_distributed_keyspace::all_distributed_tables() { + return {view_build_status(), cdc_desc(), cdc_timestamps(), service_levels()}; +} + +std::vector system_distributed_keyspace::all_everywhere_tables() { + return {cdc_generations_v2()}; +} + system_distributed_keyspace::system_distributed_keyspace(cql3::query_processor& qp, service::migration_manager& mm, service::storage_proxy& sp) : _qp(qp) , _mm(mm) diff --git a/db/system_distributed_keyspace.hh b/db/system_distributed_keyspace.hh index 829858d3ff..9a4b2e17cb 100644 --- a/db/system_distributed_keyspace.hh +++ b/db/system_distributed_keyspace.hh @@ -80,6 +80,9 @@ public: * before being acknowledged? */ static bool is_extra_durable(const sstring& cf_name); + static std::vector all_distributed_tables(); + static std::vector all_everywhere_tables(); + system_distributed_keyspace(cql3::query_processor&, service::migration_manager&, service::storage_proxy&); future<> start();