summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Kreen2012-06-05 10:17:06 +0000
committerMarko Kreen2012-06-05 10:17:06 +0000
commit66123987d4a1a30db2323b69ebf799cb66c884c9 (patch)
tree33980c30fddaf9a79f32c999182d793f3cf7d964
parente1a17d021dbb34b4f567b705c044c86b908b3ecc (diff)
handlers: improve documentation
Add docstrings to part, londiste, qtable, qsplitter, vtable handlers.
-rw-r--r--python/londiste/handler.py7
-rw-r--r--python/londiste/handlers/part.py12
-rw-r--r--python/londiste/handlers/qtable.py11
-rw-r--r--python/londiste/handlers/vtable.py1
4 files changed, 26 insertions, 5 deletions
diff --git a/python/londiste/handler.py b/python/londiste/handler.py
index 252bf2de..87a16b62 100644
--- a/python/londiste/handler.py
+++ b/python/londiste/handler.py
@@ -120,7 +120,12 @@ class BaseHandler:
return True
class TableHandler(BaseHandler):
- """Default Londiste handler, inserts events into tables with plain SQL."""
+ """Default Londiste handler, inserts events into tables with plain SQL.
+
+ Parameters:
+ encoding=ENC - Validate and fix incoming data from encoding.
+ Only 'utf8' is supported at the moment.
+ """
handler_name = 'londiste'
sql_command = {
diff --git a/python/londiste/handlers/part.py b/python/londiste/handlers/part.py
index 6530d03d..8f0eb378 100644
--- a/python/londiste/handlers/part.py
+++ b/python/londiste/handlers/part.py
@@ -1,7 +1,10 @@
-"""Event filtering by hash.
+"""Event filtering by hash, for partitioned databases.
Parameters:
-
+ key=COLUMN: column name to use for hashing
+ hashfunc=FUNCNAME: function to use for hashing. (default: partconf.get_hash_raw)
+ hashexpr=EXPR: full expression to use for hashing (deprecated)
+ encoding=ENC: validate and fix incoming data (only utf8 supported atm)
On root node:
* Hash of key field will be added to ev_extra3.
@@ -10,10 +13,12 @@ On root node:
ev_extra3='hash='||partconf.get_hash_raw(key_column)
On branch/leaf node:
-
* On COPY time, the SELECT on provider side gets filtered by hash.
* On replay time, the events gets filtered by looking at hash in ev_extra3.
+Local config:
+* Local hash value and mask are loaded from partconf.conf table.
+
"""
import skytools
@@ -22,6 +27,7 @@ from londiste.handler import TableHandler
__all__ = ['PartHandler']
class PartHandler(TableHandler):
+ __doc__ = __doc__
handler_name = 'part'
DEFAULT_HASHFUNC = "partconf.get_hash_raw"
diff --git a/python/londiste/handlers/qtable.py b/python/londiste/handlers/qtable.py
index cd8cb03d..b93543e9 100644
--- a/python/londiste/handlers/qtable.py
+++ b/python/londiste/handlers/qtable.py
@@ -20,7 +20,11 @@ __all__ = ['QueueTableHandler', 'QueueSplitterHandler']
class QueueTableHandler(BaseHandler):
- """Queue table handler. Do nothing"""
+ """Queue table handler. Do nothing.
+
+ Trigger: before-insert, skip trigger.
+ Event-processing: do nothing.
+ """
handler_name = 'qtable'
def add(self, trigger_arg_list):
@@ -37,6 +41,11 @@ class QueueTableHandler(BaseHandler):
return False
class QueueSplitterHandler(BaseHandler):
+ """Send events for one table to another queue.
+
+ Parameters:
+ queue=QUEUE Queue name.
+ """
handler_name = 'qsplitter'
def __init__(self, table_name, args, dest_table):
diff --git a/python/londiste/handlers/vtable.py b/python/londiste/handlers/vtable.py
index 2f5fd551..19e5df0f 100644
--- a/python/londiste/handlers/vtable.py
+++ b/python/londiste/handlers/vtable.py
@@ -8,6 +8,7 @@ __all__ = ['VirtualTableHandler', 'FakeLocalHandler']
class VirtualTableHandler(BaseHandler):
"""Virtual Table.
+ Hack to get local=t for a table, but without processing any events.
"""
handler_name = 'vtable'