Skip to content

Commit beb5912

Browse files
author
Sean Cribbs
committed
Merge pull request #262 from basho/gh262-docs-update
Update docs for new release
2 parents 4415e96 + 25337cd commit beb5912

28 files changed

Lines changed: 1385 additions & 662 deletions

docs/_static/custom.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
div.admonition p {
2+
margin: 0;
3+
}
4+
5+
p.admonition-title {
6+
float: left;
7+
margin-right: 0.5em ! important;
8+
}
9+
10+
p.admonition-title:after {
11+
content: ":";
12+
font-weight: bold;
13+
}
14+
15+
div.alert-info a {
16+
color: #555;
17+
}

docs/_templates/layout.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{% extends "!layout.html" %}
2+
3+
{% block sidebarrel %}{% endblock %}
4+
5+
{%- block content %}
6+
{{ navBar() }}
7+
<div class="container">
8+
<ul class="pager">
9+
{%- if prev %}
10+
<li class="previous">
11+
<a href="{{ prev.link|e }}"
12+
title="{{ _('previous chapter') }}">{{"&larr;"|safe}}{{ prev.title }}</a></li>
13+
{%- endif %}
14+
{%- if next %}
15+
<li class="next">
16+
<a href="{{ next.link|e }}"
17+
title="{{ _('next chapter') }}">{{ next.title }}{{"&rarr;"|safe}}</a></li>
18+
{%- endif %}
19+
</ul>
20+
{% block body %}{% endblock %}
21+
<div class="clearfix">&nbsp;</div>
22+
<ul class="pager">
23+
{%- if prev %}
24+
<li class="previous">
25+
<a href="{{ prev.link|e }}"
26+
title="{{ _('previous chapter') }}">{{"&larr;"|safe}}{{ prev.title }}</a></li>
27+
{%- endif %}
28+
{%- if next %}
29+
<li class="next">
30+
<a href="{{ next.link|e }}"
31+
title="{{ _('next chapter') }}">{{ next.title }}{{"&rarr;"|safe}}</a></li>
32+
{%- endif %}
33+
</ul>
34+
</div>
35+
{%- endblock %}
36+
37+
{% set css_files = css_files + ['_static/custom.css'] %}

