=================
Project description
devtree
The devtree recipe sets up temporary ZooKeeper tree for a buildout:
[myproject] recipe = zc.zookeeperrecipes:devtree import-file = tree.txt
In this example, we’re creating a ZooKeeper tree at the path /myprojectYYYY-MM-DDTHH:MM:SS.SSSSSS with data imported from the buildout-local file tree.txt, where YYYY-MM-DDTHH:MM:SS.SSSSSS is the ISO date-time when the node was created.
The devtree recipe options are:
- zookeeper
Optional ZooKeeper connection string.
It defaults to ‘127.0.0.1:2181’.
- path
Optional path at which to create the tree.
If not provided, the part name is used, with a leading / added.
When a devtree part is installed, a path is created at a path derived from the given (or implied) path by adding the current date and time to the path in ISO date-time format (YYYY-MM-DDTHH:MM:SS.SSSSSS). The derived path is stored a file in the buildout parts directory with a name equal to the section name.
- effective-path
Optional path to be used as is.
This option is normally computed by the recipe and is queryable from other recipes, but it may also be set explicitly.
- import-file
Optional import file.
This is the name of a file containing tree-definition text. See the zc.zk documentation for information on the format of this file.
- import-text
Optional import text.
Unfortunately, because of the way buildout parses configuration files, leading whitespace is stripped, making this option hard to specify.
- helper-scripts
Helper-script prefix
If provided, 4 helper scripts will be generated with the given prefix:
- PREFIXexport
Export a zookeepeer tree.
- PREFIXimport
Import a zookeepeer tree.
- PREFIXprint
Print a zookeepeer tree.
- PREFIXport
Print the port of the first child of a given path.
Where PREFIX is the profix given to the helper-scripts option.
Cleanup
We don’t want trees to accumulate indefinately. When using a local zookeeper (default), when the recipe is run, the entire tree is scanned looking for nodes that have buildout:location properties with paths that no-longer exist in the local file system paths that contain different ZooKeeper paths.
If such nodes are found, then the nodes are removed and, if the nodes had any ephemeral subnodes with pids, those pids are sent a SIGTERM signal.
Change History
0.2.0 (2011-02-22)
Add an option to define buildout-specific helper scripts for working with the buildout’s ZooKeeper tree.
0.1.2 (2011-02-13)
- Fixed: default ZooKeeper connection string wasn’t set as option and
was thus not usable from other parts.
0.1.1 (2011-02-09)
Fixed a packaging bug.
0.1.0 (2011-02-02)
Initial release
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for zc.zookeeperrecipes-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | da614c01da3e577c55e44c20561e5a5d10c1c30f968da06d822084c276db0343 |
|
MD5 | 315af53d1c5765b7230da2f5cd18e1fd |
|
BLAKE2b-256 | 26fbd02302b4e9646b364ff86b3879dc89d40c45543c26f3bd90df8a4b6aa5da |