Search in sources :

Example 1 with MigrationVersionInfoFormatter

use of io.confluent.ksql.tools.migrations.util.MigrationVersionInfoFormatter in project ksql by confluentinc.

the class MigrationInfoCommand method printAsTable.

private static void printAsTable(final List<MigrationFile> allMigrations, final Map<Integer, Optional<MigrationVersionInfo>> versionInfos) {
    final MigrationVersionInfoFormatter formatter = new MigrationVersionInfoFormatter();
    for (final MigrationFile migration : allMigrations) {
        final MigrationVersionInfo versionInfo = versionInfos.get(migration.getVersion()).orElse(MigrationVersionInfo.pendingMigration(migration.getVersion(), migration.getName()));
        formatter.addVersionInfo(versionInfo);
    }
    LOGGER.info(formatter.getFormatted());
}
Also used : MigrationVersionInfo(io.confluent.ksql.tools.migrations.util.MigrationVersionInfo) MigrationFile(io.confluent.ksql.tools.migrations.util.MigrationFile) MigrationVersionInfoFormatter(io.confluent.ksql.tools.migrations.util.MigrationVersionInfoFormatter)

Aggregations

MigrationFile (io.confluent.ksql.tools.migrations.util.MigrationFile)1 MigrationVersionInfo (io.confluent.ksql.tools.migrations.util.MigrationVersionInfo)1 MigrationVersionInfoFormatter (io.confluent.ksql.tools.migrations.util.MigrationVersionInfoFormatter)1