Class RR::ReplicationHelper
In: lib/rubyrep/replication_helper.rb
Parent: Object

Provides helper functionality for replicators. The methods exposed by this class are intended to provide a stable interface for third party replicators.

Methods

Included Modules

LogHelper

Attributes

replication_run  [RW]  The current ReplicationRun instance

Public Class methods

Creates a new SyncHelper for the given TableSync instance.

Public Instance methods

Delegates to Committers::BufferedCommitter#delete_record

Asks the committer (if it exists) to finalize any open transactions success should be true if there were no problems, false otherwise.

Delegates to Committers::BufferedCommitter#insert_record

Loads the specified record. Returns an according column_name => value hash. Parameters:

  • database: either :left or :right
  • table: name of the table
  • key: A column_name => value hash for all primary key columns.

Logs the outcome of a replication into the replication log table.

  • diff: the replicated ReplicationDifference
  • outcome: string summarizing the outcome of the replication
  • details: string with further details regarding the replication

Returns true if a new transaction was started since the last insert / update / delete.

Returns the options for the specified table name.

  • table: name of the table (left database version)

The active Session

Converts the row values into their proper types as per table definition.

  • table: name of the table after whose columns is type-casted.
  • row: A column_name => value hash of the row

Returns a copy of the column_name => value hash (with type-casted values).

Delegates to Committers::BufferedCommitter#update_record

[Validate]