docs/advanced.rst

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
============================
2+
Advanced Usage & Internals
3+
============================
4+
5+
This page contains documentation for aspects of library internals that
6+
you will rarely need to interact with, but are important for
7+
understanding how it works and development purposes.
8+
9+
---------------
10+
Connection pool
11+
---------------
12+
13+
.. currentmodule:: riak.transports.pool
14+
15+
.. autoexception:: BadResource
16+
.. autoclass:: Element
17+
:members:
18+
.. autoclass:: Pool
19+
:members:
20+
21+
.. autoclass:: PoolIterator
22+
23+
-----------
24+
Retry logic
25+
-----------
26+
27+
.. currentmodule:: riak.client.transport
28+
29+
.. autoclass:: RiakClientTransport
30+
:members:
31+
:private-members:
32+
33+
.. autofunction:: _is_retryable
34+
35+
.. autofunction:: retryable
36+
37+
.. autofunction:: retryableHttpOnly
38+
39+
--------
40+
Multiget
41+
--------
42+
43+
.. currentmodule:: riak.client.multiget
44+
45+
.. autodata:: POOL_SIZE
46+
47+
.. autoclass:: Task
48+
49+
.. autoclass:: MultiGetPool
50+
:members:
51+
:private-members:
52+
53+
.. autodata:: RIAK_MULTIGET_POOL
54+
55+
.. autofunction:: multiget
56+
57+
----------
58+
Transports
59+
----------
60+
61+
.. currentmodule:: riak.transports.transport
62+
63+
.. autoclass:: RiakTransport
64+
:members:
65+
:private-members:
66+
67+
.. currentmodule:: riak.transports.feature_detect
68+
69+
.. autoclass:: FeatureDetection
70+
:members:
71+
:private-members:
72+
73+
^^^^^^^^^^^^^^
74+
HTTP Transport
75+
^^^^^^^^^^^^^^
76+
77+
.. currentmodule:: riak.transports.http
78+
79+
.. autoclass:: RiakHttpPool
80+
81+
.. autofunction:: is_retryable
82+
83+
.. autoclass:: RiakHttpTransport
84+
:members:
85+
86+
^^^^^^^^^^^^^^^^^^^^^^^^^^
87+
Protocol Buffers Transport
88+
^^^^^^^^^^^^^^^^^^^^^^^^^^
89+
90+
.. currentmodule:: riak.transports.pbc
91+
92+
.. autoclass:: RiakPbcTransport
93+
:members:
94+
95+
---------
96+
Utilities
97+
---------
98+
99+
^^^^^^^^^^^^^^^^^^
100+
Link wrapper class
101+
^^^^^^^^^^^^^^^^^^
102+
103+
.. autoclass:: riak.mapreduce.RiakLink
104+
105+
^^^^^^^^^^^^^^^^^
106+
Multi-valued Dict
107+
^^^^^^^^^^^^^^^^^
108+
109+
.. currentmodule:: riak.multidict
110+
111+
.. autoclass:: MultiDict
112+
113+
.. automethod:: add
114+
.. automethod:: getall
115+
.. automethod:: getone
116+
.. automethod:: mixed
117+
.. automethod:: dict_of_lists
118+
119+
^^^^^^^^^^^^^^^^^^
120+
Micro-benchmarking
121+
^^^^^^^^^^^^^^^^^^
122+
123+
.. currentmodule:: riak.benchmark
124+
125+
.. autofunction:: measure
126+
127+
.. autofunction:: measure_with_rehearsal
128+
129+
.. autoclass:: Benchmark
130+
:members:
131+
132+
^^^^^^^^^^^^^
133+
Miscellaneous
134+
^^^^^^^^^^^^^
135+
136+
.. currentmodule:: riak.util
137+
138+
.. autofunction:: quacks_like_dict
139+
140+
.. autofunction:: deep_merge
141+
142+
.. autofunction:: deprecated
143+
144+
.. autofunction:: deprecateQuorumAccessors
145+
146+
.. autoclass:: lazy_property

docs/bucket.rst

Lines changed: 155 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,158 @@
1-
.. ref-bucket:
2-
3-
==========
4-
RiakBucket
5-
==========
1+
=======
2+
Buckets
3+
=======
64

75
.. currentmodule:: riak.bucket
86

