Inheritance diagram for IPython.parallel.controller.dictdb:
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, ‘started’: datetime or None, ‘completed’: datetime or None, ‘resubmitted’: datetime 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:
pending: completed is None client’s outstanding: client_uuid = uuid && completed is None MIA: arrived is None (and completed is None) etc.
EngineRecords are dicts of the form: {
‘eid’ : int(id), ‘uuid’: str(uuid)
} This may be extended, but is currently.
Bases: IPython.config.configurable.LoggingConfigurable
Empty Parent class so traitlets work on DB.
Create a configurable given a config config.
Parameters : | config : Config
|
---|
Notes
Subclasses of Configurable must call the __init__() method of Configurable before doing anything else and using super():
class MyConfigurable(Configurable):
def __init__(self, config=None):
super(MyConfigurable, self).__init__(config)
# Then any other code you need to finish initialization.
This ensures that instances will be configured properly.
Get the config class config section
Get the help string for this class in ReST format.
If inst is given, it’s current trait values will be used in place of class defaults.
Get the help string for a single trait.
If inst is given, it’s current trait values will be used in place of the class default.
Get the help string for a single trait and print it.
Get a list of all the names of this classes traits.
This method is just like the trait_names() method, but is unbound.
Get a list of all the traits of this class.
This method is just like the traits() method, but is unbound.
The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.
This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Setup a handler to be called when a trait changes.
This is used to setup dynamic notifications of trait changes.
Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).
Parameters : | handler : callable
name : list, str, None
remove : bool
|
---|
A trait for unicode strings.
Get metadata values for trait by key.
Get a list of all the names of this classes traits.
Get a list of all the traits of this class.
The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.
This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.
Fire the traits events when the config is updated.
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.
Create a configurable given a config config.
Parameters : | config : Config
|
---|
Notes
Subclasses of Configurable must call the __init__() method of Configurable before doing anything else and using super():
class MyConfigurable(Configurable):
def __init__(self, config=None):
super(MyConfigurable, self).__init__(config)
# Then any other code you need to finish initialization.
This ensures that instances will be configured properly.
Add a new Task Record, by msg_id.
Get the config class config section
Get the help string for this class in ReST format.
If inst is given, it’s current trait values will be used in place of class defaults.
Get the help string for a single trait.
If inst is given, it’s current trait values will be used in place of the class default.
Get the help string for a single trait and print it.
Get a list of all the names of this classes traits.
This method is just like the trait_names() method, but is unbound.
Get a list of all the traits of this class.
This method is just like the traits() method, but is unbound.
The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.
This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
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.
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Setup a handler to be called when a trait changes.
This is used to setup dynamic notifications of trait changes.
Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).
Parameters : | handler : callable
name : list, str, None
remove : bool
|
---|
A trait for unicode strings.
Get metadata values for trait by key.
Get a list of all the names of this classes traits.
Get a list of all the traits of this class.
The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.
This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.
Fire the traits events when the config is updated.
Update the data in an existing record.
Bases: IPython.parallel.controller.dictdb.DictDB
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.
Create a configurable given a config config.
Parameters : | config : Config
|
---|
Notes
Subclasses of Configurable must call the __init__() method of Configurable before doing anything else and using super():
class MyConfigurable(Configurable):
def __init__(self, config=None):
super(MyConfigurable, self).__init__(config)
# Then any other code you need to finish initialization.
This ensures that instances will be configured properly.
Get the config class config section
Get the help string for this class in ReST format.
If inst is given, it’s current trait values will be used in place of class defaults.
Get the help string for a single trait.
If inst is given, it’s current trait values will be used in place of the class default.
Get the help string for a single trait and print it.
Get a list of all the names of this classes traits.
This method is just like the trait_names() method, but is unbound.
Get a list of all the traits of this class.
This method is just like the traits() method, but is unbound.
The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.
This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
A trait whose value must be an instance of a specified class.
The value can also be an instance of a subclass of the specified class.
Setup a handler to be called when a trait changes.
This is used to setup dynamic notifications of trait changes.
Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).
Parameters : | handler : callable
name : list, str, None
remove : bool
|
---|
A trait for unicode strings.
Get metadata values for trait by key.
Get a list of all the names of this classes traits.
Get a list of all the traits of this class.
The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.
This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.
Fire the traits events when the config is updated.