diff options
| author | Asko Oja | 2009-05-04 14:02:39 +0000 |
|---|---|---|
| committer | Marko Kreen | 2009-06-01 07:49:44 +0000 |
| commit | 9cbd16ab343c28c55012127a1cb643b793547416 (patch) | |
| tree | 6a5b351db839396c8d6912d2a0eb90fe1c94d734 /scripts/bulk_loader.py | |
| parent | 16e20c4daccb4f0e95249d8fcfe32e89bae41882 (diff) | |
python scripts: Move template config to docstring.
* Template config is now in docstring to make to more
easy to keep up-to-date.
* dbscript: --ini option to show template config.
Diffstat (limited to 'scripts/bulk_loader.py')
| -rwxr-xr-x | scripts/bulk_loader.py | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/scripts/bulk_loader.py b/scripts/bulk_loader.py index 20d37fc3..60852bea 100755 --- a/scripts/bulk_loader.py +++ b/scripts/bulk_loader.py @@ -17,6 +17,34 @@ Idea is following: The speedup from the COPY will happen only if the batches are large enough. So the ticks should happen only after couple of minutes. + +bl_sourcedb_queue_to_destdb.ini + +Config template:: + [bulk_loader] + # job name is optional when not given ini file name is used + job_name = bl_sourcedb_queue_to_destdb + + src_db = dbname=sourcedb + dst_db = dbname=destdb + + pgq_queue_name = source_queue + + use_skylog = 0 + + logfile = ~/log/%(job_name)s.log + pidfile = ~/pid/%(job_name)s.pid + + # 0 - apply UPDATE as UPDATE + # 1 - apply UPDATE as DELETE+INSERT + # 2 - merge INSERT/UPDATE, do DELETE+INSERT + load_method = 0 + + # no hurry + loop_delay = 10 + + # table renaming + # remap_tables = skypein_cdr_closed:skypein_cdr, tbl1:tbl2 """ import sys, os, pgq, skytools @@ -194,7 +222,7 @@ class TableCache: self.final_del_list = del_list class BulkLoader(pgq.SerialConsumer): - """Bulk loader script.""" + __doc__ = __doc__ load_method = METH_CORRECT remap_tables = {} def __init__(self, args): |
