| Class-DBI-Replicated documentation | view source | Contained in the Class-DBI-Replicated distribution. |
Class::DBI::Replicated - Replication from single master to multiple slaves
Version 0.040
package My::DBI; use base qw(Class::DBI::Replicated::mysql); # use base qw(Class::DBI::Replicated::Pg::Slony1); My::DBI->replication(\%arg);
Class::DBI::Replicated does some stuff, blah blah.
replication$class->replication(\%arg);
Analogous to connection. Takes a single hashref.
a single arrayref (as passed to connection)
an arrayref of arrayrefs, one per slave. NOTE: currently, using more than one slave does nothing.
If present, these specify the user and password to use for
replication-specific queries (such as MySQL's SHOW MASTER
STATUS).
replication_dbReturns the name of the current database in use (minus the
leading db_).
db_MainReturn a master or slave DBH, as dictated by the current replication state.
db_SlaveAlways returns a DBH for the most recently-used slave.
db_MasterGenerated by Class::DBI.
db_Slave_ReplMost recently-used slave's connection for replication.
Falls back to db_Slave if no user/password given
db_Master_ReplMaster's connection for replication.
Falls back to db_Master if no user/password given
switch_to_masterswitch_to_slavewait_for_slaveThat is, methods dealing specifically with replication positions.
repl_markGet current master position and save it
repl_posClass data accessor/mutator for current marked master position
repl_get_mastervirtual (scalar)
repl_get_slavevirtual (scalar)
repl_check if ($class->repl_check) { ...
repl_wait unless ($class->repl_wait(\%arg)) {
# not up to date
}
Possible arguments:
defaults to 30
slave name, defaults to the first one
die instead of returning 0
return 0 for failure
repl_comparemy $later = $class->repl_compare($my_pos, $master_pos);
virtual (boolean)
return 1 if $my_pos is at least as new as $master_pos return 0 otherwise
before_createbefore_updatebefore_deleteswitch to using master
after_createafter_updateafter_deletemark master position
selectmk_force_mastersmk_markersreplication_argsExtra Params::Validate specifications for replication.
replication_setupCalled automatically inside replication.
Gets a hashref of the arguments to replication.
Hans Dieter Pearcey, <hdp@cpan.org>
Please report any bugs or feature requests to
bug-class-dbi-replicated@rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-DBI-Replicated.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
Copyright 2005 Hans Dieter Pearcey, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Class-DBI-Replicated documentation | view source | Contained in the Class-DBI-Replicated distribution. |