9-
.. autoclass:: riak.bucket.RiakBucket
7+
Buckets are both namespaces for the key-value pairs you store in Riak,
8+
and containers for properties that apply to that namespace. Buckets
9+
should be created via the :meth:`bucket()
10+
<riak.client.RiakClient.bucket>` method on the client object, like so::
11+
12+
import riak
13+
14+
client = riak.RiakClient()
15+
mybucket = client.bucket('mybucket')
16+
17+
--------------
18+
Bucket objects
19+
--------------
20+
21+
.. autoclass:: RiakBucket
22+
23+
.. attribute:: name
24+
25+
The name of the bucket, a string.
26+
27+
.. autoattribute:: resolver
28+
29+
-----------------
30+
Bucket properties
31+
-----------------
32+
33+
Bucket properties are flags and defaults that apply to all keys in the
34+
bucket.
35+
36+
.. automethod:: RiakBucket.get_properties
37+
.. automethod:: RiakBucket.set_properties
38+
.. automethod:: RiakBucket.clear_properties
39+
.. automethod:: RiakBucket.get_property
40+
.. automethod:: RiakBucket.set_property
41+
42+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43+
Shortcuts for common properties
44+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45+
46+
Some of the most commonly-used bucket properties are exposed as object
47+
properties as well. The getters and setters simply call
48+
:meth:`RiakBucket.get_property` and :meth:`RiakBucket.set_property`
49+
respectively.
50+
51+
.. autoattribute:: RiakBucket.n_val
52+
.. autoattribute:: RiakBucket.allow_mult
53+
.. autoattribute:: RiakBucket.r
54+
.. autoattribute:: RiakBucket.pr
55+
.. autoattribute:: RiakBucket.w
56+
.. autoattribute:: RiakBucket.dw
57+
.. autoattribute:: RiakBucket.pw
58+
.. autoattribute:: RiakBucket.rw
59+
60+
^^^^^^^^^^^^^^^^^^^^
61+
Shortcuts for search
62+
^^^^^^^^^^^^^^^^^^^^
63+
64+
When Riak Search is enabled on the server, you can toggle which
65+
buckets have automatic indexing turned on using the ``search`` bucket
66+
property (and on older versions, the ``precommit`` property). These
67+
methods simplify interacting with that configuration.
68+
69+
.. automethod:: RiakBucket.search_enabled
70+
.. automethod:: RiakBucket.enable_search
71+
.. automethod:: RiakBucket.disable_search
72+
73+
-----------------
74+
Working with keys
75+
-----------------
76+
77+
The primary purpose of buckets is to act as namespaces for keys. As
78+
such, you can use the bucket object to create, fetch and delete
79+
:class:`objects <riak.riak_object.RiakObject>`.
80+
81+
.. automethod:: RiakBucket.new
82+
.. automethod:: RiakBucket.new_from_file
83+
.. automethod:: RiakBucket.get
84+
.. automethod:: RiakBucket.multiget
85+
.. automethod:: RiakBucket.delete
86+
87+
.. _counters:
88+
89+
^^^^^^^^
90+
Counters
91+
^^^^^^^^
92+
93+
Rather than returning objects, the counter operations new to Riak 1.4
94+
act directly on the value of the counter.
95+
96+
.. automethod:: RiakBucket.get_counter
97+
.. automethod:: RiakBucket.update_counter
98+
99+
----------------
100+
Query operations
101+
----------------
102+
103+
.. automethod:: RiakBucket.search
104+
.. automethod:: RiakBucket.get_index
105+
.. automethod:: RiakBucket.stream_index
106+
107+
108+
-------------
109+
Serialization
110+
-------------
111+
112+
Similar to :class:`RiakClient <riak.client.RiakClient>`, buckets can
113+
register custom transformation functions for media-types. When
114+
undefined on the bucket, :meth:`RiakBucket.get_encoder` and
115+
:meth:`RiakBucket.get_decoder` will delegate to the client associated
116+
with the bucket.
117+
118+
.. automethod:: RiakBucket.get_encoder
119+
.. automethod:: RiakBucket.set_encoder
120+
.. automethod:: RiakBucket.get_decoder
121+
.. automethod:: RiakBucket.set_decoder
122+
123+
124+
------------
125+
Listing keys
126+
------------
127+
128+
Shortcuts for :meth:`RiakClient.get_keys()
129+
<riak.client.RiakClient.get_keys>` and
130+
:meth:`RiakClient.stream_keys()
131+
<riak.client.RiakClient.stream_keys>` are exposed on the bucket
132+
object. The same admonitions for these operations apply.
133+
134+
.. automethod:: RiakBucket.get_keys
135+
.. automethod:: RiakBucket.stream_keys
136+
137+
------------------
138+
Deprecated methods
139+
------------------
140+
141+
.. warning:: These methods exist solely for backwards-compatibility and should not
142+
be used unless code is being ported from an older version.
143+
144+
.. automethod:: RiakBucket.new_binary
145+
.. automethod:: RiakBucket.new_binary_from_file
146+
.. automethod:: RiakBucket.get_binary
147+
.. automethod:: RiakBucket.get_r
148+
.. automethod:: RiakBucket.set_r
149+
.. automethod:: RiakBucket.get_pr
150+
.. automethod:: RiakBucket.set_pr
151+
.. automethod:: RiakBucket.get_w
152+
.. automethod:: RiakBucket.set_w
153+
.. automethod:: RiakBucket.get_dw
154+
.. automethod:: RiakBucket.set_dw
155+
.. automethod:: RiakBucket.get_pw
156+
.. automethod:: RiakBucket.set_pw
157+
.. automethod:: RiakBucket.get_rw
158+
.. automethod:: RiakBucket.set_rw

0 commit comments

Comments
 (0)