Class RR::LoggedChangeLoader
In: lib/rubyrep/logged_change_loader.rb
Parent: Object

Caches the entries in the change log table

Methods

Attributes

change_array  [RW]  Array with all cached changes. Processed change log records are replaced with nil.
change_tree  [RW]  Tree (hash) structure for fast access to all cached changes. First level of tree:
  • key: table name
  • value: 2nd level tree

2nd level tree:

  • key: the change_key value of the according change log records.
  • value: An array of according change log records (column_name => value hash). Additional entry of each change log hash:
    • key: ‘array_index‘
    • value: index to the change log record in change_array
connection  [RW]  The current ProxyConnection.
current_id  [RW]  ID of the last cached change log record.
current_index  [RW]  Index to the next unprocessed change in the change_array.
database  [RW]  Current database (either :left or :right)
last_updated  [RW]  Date of last update of the cache
session  [RW]  The current Session.

Public Class methods

Create a new change log record cache.

  • session: The current Session
  • database: Either :left or :right

Public Instance methods

Returns the specified change log record (column_name => value hash).

  • change_table: the name of the table that was changed
  • change_key: the change key of the modified record

Returns the oldest unprocessed change log record (column_name => value hash).

Returns the creation time of the oldest unprocessed change log record.

Updates the cache. Options is a hash determining when the update is actually executed:

  • :expire_time: cache is older than the given number of seconds
  • :forced: if true update the cache even if not yet expired

[Validate]