Zookeeper Connection Classes
Zookeeper Connection object
Create a connection object, capable of automatically reconnecting when the connection is lost.
In the event the connection is lost, the zookeeper command will block until the connection is available again, or the reconnect_timeout is reached. The latter will raise an Exception about the reconnect period expiring.
Example:
conn = ZkConnection()
conn.connect()
node = conn.create(
"/my/node", "a value",
[{"perms": 0x1f, "scheme": "world", "id": "anyone"}],
0)
Note
ZkConnection ensures that all zookeeper functions use the same zookeeper handle that ZkConnection has, so it does not need to be passed in as the first argument.
Parameters: |
|
---|