class MappingsSourcesMigration implements Migration {

    @Override
    public void apply() {
        cassandraRecipientRewriteTableDAO.getAllMappings()
            .flatMap(this::migrate)
            .then(Mono.fromRunnable(() -> {
                if (errorMappingsCount.get() > 0) {
                    throw new MigrationException("MappingsSourcesMigration failed");
                }
            }))
            .doOnError(t -> LOGGER.error("Error while migrating mappings sources", t))
            .block();
    }

    @Inject public  MappingsSourcesMigration(CassandraRecipientRewriteTableDAO cassandraRecipientRewriteTableDAO,
                                    CassandraMappingsSourcesDAO cassandraMappingsSourcesDAO);

}