Skip to content

Commit 25337cd

Browse files
author
Sean Cribbs
committed
A lot of final cleanups, deprecation normalized, etc.
1 parent f4d658d commit 25337cd

11 files changed

Lines changed: 69 additions & 27 deletions

File tree

docs/advanced.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ Connection pool
1919
:members:
2020

2121
.. autoclass:: PoolIterator
22-
:members:
23-
:special-members:
2422

2523
-----------
2624
Retry logic

docs/client.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ Deprecated Methods
147147
.. attribute:: RiakClient.solr
148148

149149
Returns a RiakSearch object which can access search indexes.
150-
**DEPRECATED**
150+
151+
.. deprecated:: 2.0.0
152+
Use the ``fulltext_*`` methods instead.
151153

152154
.. automethod:: RiakClient.get_r
153155
.. automethod:: RiakClient.set_r

docs/object.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
==============
2-
Keys & Objects
3-
==============
1+
================
2+
Values & Objects
3+
================
44

55
.. currentmodule:: riak.riak_object
66

docs/query.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ for equality or across ranges.::
2626

2727
# Performs an equality query
2828
seans = bucket.get_index("fname_bin", "Sean")
29-
29+
3030
# Performs a range query
3131
eighties = bucket.get_index("byear_int", 1980, 1989)
3232

3333
Secondary indexes are also available via :meth:`MapReduce
34-
<riak.mapreduce.MapReduce.index>`.
34+
<riak.mapreduce.RiakMapReduce.index>`.
3535

3636
^^^^^^^^^^^^^^^^^^
3737
Riak 1.4+ Features
@@ -112,7 +112,7 @@ MapReduce
112112

113113
.. currentmodule:: riak.mapreduce
114114

115-
:class:`MapReduce` allows you to construct query-processing jobs that
115+
:class:`RiakMapReduce` allows you to construct query-processing jobs that
116116
are performed mostly in-parallel around the Riak cluster. You can
117117
think of it as a pipeline, where inputs are fed in one end, they pass
118118
through a number of ``map`` and ``reduce`` phases, and then are
@@ -163,7 +163,7 @@ results, while ``reduce`` phases operate over collections of results
163163
from previous phases. ``link`` phases are a special type of ``map``
164164
phase that extract matching :attr:`~riak.riak_object.RiakObject.links`
165165
from the object, usually so they can be used in a subsequent ``map``
166-
phase.
166+
phase.
167167

168168
Any number of phases can return results directly to the client by
169169
passing ``keep=True``.

riak/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ def __str__(self):
4848

4949
class ConflictError(RiakError):
5050
"""
51-
Raised when an operation is attempted on a RiakObject that has
52-
more than one sibling.
51+
Raised when an operation is attempted on a
52+
:class:`~riak.riak_object.RiakObject` that has more than one
53+
sibling.
5354
"""
5455
def __init__(self, message="Object in conflict"):
5556
super(ConflictError, self).__init__(message)

riak/bucket.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ def new_binary(self, key=None, data=None,
170170
Create a new :class:`RiakObject <riak.riak_object.RiakObject>`
171171
that will be stored as plain text/binary. A shortcut for
172172
manually instantiating a :class:`RiakObject
173-
<riak.riak_object.RiakObject>`. **DEPRECATED**
173+
<riak.riak_object.RiakObject>`.
174+
175+
.. deprecated:: 2.0.0
176+
Use :meth:`new` instead.
174177
175178
:param key: Name of the key.
176179
:type key: string
@@ -204,7 +207,10 @@ def get(self, key, r=None, pr=None, timeout=None):
204207

205208
def get_binary(self, key, r=None, pr=None, timeout=None):
206209
"""
207-
Retrieve a binary/string object from Riak. **DEPRECATED**
210+
Retrieve a binary/string object from Riak.
211+
212+
.. deprecated:: 2.0.0
213+
Use :meth:`get` instead.
208214
209215
:param key: Name of the key.
210216
:type key: string
@@ -393,7 +399,10 @@ def new_binary_from_file(self, key, filename):
393399
"""
394400
Create a new Riak object in the bucket, using the contents of
395401
the specified file. This is a shortcut for :meth:`new`, where the
396-
``encoded_data`` and ``content_type`` are set for you. **DEPRECATED**
402+
``encoded_data`` and ``content_type`` are set for you.
403+
404+
.. deprecated:: 2.0.0
405+
Use :meth:`new_from_file` instead.
397406
398407
:param key: the key of the new object
399408
:type key: string

riak/client/__init__.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,21 @@ def _set_protocol(self, value):
138138
def get_transport(self):
139139
"""
140140
Get the transport instance the client is using for it's
141-
connection. DEPRECATED
141+
connection.
142+
143+
.. deprecated:: 2.0.0
144+
There is no equivalent to this method, it will return ``None``.
142145
"""
143146
deprecated("get_transport is deprecated, use client, " +
144147
"bucket, or object methods instead")
145148
return None
146149

147150
def get_client_id(self):
148151
"""
149-
Get the ``client_id`` for this ``RiakClient`` instance.
150-
DEPRECATED
152+
Get the client identifier.
153+
154+
.. deprecated:: 2.0.0
155+
Use the :attr:`client_id` attribute instead.
151156
152157
:rtype: string
153158
"""
@@ -157,8 +162,10 @@ def get_client_id(self):
157162

158163
def set_client_id(self, client_id):
159164
"""
160-
Set the client_id for this ``RiakClient`` instance.
161-
DEPRECATED
165+
Set the client identifier.
166+
167+
.. deprecated:: 2.0.0
168+
Use the :attr:`client_id` attribute instead.
162169
163170
:param client_id: The new client_id.
164171
:type client_id: string
@@ -243,7 +250,9 @@ def bucket(self, name):
243250
def solr(self):
244251
"""
245252
Returns a RiakSearch object which can access search indexes.
246-
DEPRECATED
253+
254+
.. deprecated:: 2.0.0
255+
Use the ``fulltext_*`` methods instead.
247256
"""
248257
deprecated("``solr`` is deprecated, use ``fulltext_search``,"
249258
" ``fulltext_add`` and ``fulltext_delete`` directly")

riak/client/multiget.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ def _should_quit(self):
142142
input queue is empty. Once the stop flag is set, new enqueues
143143
are disallowed, meaning that the workers can safely drain the
144144
queue before exiting.
145-
:rtype: boolean
145+
146+
:rtype: bool
146147
"""
147148
return self.stopped() and self._inq.empty()
148149

riak/mapreduce.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,25 @@ def to_array(self):
605605

606606

607607
class RiakKeyFilter(object):
608+
"""
609+
A helper class for building up lists of key filters. Unknown
610+
methods are treated as filters to be added; ``&`` and ``|`` create
611+
conjunctions and disjunctions, respectively. ``+`` concatenates filters.
612+
613+
Example::
614+
615+
f1 = RiakKeyFilter().starts_with('2005')
616+
f2 = RiakKeyFilter().ends_with('-01')
617+
f3 = f1 & f2
618+
print f3
619+
# => [['and', [['starts_with', '2005']], [['ends_with', '-01']]]]
620+
"""
621+
608622
def __init__(self, *args):
623+
"""
624+
:param args: a list of arguments to be treated as a filter.
625+
:type args: list
626+
"""
609627
if args:
610628
self._filters = [list(args)]
611629
else:

riak/transports/transport.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def delete(self, robj, rw=None, r=None, w=None, dw=None, pr=None,
8282
pw=None, timeout=None):
8383
"""
8484
Deletes an object.
85-
@return true
8685
"""
8786
raise NotImplementedError
8887

0 commit comments

Comments
 (0)