A Memcache like client to the Riak HTTP Interface
Constructor for a new riakcached.clients.RiakClient
Pool - if no pool is provided then a default riakcached.pools.Urllib3Pool is used
Parameters: |
|
---|
Add a content-type deserializer to the client
The deserializer function should have the following definition:
def deserializer(data):
return undo_something(data)
Example:
def base64_deserializer(data):
return base64.b64decode(data)
client.add_deserializer("application/base64", base64_deserializer)
Parameters: |
|
---|
Add a content-type serializer to the client
The serializer function should have the following definition:
def serializer(data):
return do_something(data)
and should return a str
Example:
def base64_serializer(data):
return base64.b64encode(data)
client.add_serializer("application/base64", base64_serializer)
Parameters: |
|
---|
Delete the provided key from the client’s bucket
Parameters: | key (str) – the key to delete |
---|---|
Returns: | bool - True if the key was removed, False otherwise |
Raises : | riakcached.exceptions.RiakcachedBadRequest |
Delete multiple keys at once from the client’s bucket
Parameters: | keys (list) – list of str keys to delete |
---|---|
Returns: | dict - the keys are the keys provided and the values are True or False from the calls to delete() |
Raises : | riakcached.exceptions.RiakcachedBadRequest |
Deserialize the provided data from content_type
This method will lookup the registered deserializer for the provided Content-Type (defaults to str(data)) and passes data through the deserializer.
Parameters: |
|
---|---|
Returns: | object - whatever the deserializer returns |
Get the value of the key from the client’s bucket
Parameters: |
|
---|---|
Returns: | object - the deserialized value of key |
Returns: | None - if the call was not successful or the key was not found |
Raises : | |
Raises : |
Get the value of multiple keys at once from the client’s bucket
Parameters: | keys (list) – the list of keys to get |
---|---|
Returns: | dict - the keys are the keys provided and the values are the results from calls to get(), except keys whose values are None are not included in the result |
Raises : | riakcached.exceptions.RiakcachedBadRequest |
Raises : | riakcached.exceptions.RiakcachedServiceUnavailable |
Increment the counter with the provided key
Parameters: |
|
---|---|
Returns: | bool - True/False whether or not it was successful |
Raises : | |
Raises : |
Get a list of all keys
Returns: | list - list of keys on the server |
---|---|
Returns: | None - when the call is not successful |
Ping the server to ensure it is up
Returns: | bool - True if it is successful, False otherwise |
---|
Get the properties for the client’s bucket
Returns: | dict - the bucket‘s set properties |
---|---|
Returns: | None - when the call is not successful |
Serialize the provided data to content_type
This method will lookup the registered serializer for the provided Content-Type (defaults to str(data)) and passes data through the serializer.
Parameters: |
|
---|---|
Returns: | str - the serialized data |
Set the value of a key for the client’s bucket
Parameters: |
|
---|---|
Returns: | bool - True if the call is successful, False otherwise |
Raises : | |
Raises : |
Set the value of multiple keys at once for the client’s bucket
Parameters: |
|
---|---|
Returns: | dict - the keys are the keys provided and the values are True or False from the calls to set() |
Raises : | |
Raises : |
A threaded version of riakcached.clients.RiakClient
The threaded version uses threads to try to parallelize the {set,get,delete}_many method calls
Constructor for a new riakcached.clients.RiakClient
Pool - if no pool is provided then a default riakcached.pools.Urllib3Pool is used
Parameters: |
|
---|
Delete multiple keys at once from the client’s bucket
Parameters: | keys (list) – list of str keys to delete |
---|---|
Returns: | dict - the keys are the keys provided and the values are True or False from the calls to delete() |
Raises : | riakcached.exceptions.RiakcachedBadRequest |
Get the value of multiple keys at once from the client’s bucket
Parameters: | keys (list) – the list of keys to get |
---|---|
Returns: | dict - the keys are the keys provided and the values are the results from calls to get(), except keys whose values are None are not included in the result |
Raises : | riakcached.exceptions.RiakcachedBadRequest |
Raises : | riakcached.exceptions.RiakcachedServiceUnavailable |
Set the value of multiple keys at once for the client’s bucket
Parameters: |
|
---|---|
Returns: | dict - the keys are the keys provided and the values are True or False from the calls to set() |
Raises : | |
Raises : |