set_metadata(self, key, value)
This allows you to store small amounts of data on the central scheduler process for administrative purposes. Data should be msgpack serializable (ints, strings, lists, dicts)
If the key corresponds to a task then that key will be cleaned up when the task is forgotten by the scheduler.
If the key is a list then it will be assumed that you want to index into a nested dictionary structure using those keys. For example if you call the following:
>>> client.set_metadata(['a', 'b', 'c'], 123)
Then this is the same as setting
>>> scheduler.task_metadata['a']['b']['c'] = 123
The lower level dictionaries will be created on demand.
Set arbitrary metadata in the scheduler
>>> client.set_metadata('x', 123) # doctest: +SKIPThis example is valid syntax, but we were not able to check execution
... client.get_metadata('x') # doctest: +SKIP 123
>>> client.set_metadata(['x', 'y'], 123) # doctest: +SKIPThis example is valid syntax, but we were not able to check execution
... client.get_metadata('x') # doctest: +SKIP {'y': 123}
>>> client.set_metadata(['x', 'w', 'z'], 456) # doctest: +SKIPThis example is valid syntax, but we were not able to check execution
... client.get_metadata('x') # doctest: +SKIP {'y': 123, 'w': {'z': 456}}
>>> client.get_metadata(['x', 'w']) # doctest: +SKIP {'z': 456}See :
The following pages refer to to this document either explicitly or contain code examples using this.
distributed.client.Client.get_metadata
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them