public void createControllers ( MigrationConfiguration [ ] configurations ) throws Exception { for ( MigrationConfiguration cfg : configurations ) { MigrationProcess process = migrationMap . get ( cfg . get_id ( ) ) ; if ( process == null ) { LOGGER . debug ( "Creating a controller thread for configuration {}: {}" , cfg . get_id ( ) , cfg . getConfigurationName ( ) ) ; MigratorController c = new MigratorController ( this , cfg ) ; if ( c instanceof MonitoredThread ) { ( ( MonitoredThread ) c ) . registerThreadMonitor ( threadMonitor ) ; } AbstractController ccc = getConsistencyCheckerController ( cfg ) ; ; if ( ccc instanceof MonitoredThread ) { ( ( MonitoredThread ) ccc ) . registerThreadMonitor ( threadMonitor ) ; } migrationMap . put ( cfg . get_id ( ) , new MigrationProcess ( cfg , c , ccc ) ) ; c . start ( ) ; if ( ccc != null ) { ccc . start ( ) ; } } else { healthcheck ( cfg ) ; } } }
Creates controller threads for migrators and consistency checkers based on the configuration loaded from the db .