5.6.1.6. vlcp.service.connection.zookeeperdb¶
Note
This document is generated from the source file.
Created on 2016/10/9
| author: | hubo |
|---|
-
class
vlcp.service.connection.zookeeperdb.UpdateNotification(*args, **kwargs)¶
-
class
vlcp.service.connection.zookeeperdb.ZooKeeperDB(server)¶ Create zookeeper clients to connect to redis server
-
__init__(server)¶ Constructor
-
createnotifier(vhost=None)¶ Create a new notifier object
-
delete(key, vhost='')¶ Delete a key from the storage
-
get(key, timeout=None, vhost='')¶ Get value from key
-
getclient(vhost='')¶ Return a tuple of
(zookeeperclient, encoder, decoder)for specified vhost
-
listallkeys(vhost='')¶ Return all keys in the KVDB. For management purpose.
-
mget(keys, vhost='')¶ Get multiple values from multiple keys
-
mgetwithcache(keys, vhost='', cache=None)¶ Get multiple values, cached when possible
-
mset(kvpairs, timeout=None, vhost='')¶ Set multiple values on multiple keys
-
mupdate(keys, updater, timeout=None, vhost='')¶ Update multiple keys in-place with a custom function, see update.
Either all success, or all fail.
-
recycle(keys, vhost='')¶ Recycle extra versions from the specified keys.
-
set(key, value, timeout=None, vhost='')¶ Set value to key, with an optional timeout
-
update(key, updater, timeout=None, vhost='')¶ Update in-place with a custom function
Parameters: - key – key to update
- updater –
func(k,v), should return a new value to update, or return None to delete. The function may be call more than once. - timeout – new timeout
Returns: the updated value, or None if deleted
-
updateall(keys, updater, timeout=None, vhost='')¶ Update multiple keys in-place, with a function
updater(keys, values)which returns(updated_keys, updated_values).Either all success or all fail
-
updateallwithtime(keys, updater, timeout=None, vhost='')¶ Update multiple keys in-place, with a function
updater(keys, values, timestamp)which returns(updated_keys, updated_values).Either all success or all fail.
Timestamp is a integer standing for current time in microseconds.
-
-
exception
vlcp.service.connection.zookeeperdb.ZooKeeperResultException¶