PK Ԉ-CeEG G riakcached-latest/pools.html
A Riak HTTP request connection pool base class
This is the base class that should be used for any custom connection pool to be used by any of the riakcached.clients.RiakClient
Constructs a new riakcached.pools.Pool
Parameters: |
|
---|
Makes a single HTTP request
Parameters: |
|
---|---|
Returns: | tuple - status, data, headers |
Raises : | |
Raises : |
A subclass of riakcached.pools.Pool which uses urllib3 for requests
Constructs a new riakcached.pools.Pool
Parameters: |
|
---|
Makes a single HTTP request
Parameters: |
|
---|---|
Returns: | tuple - status, data, headers |
Raises : | |
Raises : |
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 : |
Please activate JavaScript to enable the search functionality.
From here you can search these documents. Enter your search words into the box below and click "search". Note that the search function will automatically search for all of the words. Pages containing fewer words won't appear in the result list.
Exception that is raised for unexpected HTTP 400 status responses
Inherits from riakcached.exceptions.RiakcachedException
Exception that is raised for unexpected HTTP 409 status responses
Inherits from riakcached.exceptions.RiakcachedException
Exception that is raised when pool requests raises an HTTPError
Inherits from riakcached.exceptions.RiakcachedException
Exception that is raised for unexpected HTTP 204 status responses
Inherits from riakcached.exceptions.RiakcachedException
Exception that is raised for unexpected HTTP 412 status responses
Inherits from riakcached.exceptions.RiakcachedException
Exception that is raised for unexpected HTTP 503 status responses
Inherits from riakcached.exceptions.RiakcachedException
Exception that is raised when pool requests takes too long
Inherits from riakcached.exceptions.RiakcachedException
Contents:
A Memcached like interface to the Riak HTTP Client. Read The Docs
pip install riakcached
git clone git://github.com/brettlangdon/riakcached.git
cd ./riakcached
pip install -r requirements.txt
python setup.py install
from riakcached.clients import RiakClient
client = RiakClient("my_bucket")
client.set("hello", "world")
print client.get("hello")
# 'hello'
client.delete("hello")
print client.get("hello")
# None
values = {
"hello": "world",
"foo": "bar",
}
client.set_many(values)
keys = ["hello", "foo", "test"]
print client.get_many(keys)
# {'foo': 'bar', 'hello': 'world'}
client.close()
from riakcached.clients import RiakClient
from riakcached.pools import Urllib3Pool
pool = Urllib3Pool(base_url="http://my-host.com:8098/", timeout=1)
client = RiakClient("my_bucket", pool=pool)
client.get("foo")
from riakcached.clients import RiakClient
from riakcache.pools import Pool
class CustomPool(Pool):
__slots__ = ["connection"]
def connect(self):
self.connection = make_a_connection()
def close(self):
if self.connection:
close_connection(self.connection)
def request(self, method, url, body=None, headers=None):
results = make_request(self.connection, method, url, body, headers, timeout=self.timeout)
return results.status, results.data, results.headers
custom_pool = CustomPool(base_url="http://my-host.com:8098", timeout=1)
client = RiakClient("my_bucket", pool=pool)
The exists a riakcached.clients.ThreadedRiakClient which inherits from riakcached.clients.RiakClient and which uses threading to try to parallelize calls to get_many, set_many and delete_many.
import urllib3
from riakcached import exceptions
[docs]class Pool(object):
"""A Riak HTTP request connection pool base class
This is the base class that should be used for any custom connection
pool to be used by any of the :class:`riakcached.clients.RiakClient`
"""
__slots__ = ["timeout", "url"]
def __init__(self, base_url="http://127.0.0.1:8098", timeout=2, auto_connect=True):
"""Constructs a new :class:`riakcached.pools.Pool`
:param base_url: the base url that the client should use for requests
:type base_url: str
:param timeout: the connection timeout to use
:type timeout: int
:param auto_connect: whether or not to call :func:`connect` on __init__
:type auto_connect: bool
"""
self.url = base_url
self.timeout = timeout
if auto_connect:
self.connect()
[docs] def connect(self):
"""Create the connection pool
"""
raise NotImplementedError("You must not use %s directly" % self.__class__.__name__)
[docs] def close(self):
"""Closes the connection pool if it is opened
"""
raise NotImplementedError("You must not use %s directly" % self.__class__.__name__)
[docs] def request(self, method, url, body=None, headers=None):
"""Makes a single HTTP request
:param method: the HTTP method to make the requets with
:type method: str
:param url: the full url for the request
:type url: str
:param body: the data to POST or PUT with the request
:type body: str
:param headers: extra headers to add to the request
:type headers: dict
:returns: tuple - status, data, headers
:raises: :class:`riakcached.exceptions.RiakcachedTimeout`
:raises: :class:`riakcached.exceptions.RiakcachedConnectionError`
"""
raise NotImplementedError("You must not use %s directly" % self.__class__.__name__)
[docs]class Urllib3Pool(Pool):
"""A subclass of :class:`riakcached.pools.Pool` which uses `urllib3` for requests
"""
__slots__ = ["pool"]
[docs] def connect(self):
"""Create the connection pool
"""
self.pool = urllib3.connection_from_url(self.url)
[docs] def close(self):
"""Closes the connection pool if it is opened
"""
if self.pool:
self.pool.close()
[docs] def request(self, method, url, body=None, headers=None):
"""Makes a single HTTP request
:param method: the HTTP method to make the requets with
:type method: str
:param url: the full url for the request
:type url: str
:param body: the data to POST or PUT with the request
:type body: str
:param headers: extra headers to add to the request
:type headers: dict
:returns: tuple - status, data, headers
:raises: :class:`riakcached.exceptions.RiakcachedTimeout`
:raises: :class:`riakcached.exceptions.RiakcachedConnectionError`
"""
try:
response = self.pool.urlopen(
method=method,
url=url,
body=body,
headers=headers,
timeout=self.timeout,
redirect=False,
)
return response.status, response.data, response.getheaders()
except urllib3.exceptions.TimeoutError, e:
raise exceptions.RiakcachedTimeout(e.message)
except urllib3.exceptions.HTTPError, e:
raise exceptions.RiakcachedConnectionError(e.message)
__all__ = ["RiakClient", "ThreadedRiakClient"]
import json
import Queue
import threading
from riakcached import exceptions
from riakcached.pools import Urllib3Pool
[docs]class RiakClient(object):
"""A Memcache like client to the Riak HTTP Interface
"""
__slots__ = [
"_serializers",
"_deserializers",
"base_url",
"bucket",
"pool",
]
def __init__(self, bucket, pool=None):
"""Constructor for a new :class:`riakcached.clients.RiakClient`
Pool - if no pool is provided then a default :class:`riakcached.pools.Urllib3Pool` is used
:param bucket: The name of the Riak bucket to use
:type bucket: str
:param pool: The :class:`riakcached.pools.Pool` to use for requests
:type pool: :class:`riakcached.pools.Pool`
"""
if pool is None:
self.pool = Urllib3Pool()
else:
self.pool = pool
self.bucket = bucket
self.base_url = self.pool.url.rstrip("/")
self._serializers = {
"application/json": json.dumps,
}
self._deserializers = {
"application/json": json.loads,
}
[docs] def add_serializer(self, content_type, serializer):
"""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)
:param content_type: the content-type to associate `serializer` with
:type content_type: str
:param serializer: the serializer function to use with `content_type`
:type serializer: function
"""
content_type = content_type.lower()
self._serializers[content_type] = serializer
[docs] def add_deserializer(self, content_type, deserializer):
"""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)
:param content_type: the content-type to associate `deserializer` with
:type content_type: str
:param deserializer: the deserializer function to use with `content_type`
:type deserializer: function
"""
content_type = content_type.lower()
self._deserializers[content_type] = deserializer
[docs] def serialize(self, data, content_type):
"""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.
:param data: the data to serialize
:type data: object
:param content_type: the desired Content-Type for the provided `data`
:type content_type: str
:returns: str - the serialized data
"""
serializer = self._serializers.get(content_type, str)
return serializer(data)
[docs] def deserialize(self, data, content_type):
"""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.
:param data: the data to deserialize
:type data: str
:param content_type: the Content-Type to deserialize `data` from
:type content_type: str
:returns: object - whatever the deserializer returns
"""
deserializer = self._deserializers.get(content_type, str)
return deserializer(data)
[docs] def get(self, key, counter=False):
"""Get the value of the key from the client's `bucket`
:param key: the key to get from the bucket
:type key: str
:param counter: whether or not the `key` is a counter
:type counter: bool
:returns: object - the deserialized value of `key`
:returns: None - if the call was not successful or the key was not found
:raises: :class:`riakcached.exceptions.RiakcachedBadRequest`
:raises: :class:`riakcached.exceptions.RiakcachedServiceUnavailable`
"""
url = "%s/buckets/%s/keys/%s" % (self.base_url, self.bucket, key)
if counter:
url = "%s/buckets/%s/counters/%s" % (self.base_url, self.bucket, key)
status, data, headers = self.pool.request(method="GET", url=url)
if status == 400:
raise exceptions.RiakcachedBadRequest(data)
elif status == 503:
raise exceptions.RiakcachedServiceUnavailable(data)
if status not in (200, 300, 304):
return None
return self.deserialize(data, headers.get("content-type", "text/plain"))
[docs] def get_many(self, keys):
"""Get the value of multiple keys at once from the client's `bucket`
:param keys: the list of keys to get
:type keys: list
:returns: dict - the keys are the keys provided and the values are the results from calls
to :func:`get`, except keys whose values are `None` are not included in the result
:raises: :class:`riakcached.exceptions.RiakcachedBadRequest`
:raises: :class:`riakcached.exceptions.RiakcachedServiceUnavailable`
"""
results = dict((key, self.get(key)) for key in keys)
return dict((key, value) for key, value in results.iteritems() if value is not None)
[docs] def set(self, key, value, content_type="text/plain"):
"""Set the value of a key for the client's `bucket`
:param key: the key to set the value for
:type key: str
:param value: the value to set, this will get serialized for the `content_type`
:type value: object
:param content_type: the Content-Type for `value`
:type content_type: str
:returns: bool - True if the call is successful, False otherwise
:raises: :class:`riakcached.exceptions.RiakcachedBadRequest`
:raises: :class:`riakcached.exceptions.RiakcachedPreconditionFailed`
"""
value = self.serialize(value, content_type)
status, data, _ = self.pool.request(
method="POST",
url="%s/buckets/%s/keys/%s" % (self.base_url, self.bucket, key),
body=value,
headers={
"Content-Type": content_type,
},
)
if status == 400:
raise exceptions.RiakcachedBadRequest(data)
elif status == 412:
raise exceptions.RiakcachedPreconditionFailed(data)
return status in (200, 201, 204, 300)
[docs] def set_many(self, values, content_type="text/plain"):
"""Set the value of multiple keys at once for the client's `bucket`
:param values: the key -> value pairings for the keys to set
:type values: dict
:param content_type: the Content-Type for all of the values provided
:type content_type: str
:returns: dict - the keys are the keys provided and the values are True or False from
the calls to :func:`set`
:raises: :class:`riakcached.exceptions.RiakcachedBadRequest`
:raises: :class:`riakcached.exceptions.RiakcachedPreconditionFailed`
"""
return dict(
(key, self.set(key, value, content_type))
for key, value in values.iteritems()
)
[docs] def delete(self, key):
"""Delete the provided key from the client's `bucket`
:param key: the key to delete
:type key: str
:returns: bool - True if the key was removed, False otherwise
:raises: :class:`riakcached.exceptions.RiakcachedBadRequest`
"""
status, data, _ = self.pool.request(
method="DELETE",
url="%s/buckets/%s/keys/%s" % (self.base_url, self.bucket, key),
)
if status == 400:
raise exceptions.RiakcachedBadRequest(data)
return status in (204, 404)
[docs] def delete_many(self, keys):
"""Delete multiple keys at once from the client's `bucket`
:param keys: list of `str` keys to delete
:type keys: list
:returns: dict - the keys are the keys provided and the values are True or False from
the calls to :func:`delete`
:raises: :class:`riakcached.exceptions.RiakcachedBadRequest`
"""
return dict((key, self.delete(key)) for key in keys)
[docs] def stats(self):
"""Get the server stats
:returns: dict - the stats from the server
:returns: None - when the call is not successful
"""
status, data, _ = self.pool.request(
method="GET",
url="%s/stats" % self.base_url,
)
if status == 200:
return self.deserialize(data, "application/json")
return None
[docs] def props(self):
"""Get the properties for the client's `bucket`
:returns: dict - the `bucket`'s set properties
:returns: None - when the call is not successful
"""
status, data, _ = self.pool.request(
method="GET",
url="%s/buckets/%s/props" % (self.base_url, self.bucket),
)
if status == 200:
return json.loads(data)
return None
[docs] def set_props(self, props):
"""Set the properties for the client's `bucket`
:param props: the properties to set
:type props: dict
:returns: bool - True if it is successful otherwise False
"""
status, _, _ = self.pool.request(
method="PUT",
url="%s/buckets/%s/props" % (self.base_url, self.bucket),
body=self.serialize(props, "application/json"),
headers={
"Content-Type": "application/json",
}
)
return status == 200
[docs] def keys(self):
"""Get a list of all keys
:returns: list - list of keys on the server
:returns: None - when the call is not successful
"""
status, data, _ = self.pool.request(
method="GET",
url="%s/buckets/%s/keys?keys=true" % (self.base_url, self.bucket),
)
if status == 200:
return self.deserialize(data, "application/json")
return None
[docs] def ping(self):
"""Ping the server to ensure it is up
:returns: bool - True if it is successful, False otherwise
"""
status, _, _ = self.pool.request(
method="GET",
url="%s/ping" % self.base_url,
)
return status == 200
[docs] def incr(self, key, value=1):
"""Increment the counter with the provided key
:param key: the counter to increment
:type key: str
:param value: how much to increment by
:type value: int
:returns: bool - True/False whether or not it was successful
:raises: :class:`riakcached.exceptions.RiakcachedConflict`
:raises: :class:`riakcached.exceptions.RiakcachedBadRequest`
"""
status, data, _ = self.pool.request(
method="POST",
url="%s/buckets/%s/counters/%s" % (self.base_url, self.bucket, key),
body=str(value),
)
if status == 409:
raise exceptions.RiakcachedConflict(data)
elif status == 400:
raise exceptions.RiakcachedBadRequest(data)
return status in (200, 201, 204, 300)
[docs]class ThreadedRiakClient(RiakClient):
"""A threaded version of :class:`riakcached.clients.RiakClient`
The threaded version uses threads to try to parallelize the {set,get,delete}_many method calls
"""
def _many(self, target, args_list):
workers = []
worker_results = Queue.Queue()
for args in args_list:
args.append(worker_results)
worker = threading.Thread(target=target, args=args)
worker.daemon = True
worker.start()
workers.append(worker)
for worker in workers:
worker.join()
results = {}
while not worker_results.empty():
key, value = worker_results.get()
results[key] = value
return results
[docs] def delete_many(self, keys):
"""Delete multiple keys at once from the client's `bucket`
:param keys: list of `str` keys to delete
:type keys: list
:returns: dict - the keys are the keys provided and the values are True or False from
the calls to :func:`delete`
:raises: :class:`riakcached.exceptions.RiakcachedBadRequest`
"""
def worker(key, results):
results.put((key, self.delete(key)))
args = [[key] for key in keys]
return self._many(worker, args)
[docs] def set_many(self, values):
"""Set the value of multiple keys at once for the client's `bucket`
:param values: the key -> value pairings for the keys to set
:type values: dict
:param content_type: the Content-Type for all of the values provided
:type content_type: str
:returns: dict - the keys are the keys provided and the values are True or False from
the calls to :func:`set`
:raises: :class:`riakcached.exceptions.RiakcachedBadRequest`
:raises: :class:`riakcached.exceptions.RiakcachedPreconditionFailed`
"""
def worker(key, value, results):
results.put((key, self.set(key, value)))
args = [list(data) for data in values.items()]
return self._many(worker, args)
[docs] def get_many(self, keys):
"""Get the value of multiple keys at once from the client's `bucket`
:param keys: the list of keys to get
:type keys: list
:returns: dict - the keys are the keys provided and the values are the results from calls
to :func:`get`, except keys whose values are `None` are not included in the result
:raises: :class:`riakcached.exceptions.RiakcachedBadRequest`
:raises: :class:`riakcached.exceptions.RiakcachedServiceUnavailable`
"""
def worker(key, results):
results.put((key, self.get(key)))
args = [[key] for key in keys]
results = self._many(worker, args)
results = dict((key, value) for key, value in results.iteritems() if value is not None)
return results or None
[docs]class RiakcachedBadRequest(RiakcachedException):
"""Exception that is raised for unexpected HTTP 400 status responses
Inherits from :class:`riakcached.exceptions.RiakcachedException`
"""
pass
[docs]class RiakcachedNotFound(RiakcachedException):
"""Exception that is raised for unexpected HTTP 204 status responses
Inherits from :class:`riakcached.exceptions.RiakcachedException`
"""
pass
[docs]class RiakcachedPreconditionFailed(RiakcachedException):
"""Exception that is raised for unexpected HTTP 412 status responses
Inherits from :class:`riakcached.exceptions.RiakcachedException`
"""
pass
[docs]class RiakcachedConflict(RiakcachedException):
"""Exception that is raised for unexpected HTTP 409 status responses
Inherits from :class:`riakcached.exceptions.RiakcachedException`
"""
pass
[docs]class RiakcachedTimeout(RiakcachedException):
"""Exception that is raised when pool requests takes too long
Inherits from :class:`riakcached.exceptions.RiakcachedException`
"""
pass
[docs]class RiakcachedConnectionError(RiakcachedException):
"""Exception that is raised when pool requests raises an `HTTPError`
Inherits from :class:`riakcached.exceptions.RiakcachedException`
"""
pass
__all__ = ["RiakClient"]
import json
import Queue
import threading
import urllib3
from riakcached import exceptions
[docs]class RiakClient(object):
"""
"""
__slots__ = [
"_serializers",
"_deserializers",
"_pool",
"_timeout",
"bucket",
"url",
]
def __init__(self, bucket, url="http://127.0.0.1:8098", timeout=2, auto_connect=True):
"""
"""
self.bucket = bucket
self.url = url.strip("/")
self._timeout = timeout
self._serializers = {
"application/json": json.dumps,
}
self._deserializers = {
"application/json": json.loads,
}
if auto_connect:
self._connect()
[docs] def add_serializer(self, content_type, serializer):
"""
"""
content_type = content_type.lower()
self._serializers[content_type] = serializer
[docs] def add_deserializer(self, content_type, deserializer):
"""
"""
content_type = content_type.lower()
self._deserializers[content_type] = deserializer
[docs] def serialize(self, data, content_type):
"""
"""
serializer = self._serializers.get(content_type, str)
return serializer(data)
[docs] def deserialize(self, data, content_type):
"""
"""
deserializer = self._deserializers.get(content_type, str)
return deserializer(data)
[docs] def get(self, key, counter=False):
"""
"""
url = "%s/buckets/%s/keys/%s" % (self.url, self.bucket, key)
if counter:
url = "%s/buckets/%s/counters/%s" % (self.url, self.bucket, key)
response = self._request(method="GET", url=url)
if response.status == 400:
raise exceptions.RiakcachedBadRequest(response.data)
elif response.status == 503:
raise exceptions.RiakcachedServiceUnavailable(response.data)
if response.status not in (200, 300, 304):
return None
return self.deserialize(response.data, response.getheader("content-type"))
[docs] def get_many(self, keys):
"""
"""
def worker(key, results):
results.put((key, self.get(key)))
args = [[key] for key in keys]
results = self._many(worker, args)
results = dict((key, value) for key, value in results.iteritems() if value is not None)
return results or None
[docs] def set(self, key, value, content_type="text/plain"):
"""
"""
value = self.serialize(value, content_type)
response = self._request(
method="POST",
url="%s/buckets/%s/keys/%s" % (self.url, self.bucket, key),
body=value,
headers={
"Content-Type": content_type,
},
)
if response.status == 400:
raise exceptions.RiakcachedBadRequest(response.data)
elif response.status == 412:
raise exceptions.RiakcachedPreconditionFailed(response.data)
return response.status in (200, 201, 204, 300)
[docs] def set_many(self, values):
"""
"""
def worker(key, value, results):
results.put((key, self.set(key, value)))
args = [list(data) for data in values.items()]
return self._many(worker, args)
[docs] def delete(self, key):
"""
"""
response = self._request(
method="DELETE",
url="%s/buckets/%s/keys/%s" % (self.url, self.bucket, key),
)
if response.status == 400:
raise exceptions.RiakcachedBadRequest(response.data)
return response.status in (204, 404)
[docs] def delete_many(self, keys):
"""
"""
def worker(key, results):
results.put((key, self.delete(key)))
args = [[key] for key in keys]
return self._many(worker, args)
[docs] def stats(self):
"""
"""
response = self._request(
method="GET",
url="%s/stats" % self.url,
)
if response.status == 200:
return self.deserialize(response.data, "application/json")
return None
[docs] def props(self):
"""
"""
response = self._request(
method="GET",
url="%s/buckets/%s/props" % (self.url, self.bucket),
)
if response.status == 200:
return json.loads(response.data)
return None
[docs] def set_props(self, props):
"""
"""
response = self._request(
method="PUT",
url="%s/buckets/%s/props" % (self.url, self.bucket),
body=self.serialize(props, "application/json"),
headers={
"Content-Type": "application/json",
}
)
return response.status == 200
[docs] def keys(self):
"""
"""
response = self._request(
method="GET",
url="%s/buckets/%s/keys?keys=true" % (self.url, self.bucket),
)
if response.status == 200:
return self.deserialize(response.data, "application/json")
return None
[docs] def ping(self):
"""
"""
response = self._request(
method="GET",
url="%s/ping" % self.url,
)
return response.status == 200
[docs] def incr(self, key, value=1):
"""
"""
response = self._request(
method="POST",
url="%s/buckets/%s/counters/%s" % (self.url, self.bucket, key),
body=str(value),
)
if response.status == 409:
raise exceptions.RiakcachedConflict(response.data)
elif response.status == 400:
raise exceptions.RiakcachedBadRequest(response.data)
return response.status in (200, 201, 204, 300)
def _connect(self):
self._pool = urllib3.connection_from_url(self.url)
def _request(self, method, url, body=None, headers=None):
try:
return self._pool.urlopen(
method=method,
url=url,
body=body,
headers=headers,
timeout=self._timeout,
redirect=False,
)
except urllib3.exceptions.TimeoutError, e:
raise exceptions.RiakcachedTimeout(e.message)
except urllib3.exceptions.HTTPError, e:
raise exceptions.RiakcachedConnectionError(e.message)
def _many(self, target, args_list):
workers = []
worker_results = Queue.Queue()
for args in args_list:
args.append(worker_results)
worker = threading.Thread(target=target, args=args)
worker.daemon = True
worker.start()
workers.append(worker)
for worker in workers:
worker.join()
results = {}
while not worker_results.empty():
key, value = worker_results.get()
results[key] = value
return results
(hh7hh5ubaubcsphinx.addnodes index q?)q@}qA(hU hhh UqBh%UindexqCh'}qD(h,]h+]h)]h*]h/]Uentries]qE(UsingleqFX riakcached.exceptions (module)X module-riakcached.exceptionsU tqGauh1Kh2hh]ubh?)qH}qI(hU hhh X /var/build/user_builds/riakcached/checkouts/latest/riakcached/exceptions.py:docstring of riakcached.exceptions.RiakcachedBadRequestqJh%hCh'}qK(h,]h+]h)]h*]h/]Uentries]qL(hFX RiakcachedBadRequestqMhU tqNauh1Nh2hh]ubcsphinx.addnodes desc qO)qP}qQ(hU hhh hJh%UdescqRh'}qS(UnoindexqTUdomainqUX pyh,]h+]h)]h*]h/]UobjtypeqVX exceptionqWUdesctypeqXhWuh1Nh2hh]qY(csphinx.addnodes desc_signature qZ)q[}q\(hhMhhPh U q]h%Udesc_signatureq^h'}q_(h,]q`haUmoduleqah!X riakcached.exceptionsqbqc}qdbh+]h)]h*]h/]qehaUfullnameqfhMUclassqgU Ufirstqhuh1Nh2hh]qi(csphinx.addnodes desc_annotation qj)qk}ql(hX exception hh[h h]h%Udesc_annotationqmh'}qn(h)]h*]h+]h,]h/]uh1Nh2hh]qoh;X exception qpqq}qr(hU hhkubaubcsphinx.addnodes desc_addname qs)qt}qu(hX riakcached.exceptions.hh[h h]h%Udesc_addnameqvh'}qw(h)]h*]h+]h,]h/]uh1Nh2hh]qxh;X riakcached.exceptions.qyqz}q{(hU hhtubaubcsphinx.addnodes desc_name q|)q}}q~(hhMhh[h h]h%U desc_nameqh'}q(h)]h*]h+]h,]h/]uh1Nh2hh]qh;X RiakcachedBadRequestqq}q(hU hh}ubaubcsphinx.addnodes only q)q}q(hU hh[h Nh%Uonlyqh'}q(UexprUhtmlqh,]h+]h)]h*]h/]uh1Nh2hh]qcsphinx.addnodes pending_xref q)q}q(hU h'}q(UreftypeUviewcodeqUrefdocU exceptionsqU refdomainUstdqh,]h+]Urefexplicith)]h*]h/]U reftargetX _modules/riakcached/exceptionsUrefidhMuhhh]qcdocutils.nodes inline q)q}q(hU h'}q(h)]h*]qU viewcode-linkqah+]h,]h/]uhhh]qh;X [source]qq}q(hU hhubah%Uinlinequbah%Upending_xrefqubaubeubcsphinx.addnodes desc_content q)q}q(hU hhPh h]h%Udesc_contentqh'}q(h)]h*]h+]h,]h/]uh1Nh2hh]q(cdocutils.nodes paragraph q)q}q(hXA Exception that is raised for unexpected HTTP 400 status responsesqhhh hJh%U paragraphqh'}q(h)]h*]h+]h,]h/]uh1Kh2hh]qh;XA Exception that is raised for unexpected HTTP 400 status responsesqq}q(hhhhubaubh)q}q(hX@ Inherits from :class:`riakcached.exceptions.RiakcachedException`hhh hJh%hh'}q(h)]h*]h+]h,]h/]uh1Kh2hh]q(h;X Inherits from qq}q(hX Inherits from hhubh)q}q(hX2 :class:`riakcached.exceptions.RiakcachedException`qhhh Nh%hh'}q(UreftypeX classUrefwarnqU reftargetqX) riakcached.exceptions.RiakcachedExceptionU refdomainX pyqh,]h+]Urefexplicith)]h*]h/]UrefdocqhUpy:classqhMU py:moduleqX riakcached.exceptionsquh1Nh]qcdocutils.nodes literal q)q}q(hhh'}q(h)]h*]q(UxrefqhX py-classqeh+]h,]h/]uhhh]qh;X) riakcached.exceptions.RiakcachedExceptionq˅q}q(hU hhubah%Uliteralqubaubeubeubeubh?)q}q(hU hhh X /var/build/user_builds/riakcached/checkouts/latest/riakcached/exceptions.py:docstring of riakcached.exceptions.RiakcachedConflictqh%hCh'}q(h,]h+]h)]h*]h/]Uentries]q(hFX RiakcachedConflictqh U tqauh1Nh2hh]ubhO)q}q(hU hhh hh%hRh'}q(hThUX pyh,]h+]h)]h*]h/]hVX exceptionqhXhuh1Nh2hh]q(hZ)q}q(hhhhh h]h%h^h'}q(h,]qh ahah!X riakcached.exceptionsq߅q}qbh+]h)]h*]h/]qh ahfhhgU hhuh1Nh2hh]q(hj)q}q(hX exception hhh h]h%hmh'}q(h)]h*]h+]h,]h/]uh1Nh2hh]qh;X exception q腁q}q(hU hhubaubhs)q}q(hX riakcached.exceptions.hhh h]h%hvh'}q(h)]h*]h+]h,]h/]uh1Nh2hh]qh;X riakcached.exceptions.qq}q(hU hhubaubh|)q}q(hhhhh h]h%hh'}q(h)]h*]h+]h,]h/]uh1Nh2hh]qh;X RiakcachedConflictqq}q(hU hhubaubh)q}q(hU hhh Nh%hh'}q(Uexprhh,]h+]h)]h*]h/]uh1Nh2hh]qh)q}q(hU h'}q(UreftypehUrefdochU refdomainhh,]h+]Urefexplicith)]h*]h/]U reftargetX _modules/riakcached/exceptionsUrefidhuhhh]r h)r }r (hU h'}r (h)]h*]r hah+]h,]h/]uhhh]r h;X [source]r r }r (hU hj ubah%hubah%hubaubeubh)r }r (hU hhh h]h%hh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r (h)r }r (hXA Exception that is raised for unexpected HTTP 409 status responsesr hj h hh%hh'}r (h)]h*]h+]h,]h/]uh1Kh2hh]r h;XA Exception that is raised for unexpected HTTP 409 status responsesr r }r (hj hj ubaubh)r }r (hX@ Inherits from :class:`riakcached.exceptions.RiakcachedException`hj h hh%hh'}r (h)]h*]h+]h,]h/]uh1Kh2hh]r (h;X Inherits from r r }r (hX Inherits from hj ubh)r }r (hX2 :class:`riakcached.exceptions.RiakcachedException`r hj h Nh%hh'}r (UreftypeX classhhX) riakcached.exceptions.RiakcachedExceptionU refdomainX pyr h,]h+]Urefexplicith)]h*]h/]hhhhhhuh1Nh]r! h)r" }r# (hj h'}r$ (h)]h*]r% (hj X py-classr& eh+]h,]h/]uhj h]r' h;X) riakcached.exceptions.RiakcachedExceptionr( r) }r* (hU hj" ubah%hubaubeubeubeubh?)r+ }r, (hU hhh X /var/build/user_builds/riakcached/checkouts/latest/riakcached/exceptions.py:docstring of riakcached.exceptions.RiakcachedConnectionErrorr- h%hCh'}r. (h,]h+]h)]h*]h/]Uentries]r/ (hFX RiakcachedConnectionErrorr0 hU tr1 auh1Nh2hh]ubhO)r2 }r3 (hU hhh j- h%hRh'}r4 (hThUX pyh,]h+]h)]h*]h/]hVX exceptionr5 hXj5 uh1Nh2hh]r6 (hZ)r7 }r8 (hj0 hj2 h h]h%h^h'}r9 (h,]r: hahah!X riakcached.exceptionsr; r< }r= bh+]h)]h*]h/]r> hahfj0 hgU hhuh1Nh2hh]r? (hj)r@ }rA (hX exception hj7 h h]h%hmh'}rB (h)]h*]h+]h,]h/]uh1Nh2hh]rC h;X exception rD rE }rF (hU hj@ ubaubhs)rG }rH (hX riakcached.exceptions.hj7 h h]h%hvh'}rI (h)]h*]h+]h,]h/]uh1Nh2hh]rJ h;X riakcached.exceptions.rK rL }rM (hU hjG ubaubh|)rN }rO (hj0 hj7 h h]h%hh'}rP (h)]h*]h+]h,]h/]uh1Nh2hh]rQ h;X RiakcachedConnectionErrorrR rS }rT (hU hjN ubaubh)rU }rV (hU hj7 h Nh%hh'}rW (Uexprhh,]h+]h)]h*]h/]uh1Nh2hh]rX h)rY }rZ (hU h'}r[ (UreftypehUrefdochU refdomainhh,]h+]Urefexplicith)]h*]h/]U reftargetX _modules/riakcached/exceptionsUrefidj0 uhjU h]r\ h)r] }r^ (hU h'}r_ (h)]h*]r` hah+]h,]h/]uhjY h]ra h;X [source]rb rc }rd (hU hj] ubah%hubah%hubaubeubh)re }rf (hU hj2 h h]h%hh'}rg (h)]h*]h+]h,]h/]uh1Nh2hh]rh (h)ri }rj (hXA Exception that is raised when pool requests raises an `HTTPError`hje h j- h%hh'}rk (h)]h*]h+]h,]h/]uh1Kh2hh]rl (h;X6 Exception that is raised when pool requests raises an rm rn }ro (hX6 Exception that is raised when pool requests raises an hji ubcdocutils.nodes title_reference rp )rq }rr (hX `HTTPError`h'}rs (h)]h*]h+]h,]h/]uhji h]rt h;X HTTPErrorru rv }rw (hU hjq ubah%Utitle_referencerx ubeubh)ry }rz (hX@ Inherits from :class:`riakcached.exceptions.RiakcachedException`hje h j- h%hh'}r{ (h)]h*]h+]h,]h/]uh1Kh2hh]r| (h;X Inherits from r} r~ }r (hX Inherits from hjy ubh)r }r (hX2 :class:`riakcached.exceptions.RiakcachedException`r hjy h Nh%hh'}r (UreftypeX classhhX) riakcached.exceptions.RiakcachedExceptionU refdomainX pyr h,]h+]Urefexplicith)]h*]h/]hhhj0 hhuh1Nh]r h)r }r (hj h'}r (h)]h*]r (hj X py-classr eh+]h,]h/]uhj h]r h;X) riakcached.exceptions.RiakcachedExceptionr r }r (hU hj ubah%hubaubeubeubeubh?)r }r (hU hhh X /var/build/user_builds/riakcached/checkouts/latest/riakcached/exceptions.py:docstring of riakcached.exceptions.RiakcachedExceptionr h%hCh'}r (h,]h+]h)]h*]h/]Uentries]r (hFX RiakcachedExceptionr h U tr auh1Nh2hh]ubhO)r }r (hU hhh j h%hRh'}r (hThUX pyh,]h+]h)]h*]h/]hVX exceptionr hXj uh1Nh2hh]r (hZ)r }r (hj hj h h]h%h^h'}r (h,]r h ahah!X riakcached.exceptionsr r }r bh+]h)]h*]h/]r h ahfj hgU hhuh1Nh2hh]r (hj)r }r (hX exception hj h h]h%hmh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X exception r r }r (hU hj ubaubhs)r }r (hX riakcached.exceptions.hj h h]h%hvh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X riakcached.exceptions.r r }r (hU hj ubaubh|)r }r (hj hj h h]h%hh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X RiakcachedExceptionr r }r (hU hj ubaubh)r }r (hU hj h Nh%hh'}r (Uexprhh,]h+]h)]h*]h/]uh1Nh2hh]r h)r }r (hU h'}r (UreftypehUrefdochU refdomainhh,]h+]Urefexplicith)]h*]h/]U reftargetX _modules/riakcached/exceptionsUrefidj uhj h]r h)r }r (hU h'}r (h)]h*]r hah+]h,]h/]uhj h]r h;X [source]r r }r (hU hj ubah%hubah%hubaubeubh)r }r (hU hj h h]h%hh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h)r }r (hX$ Base class for Riakcached Exceptionsr hj h j h%hh'}r (h)]h*]h+]h,]h/]uh1Kh2hh]r h;X$ Base class for Riakcached Exceptionsr r }r (hj hj ubaubaubeubh?)r }r (hU hhh X /var/build/user_builds/riakcached/checkouts/latest/riakcached/exceptions.py:docstring of riakcached.exceptions.RiakcachedNotFoundr h%hCh'}r (h,]h+]h)]h*]h/]Uentries]r (hFX RiakcachedNotFoundr hU tr auh1Nh2hh]ubhO)r }r (hU hhh j h%hRh'}r (hThUX pyh,]h+]h)]h*]h/]hVX exceptionr hXj uh1Nh2hh]r (hZ)r }r (hj hj h h]h%h^h'}r (h,]r hahah!X riakcached.exceptionsr r }r bh+]h)]h*]h/]r hahfj hgU hhuh1Nh2hh]r (hj)r }r (hX exception hj h h]h%hmh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X exception r r }r (hU hj ubaubhs)r }r (hX riakcached.exceptions.hj h h]h%hvh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X riakcached.exceptions.r r }r (hU hj ubaubh|)r }r (hj hj h h]h%hh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X RiakcachedNotFoundr r }r (hU hj ubaubh)r }r (hU hj h Nh%hh'}r (Uexprhh,]h+]h)]h*]h/]uh1Nh2hh]r h)r }r (hU h'}r (UreftypehUrefdochU refdomainhh,]h+]Urefexplicith)]h*]h/]U reftargetX _modules/riakcached/exceptionsUrefidj uhj h]r h)r }r (hU h'}r (h)]h*]r hah+]h,]h/]uhj h]r h;X [source]r r }r (hU hj ubah%hubah%hubaubeubh)r }r (hU hj h h]h%hh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r (h)r }r (hXA Exception that is raised for unexpected HTTP 204 status responsesr hj h j h%hh'}r (h)]h*]h+]h,]h/]uh1Kh2hh]r h;XA Exception that is raised for unexpected HTTP 204 status responsesr r }r (hj hj ubaubh)r }r (hX@ Inherits from :class:`riakcached.exceptions.RiakcachedException`hj h j h%hh'}r (h)]h*]h+]h,]h/]uh1Kh2hh]r (h;X Inherits from r r }r! (hX Inherits from hj ubh)r" }r# (hX2 :class:`riakcached.exceptions.RiakcachedException`r$ hj h Nh%hh'}r% (UreftypeX classhhX) riakcached.exceptions.RiakcachedExceptionU refdomainX pyr& h,]h+]Urefexplicith)]h*]h/]hhhj hhuh1Nh]r' h)r( }r) (hj$ h'}r* (h)]h*]r+ (hj& X py-classr, eh+]h,]h/]uhj" h]r- h;X) riakcached.exceptions.RiakcachedExceptionr. r/ }r0 (hU hj( ubah%hubaubeubeubeubh?)r1 }r2 (hU hhh X /var/build/user_builds/riakcached/checkouts/latest/riakcached/exceptions.py:docstring of riakcached.exceptions.RiakcachedPreconditionFailedr3 h%hCh'}r4 (h,]h+]h)]h*]h/]Uentries]r5 (hFX RiakcachedPreconditionFailedr6 hU tr7 auh1Nh2hh]ubhO)r8 }r9 (hU hhh j3 h%hRh'}r: (hThUX pyh,]h+]h)]h*]h/]hVX exceptionr; hXj; uh1Nh2hh]r< (hZ)r= }r> (hj6 hj8 h h]h%h^h'}r? (h,]r@ hahah!X riakcached.exceptionsrA rB }rC bh+]h)]h*]h/]rD hahfj6 hgU hhuh1Nh2hh]rE (hj)rF }rG (hX exception hj= h h]h%hmh'}rH (h)]h*]h+]h,]h/]uh1Nh2hh]rI h;X exception rJ rK }rL (hU hjF ubaubhs)rM }rN (hX riakcached.exceptions.hj= h h]h%hvh'}rO (h)]h*]h+]h,]h/]uh1Nh2hh]rP h;X riakcached.exceptions.rQ rR }rS (hU hjM ubaubh|)rT }rU (hj6 hj= h h]h%hh'}rV (h)]h*]h+]h,]h/]uh1Nh2hh]rW h;X RiakcachedPreconditionFailedrX rY }rZ (hU hjT ubaubh)r[ }r\ (hU hj= h Nh%hh'}r] (Uexprhh,]h+]h)]h*]h/]uh1Nh2hh]r^ h)r_ }r` (hU h'}ra (UreftypehUrefdochU refdomainhh,]h+]Urefexplicith)]h*]h/]U reftargetX _modules/riakcached/exceptionsUrefidj6 uhj[ h]rb h)rc }rd (hU h'}re (h)]h*]rf hah+]h,]h/]uhj_ h]rg h;X [source]rh ri }rj (hU hjc ubah%hubah%hubaubeubh)rk }rl (hU hj8 h h]h%hh'}rm (h)]h*]h+]h,]h/]uh1Nh2hh]rn (h)ro }rp (hXA Exception that is raised for unexpected HTTP 412 status responsesrq hjk h j3 h%hh'}rr (h)]h*]h+]h,]h/]uh1Kh2hh]rs h;XA Exception that is raised for unexpected HTTP 412 status responsesrt ru }rv (hjq hjo ubaubh)rw }rx (hX@ Inherits from :class:`riakcached.exceptions.RiakcachedException`hjk h j3 h%hh'}ry (h)]h*]h+]h,]h/]uh1Kh2hh]rz (h;X Inherits from r{ r| }r} (hX Inherits from hjw ubh)r~ }r (hX2 :class:`riakcached.exceptions.RiakcachedException`r hjw h Nh%hh'}r (UreftypeX classhhX) riakcached.exceptions.RiakcachedExceptionU refdomainX pyr h,]h+]Urefexplicith)]h*]h/]hhhj6 hhuh1Nh]r h)r }r (hj h'}r (h)]h*]r (hj X py-classr eh+]h,]h/]uhj~ h]r h;X) riakcached.exceptions.RiakcachedExceptionr r }r (hU hj ubah%hubaubeubeubeubh?)r }r (hU hhh X /var/build/user_builds/riakcached/checkouts/latest/riakcached/exceptions.py:docstring of riakcached.exceptions.RiakcachedServiceUnavailabler h%hCh'}r (h,]h+]h)]h*]h/]Uentries]r (hFX RiakcachedServiceUnavailabler h U tr auh1Nh2hh]ubhO)r }r (hU hhh j h%hRh'}r (hThUX pyh,]h+]h)]h*]h/]hVX exceptionr hXj uh1Nh2hh]r (hZ)r }r (hj hj h h]h%h^h'}r (h,]r h ahah!X riakcached.exceptionsr r }r bh+]h)]h*]h/]r h ahfj hgU hhuh1Nh2hh]r (hj)r }r (hX exception hj h h]h%hmh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X exception r r }r (hU hj ubaubhs)r }r (hX riakcached.exceptions.hj h h]h%hvh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X riakcached.exceptions.r r }r (hU hj ubaubh|)r }r (hj hj h h]h%hh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X RiakcachedServiceUnavailabler r }r (hU hj ubaubh)r }r (hU hj h Nh%hh'}r (Uexprhh,]h+]h)]h*]h/]uh1Nh2hh]r h)r }r (hU h'}r (UreftypehUrefdochU refdomainhh,]h+]Urefexplicith)]h*]h/]U reftargetX _modules/riakcached/exceptionsUrefidj uhj h]r h)r }r (hU h'}r (h)]h*]r hah+]h,]h/]uhj h]r h;X [source]r r }r (hU hj ubah%hubah%hubaubeubh)r }r (hU hj h h]h%hh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r (h)r }r (hXA Exception that is raised for unexpected HTTP 503 status responsesr hj h j h%hh'}r (h)]h*]h+]h,]h/]uh1Kh2hh]r h;XA Exception that is raised for unexpected HTTP 503 status responsesr r }r (hj hj ubaubh)r }r (hX@ Inherits from :class:`riakcached.exceptions.RiakcachedException`hj h j h%hh'}r (h)]h*]h+]h,]h/]uh1Kh2hh]r (h;X Inherits from r r }r (hX Inherits from hj ubh)r }r (hX2 :class:`riakcached.exceptions.RiakcachedException`r hj h Nh%hh'}r (UreftypeX classhhX) riakcached.exceptions.RiakcachedExceptionU refdomainX pyr h,]h+]Urefexplicith)]h*]h/]hhhj hhuh1Nh]r h)r }r (hj h'}r (h)]h*]r (hj X py-classr eh+]h,]h/]uhj h]r h;X) riakcached.exceptions.RiakcachedExceptionr r }r (hU hj ubah%hubaubeubeubeubh?)r }r (hU hhh X /var/build/user_builds/riakcached/checkouts/latest/riakcached/exceptions.py:docstring of riakcached.exceptions.RiakcachedTimeoutr h%hCh'}r (h,]h+]h)]h*]h/]Uentries]r (hFX RiakcachedTimeoutr hU tr auh1Nh2hh]ubhO)r }r (hU hhh j h%hRh'}r (hThUX pyh,]h+]h)]h*]h/]hVX exceptionr hXj uh1Nh2hh]r (hZ)r }r (hj hj h h]h%h^h'}r (h,]r hahah!X riakcached.exceptionsr r }r bh+]h)]h*]h/]r hahfj hgU hhuh1Nh2hh]r (hj)r }r (hX exception hj h h]h%hmh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X exception r r }r (hU hj ubaubhs)r }r (hX riakcached.exceptions.hj h h]h%hvh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X riakcached.exceptions.r r }r (hU hj ubaubh|)r }r (hj hj h h]h%hh'}r (h)]h*]h+]h,]h/]uh1Nh2hh]r h;X RiakcachedTimeoutr r }r (hU hj ubaubh)r }r (hU hj h Nh%hh'}r (Uexprhh,]h+]h)]h*]h/]uh1Nh2hh]r h)r }r (hU h'}r (UreftypehUrefdochU refdomainhh,]h+]Urefexplicith)]h*]h/]U reftargetX _modules/riakcached/exceptionsUrefidj uhj h]r h)r }r (hU h'}r (h)]h*]r hah+]h,]h/]uhj h]r h;X [source]r r! }r" (hU hj ubah%hubah%hubaubeubh)r# }r$ (hU hj h h]h%hh'}r% (h)]h*]h+]h,]h/]uh1Nh2hh]r& (h)r' }r( (hX: Exception that is raised when pool requests takes too longr) hj# h j h%hh'}r* (h)]h*]h+]h,]h/]uh1Kh2hh]r+ h;X: Exception that is raised when pool requests takes too longr, r- }r. (hj) hj' ubaubh)r/ }r0 (hX@ Inherits from :class:`riakcached.exceptions.RiakcachedException`r1 hj# h j h%hh'}r2 (h)]h*]h+]h,]h/]uh1Kh2hh]r3 (h;X Inherits from r4 r5 }r6 (hX Inherits from hj/ ubh)r7 }r8 (hX2 :class:`riakcached.exceptions.RiakcachedException`r9 hj/ h Nh%hh'}r: (UreftypeX classhhX) riakcached.exceptions.RiakcachedExceptionU refdomainX pyr; h,]h+]Urefexplicith)]h*]h/]hhhj hhuh1Nh]r< h)r= }r> (hj9 h'}r? (h)]h*]r@ (hj; X py-classrA eh+]h,]h/]uhj7 h]rB h;X) riakcached.exceptions.RiakcachedExceptionrC rD }rE (hU hj= ubah%hubaubeubeubeubeubahU UtransformerrF NU footnote_refsrG }rH UrefnamesrI }rJ Usymbol_footnotesrK ]rL Uautofootnote_refsrM ]rN Usymbol_footnote_refsrO ]rP U citationsrQ ]rR h2hUcurrent_linerS NUtransform_messagesrT ]rU UreporterrV NUid_startrW KU autofootnotesrX ]rY U citation_refsrZ }r[ Uindirect_targetsr\ ]r] Usettingsr^ (cdocutils.frontend Values r_ or` }ra (Ufootnote_backlinksrb KUrecord_dependenciesrc NUrfc_base_urlrd Uhttp://tools.ietf.org/html/re U tracebackrf Upep_referencesrg NUstrip_commentsrh NU toc_backlinksri Uentryrj U language_coderk Uenrl U datestamprm NUreport_levelrn KU_destinationro NU halt_levelrp KU strip_classesrq Nh8NUerror_encoding_error_handlerrr Ubackslashreplacers Udebugrt NUembed_stylesheetru Uoutput_encoding_error_handlerrv Ustrictrw U sectnum_xformrx KUdump_transformsry NU docinfo_xformrz KUwarning_streamr{ NUpep_file_url_templater| Upep-%04dr} Uexit_status_levelr~ KUconfigr NUstrict_visitorr NUcloak_email_addressesr Utrim_footnote_reference_spacer Uenvr NUdump_pseudo_xmlr NUexpose_internalsr NUsectsubtitle_xformr Usource_linkr NUrfc_referencesr NUoutput_encodingr Uutf-8r U source_urlr NUinput_encodingr U utf-8-sigr U_disable_configr NU id_prefixr U U tab_widthr KUerror_encodingr UUTF-8r U_sourcer UF/var/build/user_builds/riakcached/checkouts/latest/docs/exceptions.rstr Ugettext_compactr U generatorr NUdump_internalsr NUsmart_quotesr Upep_base_urlr Uhttp://www.python.org/dev/peps/r Usyntax_highlightr Ulongr Uinput_encoding_error_handlerr jw Uauto_id_prefixr Uidr Udoctitle_xformr Ustrip_elements_with_classesr NU _config_filesr ]Ufile_insertion_enabledr KUraw_enabledr KU dump_settingsr NubUsymbol_footnote_startr K Uidsr }r (hj hh[hj7 hhh j h j h hhj= hj h.cdocutils.nodes target r )r }r (hU hhh hBh%Utargetr h'}r (h)]h,]r h.ah+]Uismodh*]h/]uh1Kh2hh]ubuUsubstitution_namesr }r h%h2h'}r (h)]h,]h+]Usourceh#h*]h/]uU footnotesr ]r Urefidsr }r ub.PK Ԉ-Ctz z . riakcached-latest/.doctrees/environment.pickle(csphinx.environment BuildEnvironment qoq}q(Udlfilesqcsphinx.util FilenameUniqDict q)qc__builtin__ set q]RqbUappq NU _warnfuncq NUtitlesq}q(U exceptionsq cdocutils.nodes title q)q}q(U rawsourceqU U attributesq}q(Udupnamesq]Uclassesq]Ubackrefsq]Uidsq]Unamesq]uUchildrenq]qcdocutils.nodes Text qX riakcached.exceptionsqq}q(hX riakcached.exceptionsqUparentq hubaUtagnameq!Utitleq"ubUindexq#h)q$}q%(hU h}q&(h]h]h]h]h]uh]q'hX Riakcached documentationq(q)}q*(hX Riakcached documentationq+h h$ubah!h"ubUclientsq,h)q-}q.(hU h}q/(h]h]h]h]h]uh]q0hX riakcached.clientsq1q2}q3(hX riakcached.clientsq4h h-ubah!h"ubUpoolsq5h)q6}q7(hU h}q8(h]h]h]h]h]uh]q9hX riakcached.poolsq:q;}q<(hX riakcached.poolsq=h h6ubah!h"ubuU domaindataq>}q?(Ustdq@}qA(UversionqBK U anonlabelsqC}qD(UmodindexqEUpy-modindexU UgenindexqFhFU UsearchqGUsearchU uUlabelsqH}qI(hEUpy-modindexU csphinx.locale _TranslationProxy qJcsphinx.locale mygettext qKUModule IndexqLqMhKhLqNbhFhFU hJhKUIndexqOqPhKhOqQbhGhGU hJhKUSearch PageqRqShKhRqTbuUprogoptionsqU}qVUobjectsqW}qXuUc}qY(hW}qZhBK uUpyq[}q\(hW}q](X. riakcached.clients.ThreadedRiakClient.set_manyq^h,X methodq_X/ riakcached.exceptions.RiakcachedConnectionErrorq`h X exceptionX! riakcached.clients.RiakClient.setqah,X methodqbX( riakcached.exceptions.RiakcachedNotFoundqch X exceptionX riakcached.pools.Urllib3Poolqdh5X classqeX" riakcached.pools.Urllib3Pool.closeqfh5X methodqgX2 riakcached.exceptions.RiakcachedServiceUnavailableqhh X exceptionX$ riakcached.pools.Urllib3Pool.connectqih5X methodqjX&