Package londiste :: Module syncer :: Class Syncer
[frames] | no frames]

Class Syncer

source code

                 object --+    
                          |    
skytools.scripting.DBScript --+
                              |
                             Syncer
Known Subclasses:
compare.Comparator, repair.Repairer

Walks tables in primary key order and checks if data matches.

Instance Methods
 
__init__(self, args)
Script setup.
source code
 
check_consumer(self, src_db) source code
 
check_table(self, tbl, lock_db, src_db, dst_db)
Get transaction to same state, then process.
source code
 
get_subscriber_table_state(self) source code
 
init_optparse(self, p=None)
Initialize a OptionParser() instance that will be used to parse command line arguments.
source code
 
process_sync(self, tbl, src_db, dst_db)
It gets 2 connections in state where tbl should be in same state.
source code
 
work(self)
Here should user's processing happen.
source code

Inherited from skytools.scripting.DBScript: close_database, get_database, hook_sighup, hook_sigint, reload, reset, run, run_once, send_signal, send_stats, set_single_loop, start, startup, stat_add, stat_increase, stat_put, stop

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables

Inherited from skytools.scripting.DBScript: cf, job_name, log, service_name

Properties

Inherited from object: __class__

Method Details

__init__(self, args)
(Constructor)

source code 

Script setup.

User class should override work() and optionally __init__(), startup(), reload(), reset() and init_optparse().

NB: in case of daemon, the __init__() and startup()/work() will be run in different processes. So nothing fancy should be done in __init__().
Overrides: skytools.scripting.DBScript.__init__
(inherited documentation)

init_optparse(self, p=None)

source code 

Initialize a OptionParser() instance that will be used to parse command line arguments.

Note that it can be overrided both directions - either DBScript will initialize a instance and passes to user code or user can initialize and then pass to DBScript.init_optparse().
Returns:
initialized OptionParser() instance.
Overrides: skytools.scripting.DBScript.init_optparse
(inherited documentation)

work(self)

source code 
Here should user's processing happen.
Overrides: skytools.scripting.DBScript.work
(inherited documentation)