def get(self, key, r=None, pr=None, timeout=None, include_context=None, basic_quorum=None, notfound_ok=None): """ Retrieve an object or datatype from Riak. :param key: Name of the key. :type key: string :param r: R-Value of the request (defaults to bucket's R) :type r: integer :param pr: PR-Value of the request (defaults to bucket's PR) :type pr: integer :param timeout: a timeout value in milliseconds :type timeout: int :param include_context: if the bucket contains datatypes, include the opaque context in the result :type include_context: bool :param basic_quorum: whether to use the "basic quorum" policy for not-founds :type basic_quorum: bool :param notfound_ok: whether to treat not-found responses as successful :type notfound_ok: bool :rtype: :class:`RiakObject <riak.riak_object.RiakObject>` or :class:`~riak.datatypes.Datatype` """ if self.bucket_type.datatype: return self._client.fetch_datatype(self, key, r=r, pr=pr, timeout=timeout, include_context=include_context, basic_quorum=basic_quorum, notfound_ok=notfound_ok) else: obj = RiakObject(self._client, self, key) return obj.reload(r=r, pr=pr, timeout=timeout, basic_quorum=basic_quorum, notfound_ok=notfound_ok)
def get_binary(self, key, r=None): """ Retrieve a binary/string object from Riak. @param string key - Name of the key. @param int r - R-Value of the request (defaults to bucket's R) @return RiakObject """ obj = RiakObject(self._client, self, key) obj._encode_data = False r = self.get_r(r) return obj.reload(r)
def get(self, key, r=None, pr=None): """ Retrieve a JSON-encoded object from Riak. :param key: Name of the key. :type key: string :param r: R-Value of the request (defaults to bucket's R) :type r: integer :param pr: PR-Value of the request (defaults to bucket's PR) :type pr: integer :rtype: :class:`RiakObject <riak.riak_object.RiakObject>` """ obj = RiakObject(self._client, self, key) return obj.reload(r=r, pr=pr)
def get_binary(self, key, r=None): """ Retrieve a binary/string object from Riak. :param key: Name of the key. :type key: string :param r: R-Value of the request (defaults to bucket's R) :type r: integer :rtype: :class:`RiakObject <riak.riak_object.RiakObject>` """ obj = RiakObject(self._client, self, key) obj._encode_data = False r = self.get_r(r) return obj.reload(r)
def get_binary(self, key, r=None): """ Retrieve a binary/string object from Riak. :param key: Name of the key. :type key: string :param r: R-Value of the request (defaults to bucket's R) :type r: integer :rtype: :class:`RiakObject <riak.riak_object.RiakObject>` """ obj = RiakObject(self._client, self, key) obj._encode_data = False r = self.get_r(r) return obj.reload(r)
def get(self, key, r=None, pr=None): """ Retrieve a JSON-encoded object from Riak. :param key: Name of the key. :type key: string :param r: R-Value of the request (defaults to bucket's R) :type r: integer :param pr: PR-Value of the request (defaults to bucket's PR) :type pr: integer :rtype: :class:`RiakObject <riak.riak_object.RiakObject>` """ obj = RiakObject(self._client, self, key) return obj.reload(r=r, pr=pr)
def get(self, key, r=None, pr=None, timeout=None, include_context=None, basic_quorum=None, notfound_ok=None): """ Retrieve an :class:`~riak.riak_object.RiakObject` or :class:`~riak.datatypes.Datatype`, based on the presence and value of the :attr:`datatype <BucketType.datatype>` bucket property. :param key: Name of the key. :type key: string :param r: R-Value of the request (defaults to bucket's R) :type r: integer :param pr: PR-Value of the request (defaults to bucket's PR) :type pr: integer :param timeout: a timeout value in milliseconds :type timeout: int :param include_context: if the bucket contains datatypes, include the opaque context in the result :type include_context: bool :param basic_quorum: whether to use the "basic quorum" policy for not-founds :type basic_quorum: bool :param notfound_ok: whether to treat not-found responses as successful :type notfound_ok: bool :rtype: :class:`RiakObject <riak.riak_object.RiakObject>` or :class:`~riak.datatypes.Datatype` """ if self.bucket_type.datatype: return self._client.fetch_datatype(self, key, r=r, pr=pr, timeout=timeout, include_context=include_context, basic_quorum=basic_quorum, notfound_ok=notfound_ok) else: obj = RiakObject(self._client, self, key) return obj.reload(r=r, pr=pr, timeout=timeout, basic_quorum=basic_quorum, notfound_ok=notfound_ok)
def get(self, key, r=None, pr=None, timeout=None): """ Retrieve an object from Riak. :param key: Name of the key. :type key: string :param r: R-Value of the request (defaults to bucket's R) :type r: integer :param pr: PR-Value of the request (defaults to bucket's PR) :type pr: integer :param timeout: a timeout value in milliseconds :type timeout: int :rtype: :class:`RiakObject <riak.riak_object.RiakObject>` """ obj = RiakObject(self._client, self, key) return obj.reload(r=r, pr=pr, timeout=timeout)
def get(self, key, r=None, pr=None, timeout=None): """ Retrieve an object from Riak. :param key: Name of the key. :type key: string :param r: R-Value of the request (defaults to bucket's R) :type r: integer :param pr: PR-Value of the request (defaults to bucket's PR) :type pr: integer :param timeout: a timeout value in milliseconds :type timeout: int :rtype: :class:`RiakObject <riak.riak_object.RiakObject>` """ obj = RiakObject(self._client, self, key) return obj.reload(r=r, pr=pr, timeout=timeout)