3#include "migration/MigrationInspectorInterface.hpp"
4#include "migration/MigratiorStatus.hpp"
12namespace migration::impl {
20template <
typename SupportedMigrators>
23 SupportedMigrators migrators_;
32 std::shared_ptr<typename SupportedMigrators::BackendType> backend
34 : migrators_{std::move(backend)}
44 [[nodiscard]] std::vector<std::tuple<std::string, MigratorStatus>>
47 return migrators_.getMigratorsStatus();
59 return migrators_.getMigratorStatus(name);
67 [[nodiscard]] std::vector<std::string>
70 auto const names = migrators_.getMigratorNames();
71 return std::vector<std::string>{names.begin(), names.end()};
80 [[nodiscard]] std::string
83 return migrators_.getMigratorDescription(name);
94 return std::ranges::any_of(migrators_.getMigratorNames(), [&](
auto const& migrator) {
95 if (auto canBlock = migrators_.canMigratorBlockClio(migrator); canBlock.has_value() and
97 migrators_.getMigratorStatus(std::string(migrator)) ==
98 MigratorStatus::Status::NotMigrated) {
The status of a migrator, it provides the helper functions to convert the status to string and vice v...
Definition MigratiorStatus.hpp:13
std::vector< std::tuple< std::string, MigratorStatus > > allMigratorsStatusPairs() const override
Get the status of all the migrators.
Definition MigrationInspectorBase.hpp:45
MigrationInspectorBase(std::shared_ptr< typename SupportedMigrators::BackendType > backend)
Construct a new Cassandra Migration Inspector object.
Definition MigrationInspectorBase.hpp:31
bool isBlockingClio() const override
Return if there is incomplete migrator blocking the server.
Definition MigrationInspectorBase.hpp:92
std::string getMigratorDescriptionByName(std::string const &name) const override
Get the description of a migrator by its name.
Definition MigrationInspectorBase.hpp:81
MigratorStatus getMigratorStatusByName(std::string const &name) const override
Get the status of a migrator by its name.
Definition MigrationInspectorBase.hpp:57
std::vector< std::string > allMigratorsNames() const override
Get all registered migrators' names.
Definition MigrationInspectorBase.hpp:68
The interface for the migration inspector.The Clio server application will use this interface to insp...
Definition MigrationInspectorInterface.hpp:15