riak-client-noenc 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +7 -0
  2. data/.document +5 -0
  3. data/.gitignore +42 -0
  4. data/.rspec +1 -0
  5. data/Gemfile +17 -0
  6. data/Guardfile +20 -0
  7. data/LICENSE.md +16 -0
  8. data/README.markdown +640 -0
  9. data/RELEASE_NOTES.md +392 -0
  10. data/Rakefile +119 -0
  11. data/lib/riak.rb +22 -0
  12. data/lib/riak/bucket.rb +297 -0
  13. data/lib/riak/bucket_properties.rb +74 -0
  14. data/lib/riak/bucket_type.rb +77 -0
  15. data/lib/riak/bucket_typed/bucket.rb +121 -0
  16. data/lib/riak/client.rb +433 -0
  17. data/lib/riak/client/beefcake/bucket_properties_operator.rb +178 -0
  18. data/lib/riak/client/beefcake/crdt/counter_loader.rb +18 -0
  19. data/lib/riak/client/beefcake/crdt/map_loader.rb +64 -0
  20. data/lib/riak/client/beefcake/crdt/set_loader.rb +18 -0
  21. data/lib/riak/client/beefcake/crdt_loader.rb +84 -0
  22. data/lib/riak/client/beefcake/crdt_operator.rb +223 -0
  23. data/lib/riak/client/beefcake/footer +4 -0
  24. data/lib/riak/client/beefcake/header +6 -0
  25. data/lib/riak/client/beefcake/message_codes.rb +89 -0
  26. data/lib/riak/client/beefcake/message_overlay.rb +87 -0
  27. data/lib/riak/client/beefcake/messages.rb +772 -0
  28. data/lib/riak/client/beefcake/object_methods.rb +112 -0
  29. data/lib/riak/client/beefcake/protocol.rb +105 -0
  30. data/lib/riak/client/beefcake/socket.rb +260 -0
  31. data/lib/riak/client/beefcake_protobuffs_backend.rb +538 -0
  32. data/lib/riak/client/decaying.rb +36 -0
  33. data/lib/riak/client/feature_detection.rb +120 -0
  34. data/lib/riak/client/instrumentation.rb +19 -0
  35. data/lib/riak/client/node.rb +49 -0
  36. data/lib/riak/client/protobuffs_backend.rb +143 -0
  37. data/lib/riak/client/search.rb +27 -0
  38. data/lib/riak/client/yokozuna.rb +52 -0
  39. data/lib/riak/conflict.rb +13 -0
  40. data/lib/riak/core_ext.rb +7 -0
  41. data/lib/riak/core_ext/blank.rb +53 -0
  42. data/lib/riak/core_ext/deep_dup.rb +13 -0
  43. data/lib/riak/core_ext/extract_options.rb +7 -0
  44. data/lib/riak/core_ext/json.rb +15 -0
  45. data/lib/riak/core_ext/slice.rb +18 -0
  46. data/lib/riak/core_ext/stringify_keys.rb +10 -0
  47. data/lib/riak/core_ext/symbolize_keys.rb +10 -0
  48. data/lib/riak/core_ext/to_param.rb +31 -0
  49. data/lib/riak/counter.rb +101 -0
  50. data/lib/riak/crdt.rb +21 -0
  51. data/lib/riak/crdt/base.rb +183 -0
  52. data/lib/riak/crdt/batch_counter.rb +19 -0
  53. data/lib/riak/crdt/batch_map.rb +41 -0
  54. data/lib/riak/crdt/counter.rb +82 -0
  55. data/lib/riak/crdt/inner_counter.rb +81 -0
  56. data/lib/riak/crdt/inner_flag.rb +42 -0
  57. data/lib/riak/crdt/inner_map.rb +75 -0
  58. data/lib/riak/crdt/inner_register.rb +26 -0
  59. data/lib/riak/crdt/inner_set.rb +102 -0
  60. data/lib/riak/crdt/map.rb +121 -0
  61. data/lib/riak/crdt/operation.rb +19 -0
  62. data/lib/riak/crdt/set.rb +166 -0
  63. data/lib/riak/crdt/typed_collection.rb +181 -0
  64. data/lib/riak/encoding.rb +6 -0
  65. data/lib/riak/errors/backend_creation.rb +9 -0
  66. data/lib/riak/errors/base.rb +9 -0
  67. data/lib/riak/errors/connection_error.rb +50 -0
  68. data/lib/riak/errors/crdt_error.rb +38 -0
  69. data/lib/riak/errors/failed_request.rb +58 -0
  70. data/lib/riak/errors/protobuffs_error.rb +11 -0
  71. data/lib/riak/errors/search_error.rb +35 -0
  72. data/lib/riak/i18n.rb +7 -0
  73. data/lib/riak/index_collection.rb +71 -0
  74. data/lib/riak/instrumentation.rb +6 -0
  75. data/lib/riak/json.rb +52 -0
  76. data/lib/riak/link.rb +96 -0
  77. data/lib/riak/list_buckets.rb +28 -0
  78. data/lib/riak/locale/en.yml +107 -0
  79. data/lib/riak/locale/fr.yml +51 -0
  80. data/lib/riak/map_reduce.rb +295 -0
  81. data/lib/riak/map_reduce/filter_builder.rb +103 -0
  82. data/lib/riak/map_reduce/phase.rb +98 -0
  83. data/lib/riak/map_reduce/results.rb +49 -0
  84. data/lib/riak/map_reduce_error.rb +7 -0
  85. data/lib/riak/multiget.rb +122 -0
  86. data/lib/riak/preflist_item.rb +7 -0
  87. data/lib/riak/rcontent.rb +173 -0
  88. data/lib/riak/robject.rb +222 -0
  89. data/lib/riak/search.rb +11 -0
  90. data/lib/riak/search/index.rb +87 -0
  91. data/lib/riak/search/query.rb +141 -0
  92. data/lib/riak/search/result_collection.rb +144 -0
  93. data/lib/riak/search/result_document.rb +129 -0
  94. data/lib/riak/search/schema.rb +65 -0
  95. data/lib/riak/secondary_index.rb +81 -0
  96. data/lib/riak/serializers.rb +73 -0
  97. data/lib/riak/stamp.rb +77 -0
  98. data/lib/riak/util/escape.rb +80 -0
  99. data/lib/riak/util/tcp_socket_extensions.rb +58 -0
  100. data/lib/riak/util/translation.rb +18 -0
  101. data/lib/riak/version.rb +3 -0
  102. data/lib/riak/walk_spec.rb +145 -0
  103. data/spec/failover/failover.rb +59 -0
  104. data/spec/fixtures/bitcask.txt +25 -0
  105. data/spec/fixtures/cat.jpg +0 -0
  106. data/spec/fixtures/multipart-basic-conflict.txt +15 -0
  107. data/spec/fixtures/multipart-blank.txt +7 -0
  108. data/spec/fixtures/multipart-mapreduce.txt +10 -0
  109. data/spec/fixtures/multipart-with-body.txt +16 -0
  110. data/spec/fixtures/multipart-with-marked-tombstones.txt +17 -0
  111. data/spec/fixtures/multipart-with-unmarked-tombstone.txt +16 -0
  112. data/spec/fixtures/server.cert.crt +15 -0
  113. data/spec/fixtures/server.cert.key +15 -0
  114. data/spec/fixtures/test.pem +1 -0
  115. data/spec/fixtures/yz_schema_template.xml +18 -0
  116. data/spec/integration/riak/bucket_types_spec.rb +270 -0
  117. data/spec/integration/riak/conflict_resolution_spec.rb +96 -0
  118. data/spec/integration/riak/counters_spec.rb +36 -0
  119. data/spec/integration/riak/crdt/configuration_spec.rb +37 -0
  120. data/spec/integration/riak/crdt_search_spec.rb +176 -0
  121. data/spec/integration/riak/crdt_spec.rb +250 -0
  122. data/spec/integration/riak/crdt_validation/map_spec.rb +63 -0
  123. data/spec/integration/riak/crdt_validation/set_spec.rb +122 -0
  124. data/spec/integration/riak/preflist_spec.rb +31 -0
  125. data/spec/integration/riak/properties_spec.rb +69 -0
  126. data/spec/integration/riak/protobuffs/interrupted_request_spec.rb +33 -0
  127. data/spec/integration/riak/protobuffs_backends_spec.rb +40 -0
  128. data/spec/integration/riak/search_spec.rb +104 -0
  129. data/spec/integration/riak/secondary_index_spec.rb +72 -0
  130. data/spec/integration/riak/security_spec.rb +100 -0
  131. data/spec/integration/riak/threading_spec.rb +150 -0
  132. data/spec/integration/yokozuna/index_spec.rb +61 -0
  133. data/spec/integration/yokozuna/queries_spec.rb +115 -0
  134. data/spec/integration/yokozuna/schema_spec.rb +49 -0
  135. data/spec/riak/beefcake_protobuffs_backend/bucket_properties_operator_spec.rb +247 -0
  136. data/spec/riak/beefcake_protobuffs_backend/crdt_operator_spec.rb +222 -0
  137. data/spec/riak/beefcake_protobuffs_backend/object_methods_spec.rb +23 -0
  138. data/spec/riak/beefcake_protobuffs_backend/protocol_spec.rb +189 -0
  139. data/spec/riak/beefcake_protobuffs_backend_spec.rb +162 -0
  140. data/spec/riak/bucket_properties_spec.rb +135 -0
  141. data/spec/riak/bucket_spec.rb +275 -0
  142. data/spec/riak/bucket_type_spec.rb +50 -0
  143. data/spec/riak/bucket_typed/bucket_spec.rb +62 -0
  144. data/spec/riak/client_spec.rb +246 -0
  145. data/spec/riak/core_ext/to_param_spec.rb +15 -0
  146. data/spec/riak/counter_spec.rb +122 -0
  147. data/spec/riak/crdt/counter_spec.rb +55 -0
  148. data/spec/riak/crdt/inner_counter_spec.rb +21 -0
  149. data/spec/riak/crdt/inner_flag_spec.rb +39 -0
  150. data/spec/riak/crdt/inner_map_spec.rb +47 -0
  151. data/spec/riak/crdt/inner_register_spec.rb +40 -0
  152. data/spec/riak/crdt/inner_set_spec.rb +33 -0
  153. data/spec/riak/crdt/map_spec.rb +78 -0
  154. data/spec/riak/crdt/set_spec.rb +61 -0
  155. data/spec/riak/crdt/shared_examples.rb +74 -0
  156. data/spec/riak/crdt/typed_collection_spec.rb +225 -0
  157. data/spec/riak/escape_spec.rb +72 -0
  158. data/spec/riak/feature_detection_spec.rb +77 -0
  159. data/spec/riak/index_collection_spec.rb +53 -0
  160. data/spec/riak/instrumentation_spec.rb +124 -0
  161. data/spec/riak/link_spec.rb +85 -0
  162. data/spec/riak/list_buckets_spec.rb +41 -0
  163. data/spec/riak/map_reduce/filter_builder_spec.rb +32 -0
  164. data/spec/riak/map_reduce/phase_spec.rb +142 -0
  165. data/spec/riak/map_reduce_spec.rb +434 -0
  166. data/spec/riak/multiget_spec.rb +81 -0
  167. data/spec/riak/node_spec.rb +26 -0
  168. data/spec/riak/robject_spec.rb +496 -0
  169. data/spec/riak/search/index_spec.rb +72 -0
  170. data/spec/riak/search/query_spec.rb +88 -0
  171. data/spec/riak/search/result_collection_spec.rb +89 -0
  172. data/spec/riak/search/result_document_spec.rb +106 -0
  173. data/spec/riak/search/schema_spec.rb +63 -0
  174. data/spec/riak/search_spec.rb +107 -0
  175. data/spec/riak/secondary_index_spec.rb +225 -0
  176. data/spec/riak/serializers_spec.rb +121 -0
  177. data/spec/riak/stamp_spec.rb +54 -0
  178. data/spec/riak/walk_spec_spec.rb +203 -0
  179. data/spec/spec_helper.rb +66 -0
  180. data/spec/support/certs/README.md +13 -0
  181. data/spec/support/certs/ca.crt +21 -0
  182. data/spec/support/certs/client.crl +13 -0
  183. data/spec/support/certs/client.crt +94 -0
  184. data/spec/support/certs/client.csr +18 -0
  185. data/spec/support/certs/client.key +27 -0
  186. data/spec/support/certs/empty_ca.crt +21 -0
  187. data/spec/support/certs/server.crl +13 -0
  188. data/spec/support/certs/server.crt +94 -0
  189. data/spec/support/certs/server.key +27 -0
  190. data/spec/support/crdt_search_config.rb +112 -0
  191. data/spec/support/crdt_search_fixtures.rb +42 -0
  192. data/spec/support/integration_setup.rb +10 -0
  193. data/spec/support/search_config.rb +83 -0
  194. data/spec/support/search_corpus_setup.rb +39 -0
  195. data/spec/support/test_client.rb +46 -0
  196. data/spec/support/test_client.yml.example +10 -0
  197. data/spec/support/unified_backend_examples.rb +380 -0
  198. data/spec/support/version_filter.rb +12 -0
  199. data/spec/support/wait_until.rb +20 -0
  200. metadata +511 -0
