Class: Lhm::Invoker

Inherits:
Object
  • Object
show all
Defined in:
lib/lhm/invoker.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(origin, connection) ⇒ Invoker

Returns a new instance of Invoker.



18
19
20
21
# File 'lib/lhm/invoker.rb', line 18

def initialize(origin, connection)
  @connection = connection
  @migrator = Migrator.new(origin, connection)
end

Instance Attribute Details

#migratorObject (readonly)

Returns the value of attribute migrator.



16
17
18
# File 'lib/lhm/invoker.rb', line 16

def migrator
  @migrator
end

Instance Method Details

#run(chunk_options = {}) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/lhm/invoker.rb', line 23

def run(chunk_options = {})
  migration = @migrator.run

  Entangler.new(migration, @connection).run do
    Chunker.new(migration, @connection, chunk_options).run
    LockedSwitcher.new(migration, @connection).run
  end
end