public static void ChangeTable(string tableName, Action<Migrator> configMigration, MigrationOptions options = null) { try { var origin = Table.Parse(tableName, Connection); var invoker = new Invoker(origin, Connection); configMigration.Invoke(invoker.Migrator); invoker.Run(options); } catch (Exception ex) { Logger.ErrorException(ex.Message, ex); } finally { Connection.Close(); } }
private MigrationOptions ConfigureOptions(MigrationOptions options) { if (options == null) { options = new MigrationOptions(); } if (options.Throttler == null) { if (Lhm.Throttler != null) { options.Throttler = Lhm.Throttler; } //use the default throttler todo create throttler factory options.Throttler = new TimeThrottler(10, 100); } return options; }
public void Run(MigrationOptions options) { Logger.Info("Starting LHM run on table " + _migrator.Name); options = ConfigureOptions(options); var migration = Migrator.Run(); var entangler = new Entangler(migration, _connection); entangler.Run(); var chunker = new Chunker(migration, _connection, options); chunker.Run(); if (options.UseAtomicSwitcher) { var switcher = new AtomicSwitcher(migration, _connection); switcher.Run(); } else { //todo create alternate switcher } }
public Chunker(TableMigration migration, IDbConnection connection, MigrationOptions options) { _migration = migration; _connection = connection; _throttler = options.Throttler; }