A Task logger that presents our DB interface, but exists entirely in memory and implemented with dicts.
Authors:
TaskRecords are dicts of the form:
{
'msg_id' : str(uuid),
'client_uuid' : str(uuid),
'engine_uuid' : str(uuid) or None,
'header' : dict(header),
'content': dict(content),
'buffers': list(buffers),
'submitted': datetime or None,
'started': datetime or None,
'completed': datetime or None,
'received': datetime or None,
'resubmitted': str(uuid) or None,
'result_header' : dict(header) or None,
'result_content' : dict(content) or None,
'result_buffers' : list(buffers) or None,
}
With this info, many of the special categories of tasks can be defined by query, e.g.:
DictDB supports a subset of mongodb operators:
$lt,$gt,$lte,$gte,$ne,$in,$nin,$all,$mod,$exists
Bases: object
Composite filter for matching multiple properties.
Bases: IPython.config.configurable.LoggingConfigurable
Empty Parent class so traitlets work on DB.
Bases: IPython.parallel.controller.dictdb.BaseDB
Basic in-memory dict-based object for saving Task Records.
This is the first object to present the DB interface for logging tasks out of memory.
The interface is based on MongoDB, so adding a MongoDB backend should be straightforward.
Add a new Task Record, by msg_id.
Remove a record from the DB.
Remove a record from the DB.
Find records matching a query dict, optionally extracting subset of keys.
Returns dict keyed by msg_id of matching records.
Parameters: | check: dict :
keys: list of strs [optional] :
|
---|
get all msg_ids, ordered by time submitted.
Get a specific Task Record, by msg_id.
Update the data in an existing record.
Bases: IPython.parallel.controller.dictdb.BaseDB
A blackhole db backend that actually stores no information.
Provides the full DB interface, but raises KeyErrors on any method that tries to access the records. This can be used to minimize the memory footprint of the Hub when its record-keeping functionality is not required.