Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
CassandraMigrationManager.hpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of clio: https://github.com/XRPLF/clio
4 Copyright (c) 2024, the clio developers.
5
6 Permission to use, copy, modify, and distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#pragma once
21
22#include "data/BackendInterface.hpp"
23#include "migration/cassandra/CassandraMigrationBackend.hpp"
24#include "migration/impl/MigrationInspectorBase.hpp"
25#include "migration/impl/MigrationManagerBase.hpp"
26#include "migration/impl/MigratorsRegister.hpp"
27
28namespace {
29
30// Register migrators here
31// MigratorsRegister<BackendType, ExampleMigrator>
32template <typename BackendType>
33using CassandraSupportedMigrators = migration::impl::MigratorsRegister<BackendType>;
34
35// Instantiates with the backend which supports actual migration running
36using MigrationProcesser = CassandraSupportedMigrators<migration::cassandra::CassandraMigrationBackend>;
37
38// Instantiates with backend interface, it doesn't support actual migration. But it can be used to inspect the migrators
39// status
40using MigrationQuerier = CassandraSupportedMigrators<data::BackendInterface>;
41
42} // namespace
43
44namespace migration::cassandra {
45
46using CassandraMigrationInspector = migration::impl::MigrationInspectorBase<MigrationQuerier>;
47
48using CassandraMigrationManager = migration::impl::MigrationManagerBase<MigrationProcesser>;
49
50} // namespace migration::cassandra
The migration inspector implementation for Cassandra. It will report the migration status for Cassand...
Definition MigrationInspectorBase.hpp:40
The migration manager implementation for Cassandra. It will run the migration for the Cassandra datab...
Definition MigrationManagerBase.hpp:39
The register of migrators. It will dispatch the migration to the corresponding migrator....
Definition MigratorsRegister.hpp:67