lib/lhm/invoker.rb in lhm-1.0.0.rc2 vs lib/lhm/invoker.rb in lhm-1.0.0.rc3
- old
+ new
@@ -1,23 +1,19 @@
-#
-# Copyright (c) 2011, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias
-# Schmidt
-#
-# Copies an origin table to an altered destination table. Live activity is
-# synchronized into the destination table using triggers.
-#
-# Once the origin and destination tables have converged, origin is archived
-# and replaced by destination.
-#
+# Copyright (c) 2011, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias
+# Schmidt
require 'lhm/chunker'
require 'lhm/entangler'
require 'lhm/locked_switcher'
-require 'lhm/migration'
require 'lhm/migrator'
module Lhm
+ # Copies an origin table to an altered destination table. Live activity is
+ # synchronized into the destination table using triggers.
+ #
+ # Once the origin and destination tables have converged, origin is archived
+ # and replaced by destination.
class Invoker
attr_reader :migrator
def initialize(origin, connection)
@connection = connection
@@ -25,13 +21,12 @@
end
def run(chunk_options = {})
migration = @migrator.run
- Entangler.new(migration, @connection).run do |tangler|
- Chunker.new(migration, tangler.epoch, @connection, chunk_options).run
+ Entangler.new(migration, @connection).run do
+ Chunker.new(migration, @connection, chunk_options).run
LockedSwitcher.new(migration, @connection).run
end
end
end
end
-