Class | RR::Configuration |
In: |
lib/rubyrep/configuration.rb
|
Parent: | Object |
The Configuration class holds the default configuration options for Rubyrep. Configuration values are changed with the Initializer::run method.
DEFAULT_OPTIONS | = | { :proxy_block_size => 1000, :row_buffer_size => 1000, :replicator => :two_way, :committer => :buffered_commit, :commit_frequency => 1000, :table_ordering => true, :scan_progress_printer => :progress_bar, :use_ansi => true_if_running_in_a_terminal_and_not_under_windows, :initial_sync => true, :adjust_sequences => true, :sequence_adjustment_buffer => 0, :sequence_increment => 2, :left_sequence_offset => 0, :right_sequence_offset => 1, :replication_interval => 1, :auto_key_limit => 0, :database_connection_timeout => 5, :rep_prefix => 'rr', :key_sep => '|', } | Default options for a new Configuration object. |
left | [RW] | Connection settings for the "left" database. See Configuration#right for details. |
options | [R] |
General options. Possible settings:
Sync specific settings
Replication specific settings:
Example of an :after_infrastructure_setup handler: lambda do |session| [:left, :right].each do |database| session.send(database).execute "GRANT SELECT, UPDATE, INSERT ON rr_pending_changes TO scott" end end |
right | [RW] |
Connection settings for the "right" database. Takes a similar
hash as ActiveRecord::Base.establish_connection. Additional settings in
case a proxy is used:
Other additional settings:
|
Adds the specified options for the provided table_spec. A table_spec can be either
options is hash with possible generic values as described under options. Additional, exclusively table specific options:
Yields all table specs that have been set up with the given option
Yields:
Excludes the specified table from the list of tables that should be processed. Refer to add_table_options for detailed description of what constitutes a valid table specification.
Array of table specifications for tables that should not be processed Refer to add_table_options for what constitutes a valid table specification.
Adds the specified tables to the list of tables that should be processed. If options are provided, store them for future processing. Refer to add_table_options for detailed description of parameters.
Array of table specifications for tables that should be processed Refer to add_table_options for what constitutes a valid table specification.
Returns an option hash for the given table. Accumulates options for all matching table specs (most recently added options overwrite according options added before).
Also includes the general options as returned by options. (Table specific options overwrite the general options).
Possible option values are described under add_tables.
A list of tables having table specific options that should be considered during processing (scanned, synced, …) tables_with_options is a 2 element array with
Should only be accessed via add_table_options and options_for_table