data/RELEASE_NOTES.md ADDED
@@ -0,0 +1,392 @@
1
+ # Riak Ruby Client Release Notes
2
+
3
+ ## 2.2.0 Release - 2015-05-27
4
+
5
+ Version 2.2.0 is a feature release.
6
+
7
+ New features:
8
+
9
+ * Object-oriented Riak Search (Yokozuna) API.
10
+ * Object-oriented Bucket Properties API.
11
+ * Bucket type properties are readable.
12
+ * Bucket-typed buckets without properties expose properties of bucket type.
13
+ * An interface to get a preflist for Riak KV objects has been added.
14
+
15
+ Small improvements and changes:
16
+
17
+ * In line with recent Riak documentation and implementation changes, `vclock`
18
+ can also be referred to as `causal_context`.
19
+ * Support for synchronous Riak Search index creation with timeouts has been
20
+ added.
21
+
22
+ Bug fixes:
23
+
24
+ * Accessing a flag in a non-existent CRDT map returns false now.
25
+ * Escaping text in situations that require it is faster, thanks to Jordan
26
+ Goldstein.
27
+ * Loading and storing objects from bucket-typed buckets is more reliable and
28
+ correct thanks to Takeshi Akima.
29
+
30
+ ## 2.1.0 Release - 2014-10-03
31
+
32
+ Version 2.1.0 is a feature release.
33
+
34
+ New features:
35
+
36
+ * Instrumentation: if the `instrumentable` gem is loaded, the client exposes
37
+ several event hooks to `ActiveSupport::Notifications`. Read the README for
38
+ more information, and if you'd like other events to be instrumented, please
39
+ file GitHub issues. Instrumentation was developed by Ryan Daigle.
40
+ * CRDTs support the `returnbody` option, and use it by default. This means that
41
+ unless specified otherwise, CRDTs will update themselves on a write.
42
+
43
+ Small changes:
44
+
45
+ * UTF-8 support is now tested against.
46
+ * RSpec 3.1 is now supported, although RSpec 3.0 still works.
47
+ * Specs no longer use gratuitous "should"s.
48
+
49
+ ## 2.0.0 Release - 2014-09-05
50
+
51
+ Version 2.0.0 is a major new version with many new features, API changes,
52
+ and feature removals.
53
+
54
+ New features:
55
+
56
+ * Yokozuna: full-text search built on Solr and powered by Riak.
57
+ * Riak security: TLS-encrypted and authenticated protocol buffers, access
58
+ control, and more!
59
+ * Convergent Replicated Data Types (CRDTs): counters, maps, and sets, all with
60
+ convenient and safe distributed semantics.
61
+ * Bucket types: the building blocks of Yokozuna, access control, and CRDTs.
62
+
63
+ API changes:
64
+
65
+ * Exceptions raised by the client are subclasses of `Riak::Error`.
66
+ * The internals of the Beefcake-based protocol buffers support have been
67
+ refactored for reliability and maintainability.
68
+ * The Beefcake version has been bumped to 1.0 for improvements in speed and
69
+ memory usage.
70
+ * Tests now use RSpec 3.
71
+
72
+ Removed:
73
+
74
+ * HTTP support has been removed from the Riak Ruby Client in favor of focusing
75
+ on Protocol Buffers.
76
+ * The included test-server has been removed. Tests now require a Riak node to
77
+ be configured and run independently of the test suite.
78
+
79
+ ## 1.4.2 Bugfix Release - 2013-09-20
80
+
81
+ Release 1.4.2 fixes a couple bugs.
82
+
83
+ Bugfixes:
84
+
85
+ * 2i Requests over PBC block forever when 0 results match in 1.4.x,
86
+ reported by Sean "graphex" McKibben in
87
+ https://github.com/basho/riak-ruby-client/pull/121 and
88
+ https://github.com/basho/riak-ruby-client/pull/122
89
+ * RObject#links is an Array when loaded from PBC, reported by Dan Pisarski in
90
+ https://github.com/basho/riak-ruby-client/pull/123
91
+
92
+ ## 1.4.1 Patch/Bugfix Release - 2013-09-06
93
+
94
+ Release 1.4.1 fixes a few minor bugs and issues.
95
+
96
+ Issues:
97
+
98
+ * Test for object existence using head request, reported and fixed by
99
+ Elias "eliaslevy" Levy in https://github.com/basho/riak-ruby-client/pull/102
100
+
101
+ Bugfixes:
102
+
103
+ * License missing from gemspec, reported by Benjamin "bf4" Fleischer
104
+ in https://github.com/basho/riak-ruby-client/pull/108
105
+ * Debugger required by Gemfile, reported by Basho Giddyup
106
+ in https://github.com/basho/riak-ruby-client/pull/114
107
+ * Issue when reading Git-based version numbers, reported and fixed by
108
+ jacepp in https://github.com/basho/riak-ruby-client/pull/120
109
+
110
+ ## 1.4.0 Feature Release - 2013-08-16
111
+
112
+ Release 1.4.0 adds support for Riak 1.4 and fixes a few bugs.
113
+
114
+ Features for all Riak versions:
115
+
116
+ * Multi-get parallelizes fetching multiple objects from one or more
117
+ buckets.
118
+
119
+ Features for Riak 1.4 and newer:
120
+
121
+ * Bucket properties are settable and resettable over Protocol Buffers.
122
+ * Distributed counters are implemented by the `Riak::Counter` class.
123
+ * The full set of improvements to Secondary Indexes
124
+ are available, including pagination, streaming, and return_terms.
125
+ These features are available through the existing `Bucket#get_index`
126
+ interface as well as the new `Riak::SecondaryIndex` interface.
127
+ * The new streaming bucket list is available in the Ruby client.
128
+ * Setting timeout values for object CRUD, key listing, and bucket
129
+ listing is now possible.
130
+
131
+ Bugfixes:
132
+
133
+ * Tests pass and don't stall in Ruby 2.0.
134
+ * Zero-length key and bucket names are forbidden in the client.
135
+ * Test server works with Riak 1.4.
136
+
137
+ ## 1.2.0 Feature Release - 2013-05-15
138
+
139
+ Release 1.2.0 adds support for Riak 1.3 and fixes a number of bugs.
140
+
141
+ Features:
142
+
143
+ * The "clear bucket properties" feature has been added. This resets
144
+ modified bucket properties to the defaults on Riak 1.3+ clusters.
145
+ * Anonymous "strfun" MapReduce functions written in Erlang can now be
146
+ sent from the client, if they are enabled on the server-side.
147
+
148
+ Bugfixes:
149
+
150
+ * The WalkSpec class now properly includes the Translation module.
151
+ * The Protocol Buffers transport now extracts the bucket name before
152
+ submitting secondary index queries.
153
+ * Search query results returned over PBC are assumed to be UTF-8
154
+ encoded.
155
+ * The newer Excon API is now supported (>= 0.19.0).
156
+ * When enabling the search commit hook, the 'precommit' property will
157
+ now be checked more safely.
158
+
159
+ ## 1.1.1 Patch/Bugfix Release - 2013-01-10
160
+
161
+ Release 1.1.1 fixes a minor bug with Net::HTTP on Ruby 1.8.7 with
162
+ patch level less than 315, where an exception would cause closing the
163
+ socket before it was opened.
164
+
165
+ ## 1.1.0 Feature Release - 2012-11-07
166
+
167
+ Release 1.1.0 includes full Riak 1.2 compatibility, and includes
168
+ improvements to the handling of siblings, the node generation
169
+ tools, and resolves a number of important bugs.
170
+
171
+ Features:
172
+
173
+ * Client features are enabled or disabled based on the detected Riak
174
+ version.
175
+ * Riak 1.2 compatibility, including search and 2I over Protocol
176
+ Buffers.
177
+ * Phaseless MapReduce (which was available in 1.1) is allowed, using
178
+ feature detection to determine whether an exception is raised.
179
+ * Conditional store_object operations on Protocol Buffers use the
180
+ message features available since Riak 1.0.
181
+ * The integration test-suite can be run without generating a test
182
+ node, which lets us support riak_test.
183
+
184
+ Bugfixes:
185
+
186
+ * URL-escaping now allows some normally URI-safe characters to be
187
+ escaped.
188
+ * JRuby should be more reliable when attaching to a generated node's
189
+ console.
190
+ * The client backend pool has been extracted to the Innertube gem,
191
+ which is now a dependency.
192
+ * Fix a documentation issue around key-filters.
193
+ * Fix RSpec formatter and deprecation errors.
194
+ * Object siblings are now a separate class (RContent) rather than
195
+ being unclean copies of the parent RObject. If only one sibling
196
+ exists, the original accessors (e.g. `content_type`, `data`) will
197
+ behave as expected. When more than one sibling exists, they will
198
+ raise `Riak::Conflict`. This should prevent unintentional storing of
199
+ unresolved objects back into Riak as `multipart/mixed` values.
200
+ * `Riak::Client#ssl=` won't blow away existing `ssl_options` if set to
201
+ `true`.
202
+ * Generated nodes will ensure that the source's
203
+ `ssl_distribution.args_file` exists by invoking `riak chkconfig`.
204
+ * Copy fixes for the `$key` index on the memory/test backend from
205
+ riak_kv.
206
+ * The shape of MapReduce results will no longer be changed by the
207
+ Protocol Buffers backend, which manifested as kept phases without
208
+ results being removed from the return value. Implementing this
209
+ required all HTTP requests to use streaming, even if invoked without
210
+ a block.
211
+
212
+ ## 1.0.5 Packaging Fix Release - 2012-10-12
213
+
214
+ Release 1.0.5 fixes a bug with the RubyGems packaging that
215
+ inadvertently included the `pkg` directory, which might have included
216
+ old gem versions. No client functionality has changed with this
217
+ release.
218
+
219
+ ## 1.0.4 Patch/Bugfix Release - 2012-07-06
220
+
221
+ Release 1.0.4 fixes some bugs and adds configurable timeouts to the
222
+ Excon HTTP backend.
223
+
224
+ **NOTE** This will likely be the last release in the 1.0.x series. The
225
+ planned changes for 1.1.x are:
226
+
227
+ * `Riak::Client::Pool` will be replaced by the `innertube` gem, which
228
+ is its extraction.
229
+ * Riak 1.2 will be fully supported, including the new native 2I and
230
+ Search features over PBC.
231
+ * A richer exception hierarchy so that applications can deal more
232
+ intelligently with request failures.
233
+
234
+ Changes in 1.0.4:
235
+
236
+ * A function in the `app_helper` module that does not exist on Riak
237
+ 1.1 and earlier was copied into the KV test backend.
238
+ * Excon's configuration logic was made more idempotent.
239
+ * Added timeout support to the Excon HTTP backend. [Mat Brown]
240
+ * Corrected an misnamed constant in Excon which would cause timeouts
241
+ not to be recognized as network errors.
242
+ * The `Riak::TestServer` is now compatible with Riak 1.2.
243
+ * A documentation error around `RObject#data` in the README was
244
+ fixed. [dn@wortbit.de]
245
+ * Fixed an ETS table leak in the testing backend.
246
+ * Deprecation warnings for later versions of MultiJson are now
247
+ resolved.
248
+
249
+ ## 1.0.3 Patch/Bugfix Release - 2012-04-17
250
+
251
+ Release 1.0.3 fixes some bugs and adds support for secondary indexes
252
+ when using `Riak::TestServer`.
253
+
254
+ * Added tests for secondary index features to the unified backend
255
+ examples.
256
+ * Added secondary index support to `riak_kv_test_backend`. Full
257
+ support for this feature will be available via
258
+ `riak_kv_memory_backend` in the next major Riak release. See
259
+ [riak_kv #314](https://github.com/basho/riak_kv/pull/314).
260
+ * The console log (`lager_console_backend`) is now enabled on
261
+ generated nodes.
262
+ * `Riak::Node::Console` no longer overrides the `SIGWINCH` signal
263
+ handler.
264
+ * [Excon](http://rubygems.org/gems/excon) versions >= 0.7.0 are now
265
+ supported.
266
+ * IO-style objects will now be emitted properly when using the
267
+ `NetHTTPBackend`. [#1](https://github.com/basho/riak-ruby-client/issues/1)
268
+ * The Riak version filter for integration specs is now more correct.
269
+ * `Riak::RObject#url` has been removed because its accuracy cannot be
270
+ maintained when connected to multiple Riak nodes or to Riak via
271
+ PBC. [#3](https://github.com/basho/riak-ruby-client/issues/3)
272
+ * Index entries on `Riak::RObject` can be mass-overwritten using
273
+ `Riak::RObject#indexes=` while maintaining the proper internal
274
+ semantics. [#17](https://github.com/basho/riak-ruby-client/issues/17)
275
+ * Nodes should now generate properly when the `riak` script is a
276
+ symlink (e.g. Homebrew). [#26](https://github.com/basho/riak-ruby-client/issues/26)
277
+
278
+ ## 1.0.2 Repackaging - 2012-04-02
279
+
280
+ Release 1.0.2 relaxes the multi_json dependency so that the client
281
+ will function with Rails 3.2. Version 1.0.1 was yanked.
282
+
283
+ ## 1.0.1 Patch/Bugfix Release - 2012-04-02
284
+
285
+ Release 1.0.1 is a minor bugfix/patch release. Included in this
286
+ release are:
287
+
288
+ * I18n messages now include the French locale. [Eric Cestari]
289
+ * SSL configuration should work again. [Adam Hunter]
290
+ * The version comparison when checking Excon compatibility should now
291
+ handle large version numbers correctly. [Srdjan Pejic]
292
+ * There is now a spec to verify that the `riak_kv` `add_paths` setting
293
+ is not clobbered by the `Riak::TestServer` when adding the location
294
+ of the test backend code.
295
+
296
+ ## 1.0.0 Feature Release - 2012-02-03
297
+
298
+ Release 1.0.0 is a major feature release and is the first where
299
+ `riak-client`, `ripple`, and `riak-sessions` will be released
300
+ independently (see below). Because there too many individual changes
301
+ to recount, this entry will cover the major features and bugfixes
302
+ present in the release.
303
+
304
+ ### Riak 1.0/1.1 Compatibility
305
+
306
+ `riak-client` is fully compatible with Riak 1.0.x and
307
+ (yet-to-be-released) 1.1.x, including supporting secondary indexes,
308
+ integrated search, and cluster membership commands.
309
+
310
+ ### Multi-node Connections and Retries
311
+
312
+ `Riak::Client` can now connect to multiple Riak nodes at once. This
313
+ greatly improves throughput and allows the client to recover from
314
+ intermittent connection errors while continuing normal operation. To
315
+ enable this, all uses of the Pump/Fiber logic were removed in favor of
316
+ connection pools from which any new request can draw an existing or
317
+ create a new connection. Which node is selected for any new connection
318
+ is based on a quickly-decaying EWMA of its success rate on recent
319
+ requests. A huge thanks to [Kyle Kingsbury](https://github.com/aphyr)
320
+ who did most of the work on this!
321
+
322
+ ### Improved TestServer and Node Generation
323
+
324
+ The `Riak::TestServer` class has been generalized such that you can
325
+ generate regular nodes and even clusters that store data on disk. This
326
+ is especially useful if you want separate nodes or clusters for each
327
+ project that uses Riak, and to keep them separate from your base
328
+ install. `TestServer` also now launches the node in a separate process
329
+ (not a child process) so you can keep it running between test
330
+ suites. Clearing the in-memory data is performed by connecting to the
331
+ console via the exposed Unix pipes, rather than over stdio.
332
+
333
+ ### Conflict Resolution
334
+
335
+ An important part of dealing with eventual consistency is the ability
336
+ to handle when conflicts (also called siblings) are created. Now you
337
+ can resolve them automatically by registering blocks (callbacks) using
338
+ `Riak::RObject.on_conflict`. The block will be called when fetching a
339
+ key in conflict and receives a `RObject` that has siblings. To resolve
340
+ the conflict, it simply returns the resolved object, or nil if it
341
+ didn't handle the conflict. A huge thanks to
342
+ [Myron Marston](https://github.com/myronmarston) who implemented this!
343
+
344
+ ### Serializers
345
+
346
+ Before, serialization of Ruby objects into Riak was constrained to
347
+ three formats: JSON, YAML and Marshal. Now you can define your own
348
+ serializers so that you can store data in BSON, MsgPack, NetStrings,
349
+ or whatever format you like. Use `Riak::Serializers[content_type] =
350
+ serializer` to assign a serializer for the selected media type. The
351
+ serializer must respond to `#dump` and `#load`. (More handiwork of Myron
352
+ Marston, thanks!)
353
+
354
+ ### Stamps
355
+
356
+ If you don't like the keys that Riak hands out when you store an
357
+ `RObject` without a key, and you want something naturally ordered, you
358
+ can now generate them client-side using `Riak::Stamp`, which will
359
+ generate 64-bit integers in a fashion similar to Twitter's Snowflake,
360
+ but uses `Riak::Client#client_id` as the machine identifier.
361
+
362
+ ### Repository/Feature split
363
+
364
+ In an effort to decouple development of the individual projects and
365
+ reduce top-level dependencies, the `ripple` repository was split into
366
+ new repositories containing its corresponding sub-projects.
367
+ Additionally, the `Riak::CacheStore` has become its own project/gem.
368
+ The new gem and repository locations are below:
369
+
370
+ * [`riak-client`](http://rubygems.org/gems/riak-client) —
371
+ [basho/riak-ruby-client](https://github.com/basho/riak-ruby-client)
372
+ * [`ripple`](http://rubygems.org/gems/ripple) —
373
+ [seancribbs/ripple](https://github.com/seancribbs/ripple)
374
+ * [`riak-sessions`](http://rubygems.org/gems/riak-sessions) —
375
+ [seancribbs/riak-sessions](https://github.com/seancribbs/riak-sessions)
376
+ * [`riak-cache`](http://rubygems.org/gems/riak-cache) —
377
+ [seancribbs/riak-cache](https://github.com/seancribbs/riak-cache)
378
+
379
+ ### Significant Known Issues
380
+
381
+ Attempting to use the Protocol Buffers transport with a 0.14.x cluster
382
+ may cause the connection to dump because of incompatibilities in
383
+ certain protocol messages. This will be addressed in a future
384
+ patch/bugfix release.
385
+
386
+ The new node generation and test server intermittently fails on JRuby,
387
+ specifically from deadlocks related to blocking opens for the console
388
+ FIFOs. The JRuby team has helped on this issue, but there may not be a
389
+ clear resolution path until JRuby 1.7 or later.
390
+
391
+ Other known issues may be found on the
392
+ [Github issue tracker](https://github.com/basho/riak-ruby-client/issues?milestone=1).
data/Rakefile ADDED
@@ -0,0 +1,119 @@
1
+ require 'rubygems'
2
+ require 'rubygems/package_task'
3
+ require 'yard'
4
+ require 'rspec/core'
5
+ require 'rspec/core/rake_task'
6
+
7
+ def gemspec
8
+ $riakclient_gemspec ||= Gem::Specification.load("riak-client.gemspec")
9
+ end
10
+
11
+ Gem::PackageTask.new(gemspec) do |pkg|
12
+ pkg.need_zip = false
13
+ pkg.need_tar = false
14
+ end
15
+
16
+ YARD::Rake::YardocTask.new :doc do |doc|
17
+ doc.options = ["--markup markdown",
18
+ "--markup-provider=kramdown",
19
+ "--charset utf-8",
20
+ '-',
21
+ 'lib/**/*.rb',
22
+ '*.md',
23
+ '*.markdown'
24
+ ].map{|e| e.split(' ')}.flatten
25
+ end
26
+
27
+ task :gem => :gemspec
28
+
29
+ desc %{Validate the gemspec file.}
30
+ task :gemspec do
31
+ gemspec.validate
32
+ end
33
+
34
+ desc %{Release the gem to RubyGems.org}
35
+ task :release => :gem do
36
+ system "gem push pkg/#{gemspec.name}-#{gemspec.version}.gem"
37
+ end
38
+
39
+ desc "Cleans up white space in source files"
40
+ task :clean_whitespace do
41
+ no_file_cleaned = true
42
+
43
+ Dir["**/*.rb"].each do |file|
44
+ contents = File.read(file)
45
+ cleaned_contents = contents.gsub(/([ \t]+)$/, '')
46
+ unless cleaned_contents == contents
47
+ no_file_cleaned = false
48
+ puts " - Cleaned #{file}"
49
+ File.open(file, 'w') { |f| f.write(cleaned_contents) }
50
+ end
51
+ end
52
+
53
+ if no_file_cleaned
54
+ puts "No files with trailing whitespace found"
55
+ end
56
+ end
57
+
58
+ desc "Run Unit Specs Only"
59
+ RSpec::Core::RakeTask.new(:spec) do |spec|
60
+ spec.rspec_opts = %w[--profile --tag ~integration --tag ~slow]
61
+ end
62
+
63
+ namespace :spec do
64
+ desc "Run Integration Specs Only (without explicitly slow specs)"
65
+ RSpec::Core::RakeTask.new(:integration) do |spec|
66
+ spec.rspec_opts = %w[--profile --tag '~slow' --tag integration]
67
+ end
68
+
69
+ desc "Run All Specs (without explicitly slow specs)"
70
+ RSpec::Core::RakeTask.new(:all) do |spec|
71
+ spec.rspec_opts = %w[--profile --tag '~slow']
72
+ end
73
+
74
+ desc "Run Slow Specs Only"
75
+ RSpec::Core::RakeTask.new(:slow) do |spec|
76
+ spec.rspec_opts = %w[--profile --tag slow]
77
+ end
78
+ end
79
+
80
+ desc "Run All Specs (including slow specs)"
81
+ RSpec::Core::RakeTask.new(:ci) do |spec|
82
+ spec.rspec_opts = %w[--profile]
83
+ end
84
+ task :default => :ci
85
+
86
+
87
+ desc "Generate Protocol Buffers message definitions from riak_pb"
88
+ task :pb_defs => 'beefcake:pb_defs'
89
+
90
+ namespace :beefcake do
91
+ task :pb_defs => 'lib/riak/client/beefcake/messages.rb'
92
+
93
+ PROTO_FILES = %w{riak_kv riak_search riak_yokozuna riak_dt}
94
+ PROTO_TMP = PROTO_FILES.map{|f| "tmp/#{f}.pb.rb"}
95
+
96
+ task :clean do
97
+ sh "rm -rf tmp/riak_pb"
98
+ sh "rm -rf #{PROTO_TMP.join ' '}"
99
+ end
100
+
101
+
102
+ file 'lib/riak/client/beefcake/messages.rb' => PROTO_TMP do |t|
103
+ sh "cat lib/riak/client/beefcake/header tmp/riak.pb.rb #{t.prerequisites.join ' '} lib/riak/client/beefcake/footer > #{t.name}"
104
+ end
105
+
106
+ PROTO_FILES.each do |f|
107
+ file "tmp/#{f}.pb.rb" => 'tmp/riak_pb' do |t|
108
+ sh "protoc --beefcake_out tmp -I tmp/riak_pb/src tmp/riak_pb/src/#{f}.proto"
109
+ end
110
+ end
111
+
112
+ directory 'tmp'
113
+
114
+ directory 'tmp/riak_pb' => 'tmp' do
115
+ cd 'tmp' do
116
+ sh "git clone -b develop https://github.com/basho/riak_pb.git"
117
+ end
118
+ end
119
+ end