riak-client 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -2
- data/README.md +9 -2
- data/RELNOTES.md +71 -68
- data/lib/riak/bucket.rb +3 -6
- data/lib/riak/bucket_type.rb +4 -2
- data/lib/riak/client/beefcake/socket.rb +7 -3
- data/lib/riak/crdt/map.rb +0 -1
- data/lib/riak/crdt/set.rb +4 -1
- data/lib/riak/crdt/typed_collection.rb +9 -5
- data/lib/riak/util/string.rb +31 -0
- data/lib/riak/version.rb +1 -1
- data/riak-client.gemspec +9 -8
- data/spec/integration/riak/encodings/crdt_spec.rb +24 -4
- data/spec/integration/riak/protobuffs/timeouts_spec.rb +147 -143
- data/spec/riak/util/gzip_spec.rb +14 -2
- data/spec/support/test_client.rb +8 -2
- metadata +49 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 775e6ed1950061ebe5279c61fff8acf00bfa05a2
|
4
|
+
data.tar.gz: fc0faafd31a106b8b68efe324fd96f70f89989e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8c7827313ac1b86e7224a54691c650252703c9b29036f69450a469ce924034cb1cf62e758af6d054c9b0a45646464273db4b0a16e57ad69c25c92cea8ce061c
|
7
|
+
data.tar.gz: 7d66559d01009bc676694f0d7807f01051f02d2cb80a08e86d46fe8cf25e21b2ed6daf6c8bd28ef9801fc1f6b759bf34a37b003abc37c8a592297961d83b0aa0
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -9,10 +9,17 @@ Exhaustive documentation is available at
|
|
9
9
|
http://basho.github.io/riak-ruby-client/ , and API documentation can be
|
10
10
|
read at http://www.rubydoc.info/gems/riak-client/frames .
|
11
11
|
|
12
|
+
## Build Status
|
13
|
+
|
14
|
+
[](https://travis-ci.org/basho/riak-ruby-client)
|
15
|
+
|
12
16
|
## Dependencies
|
13
17
|
|
14
|
-
Ruby 1.9.3, 2.0, 2.1, and 2.2 are supported. JRuby in
|
15
|
-
|
18
|
+
Ruby 1.9.3, 2.0, 2.1, and 2.2 are supported. JRuby in 2.0 mode is also supported.
|
19
|
+
|
20
|
+
Travis CI is configured to run unit tests on 1.9.3, 2.X versions of Ruby and JRuby.
|
21
|
+
|
22
|
+
*NOTE:* official support for the [Ruby 1.9 series ended February of 2015](https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015/).
|
16
23
|
|
17
24
|
In JRuby 1.7.13, OCSP validation is absent, and CRL validation always
|
18
25
|
fails. [This issue is being tracked][1] and this document will be updated when
|
data/RELNOTES.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Riak Ruby Client Release Notes
|
2
2
|
|
3
|
-
## [2.4.
|
3
|
+
## [`2.4.1` Release - 2016-08-02](https://github.com/basho/riak-ruby-client/issues?q=milestone%3Ariak-ruby-client-2.4.1)
|
4
|
+
|
5
|
+
Version `2.4.1` is a bugfix release that addresses some issues when using Ruby `1.9.3`.
|
6
|
+
|
7
|
+
* [Update `1.9.3` support](https://github.com/basho/riak-ruby-client/pull/281)
|
8
|
+
|
9
|
+
## [`2.4.0` Release - 2016-06-15](https://github.com/basho/riak-ruby-client/issues?q=milestone%3Ariak-ruby-client-2.4.0)
|
4
10
|
|
5
11
|
Highlights (see milestone for full changes):
|
6
12
|
|
@@ -8,22 +14,19 @@ Highlights (see milestone for full changes):
|
|
8
14
|
* [Add `gzip` encoding support](https://github.com/basho/riak-ruby-client/pull/273)
|
9
15
|
* [Support connect, read and write socket timeouts](https://github.com/basho/riak-ruby-client/pull/270)
|
10
16
|
|
11
|
-
## 2.3.2 Release - 2016-01-12
|
17
|
+
## `2.3.2` Release - 2016-01-12
|
12
18
|
|
13
|
-
Version 2.3.2 is a bugfix release with a small fix in support of the Riak TS
|
14
|
-
time series database.
|
19
|
+
Version `2.3.2` is a bugfix release with a small fix in support of the Riak TS time series database.
|
15
20
|
|
16
21
|
* Queries that return no data will return an empty collection.
|
17
22
|
|
18
|
-
## 2.3.0 Release - 2015-12-15
|
23
|
+
## `2.3.0` Release - 2015-12-15
|
19
24
|
|
20
|
-
Version 2.3.0 is a feature release, introducing support for the Riak TS time
|
21
|
-
series database.
|
25
|
+
Version `2.3.0` is a feature release, introducing support for the Riak TS time series database.
|
22
26
|
|
23
27
|
New features:
|
24
28
|
|
25
|
-
* Riak TS support, for queries, reads, writes, and deletes. Key list support
|
26
|
-
is also provided.
|
29
|
+
* Riak TS support, for queries, reads, writes, and deletes. Key list support is also provided.
|
27
30
|
* Network error logging, thanks to Sebastian Röbke.
|
28
31
|
|
29
32
|
Bug fixes:
|
@@ -31,18 +34,18 @@ Bug fixes:
|
|
31
34
|
* The `last_modified` field on `RContent` and `RObject` objects now has
|
32
35
|
microsecond precision, thanks to Sebastian Röbke.
|
33
36
|
|
34
|
-
## 2.2.2 Release - 2015-11-24
|
37
|
+
## `2.2.2` Release - 2015-11-24
|
35
38
|
|
36
|
-
Version 2.2.2 is a bugfix release.
|
39
|
+
Version `2.2.2` is a bugfix release.
|
37
40
|
|
38
|
-
* Corrected Hidekazu Tanaka's name in the 2.2.1 release notes.
|
41
|
+
* Corrected Hidekazu Tanaka's name in the `2.2.1` release notes.
|
39
42
|
* Deleting maps inside map CRDTs works, thanks to Kazuhiro Suzuki.
|
40
43
|
* Fix `Riak::Search::Index` documentation in the readme, thanks to Zshawn Syed.
|
41
|
-
* Tighten up the i18n gem requirement, thanks to Sean Kelly.
|
44
|
+
* Tighten up the `i18n` gem requirement, thanks to Sean Kelly.
|
42
45
|
|
43
|
-
## 2.2.1 Release - 2015-06-19
|
46
|
+
## `2.2.1` Release - 2015-06-19
|
44
47
|
|
45
|
-
Version 2.2.1 is a bugfix release, and includes additional testing of character
|
48
|
+
Version `2.2.1` is a bugfix release, and includes additional testing of character
|
46
49
|
encodings.
|
47
50
|
|
48
51
|
Bug fixes:
|
@@ -63,9 +66,9 @@ Testing enhancements:
|
|
63
66
|
findings are available on our documentation site:
|
64
67
|
http://basho.github.io/riak-ruby-client/encoding.html
|
65
68
|
|
66
|
-
## 2.2.0 Release - 2015-05-27
|
69
|
+
## `2.2.0` Release - 2015-05-27
|
67
70
|
|
68
|
-
Version 2.2.0 is a feature release.
|
71
|
+
Version `2.2.0` is a feature release.
|
69
72
|
|
70
73
|
New features:
|
71
74
|
|
@@ -90,9 +93,9 @@ Bug fixes:
|
|
90
93
|
* Loading and storing objects from bucket-typed buckets is more reliable and
|
91
94
|
correct thanks to Takeshi Akima.
|
92
95
|
|
93
|
-
## 2.1.0 Release - 2014-10-03
|
96
|
+
## `2.1.0` Release - 2014-10-03
|
94
97
|
|
95
|
-
Version 2.1.0 is a feature release.
|
98
|
+
Version `2.1.0` is a feature release.
|
96
99
|
|
97
100
|
New features:
|
98
101
|
|
@@ -106,12 +109,12 @@ New features:
|
|
106
109
|
Small changes:
|
107
110
|
|
108
111
|
* UTF-8 support is now tested against.
|
109
|
-
* RSpec 3.1 is now supported, although RSpec 3.0 still works.
|
112
|
+
* RSpec `3.1` is now supported, although RSpec `3.0` still works.
|
110
113
|
* Specs no longer use gratuitous "should"s.
|
111
114
|
|
112
|
-
## 2.0.0 Release - 2014-09-05
|
115
|
+
## `2.0.0` Release - 2014-09-05
|
113
116
|
|
114
|
-
Version 2.0.0 is a major new version with many new features, API changes,
|
117
|
+
Version `2.0.0` is a major new version with many new features, API changes,
|
115
118
|
and feature removals.
|
116
119
|
|
117
120
|
New features:
|
@@ -128,7 +131,7 @@ API changes:
|
|
128
131
|
* Exceptions raised by the client are subclasses of `Riak::Error`.
|
129
132
|
* The internals of the Beefcake-based protocol buffers support have been
|
130
133
|
refactored for reliability and maintainability.
|
131
|
-
* The Beefcake version has been bumped to 1.0 for improvements in speed and
|
134
|
+
* The Beefcake version has been bumped to `1.0` for improvements in speed and
|
132
135
|
memory usage.
|
133
136
|
* Tests now use RSpec 3.
|
134
137
|
|
@@ -139,22 +142,22 @@ Removed:
|
|
139
142
|
* The included test-server has been removed. Tests now require a Riak node to
|
140
143
|
be configured and run independently of the test suite.
|
141
144
|
|
142
|
-
## 1.4.2 Bugfix Release - 2013-09-20
|
145
|
+
## `1.4.2` Bugfix Release - 2013-09-20
|
143
146
|
|
144
|
-
Release 1.4.2 fixes a couple bugs.
|
147
|
+
Release `1.4.2` fixes a couple bugs.
|
145
148
|
|
146
149
|
Bugfixes:
|
147
150
|
|
148
|
-
* 2i Requests over PBC block forever when 0 results match in 1.4.x
|
151
|
+
* 2i Requests over PBC block forever when 0 results match in `1.4.x`,
|
149
152
|
reported by Sean "graphex" McKibben in
|
150
153
|
https://github.com/basho/riak-ruby-client/pull/121 and
|
151
154
|
https://github.com/basho/riak-ruby-client/pull/122
|
152
155
|
* RObject#links is an Array when loaded from PBC, reported by Dan Pisarski in
|
153
156
|
https://github.com/basho/riak-ruby-client/pull/123
|
154
157
|
|
155
|
-
## 1.4.1 Patch/Bugfix Release - 2013-09-06
|
158
|
+
## `1.4.1` Patch/Bugfix Release - 2013-09-06
|
156
159
|
|
157
|
-
Release 1.4.1 fixes a few minor bugs and issues.
|
160
|
+
Release `1.4.1` fixes a few minor bugs and issues.
|
158
161
|
|
159
162
|
Issues:
|
160
163
|
|
@@ -170,16 +173,16 @@ Bugfixes:
|
|
170
173
|
* Issue when reading Git-based version numbers, reported and fixed by
|
171
174
|
jacepp in https://github.com/basho/riak-ruby-client/pull/120
|
172
175
|
|
173
|
-
## 1.4.0 Feature Release - 2013-08-16
|
176
|
+
## `1.4.0` Feature Release - 2013-08-16
|
174
177
|
|
175
|
-
Release 1.4.0 adds support for Riak 1.4 and fixes a few bugs.
|
178
|
+
Release `1.4.0` adds support for Riak `1.4` and fixes a few bugs.
|
176
179
|
|
177
180
|
Features for all Riak versions:
|
178
181
|
|
179
182
|
* Multi-get parallelizes fetching multiple objects from one or more
|
180
183
|
buckets.
|
181
184
|
|
182
|
-
Features for Riak 1.4 and newer:
|
185
|
+
Features for Riak `1.4` and newer:
|
183
186
|
|
184
187
|
* Bucket properties are settable and resettable over Protocol Buffers.
|
185
188
|
* Distributed counters are implemented by the `Riak::Counter` class.
|
@@ -193,18 +196,18 @@ Features for Riak 1.4 and newer:
|
|
193
196
|
|
194
197
|
Bugfixes:
|
195
198
|
|
196
|
-
* Tests pass and don't stall in Ruby 2.0
|
199
|
+
* Tests pass and don't stall in Ruby `2.0`.
|
197
200
|
* Zero-length key and bucket names are forbidden in the client.
|
198
|
-
* Test server works with Riak 1.4
|
201
|
+
* Test server works with Riak `1.4`.
|
199
202
|
|
200
|
-
## 1.2.0 Feature Release - 2013-05-15
|
203
|
+
## `1.2.0` Feature Release - 2013-05-15
|
201
204
|
|
202
|
-
Release 1.2.0 adds support for Riak 1.3 and fixes a number of bugs.
|
205
|
+
Release `1.2.0` adds support for Riak `1.3` and fixes a number of bugs.
|
203
206
|
|
204
207
|
Features:
|
205
208
|
|
206
209
|
* The "clear bucket properties" feature has been added. This resets
|
207
|
-
modified bucket properties to the defaults on Riak 1.3
|
210
|
+
modified bucket properties to the defaults on Riak `1.3+` clusters.
|
208
211
|
* Anonymous "strfun" MapReduce functions written in Erlang can now be
|
209
212
|
sent from the client, if they are enabled on the server-side.
|
210
213
|
|
@@ -215,19 +218,19 @@ Bugfixes:
|
|
215
218
|
submitting secondary index queries.
|
216
219
|
* Search query results returned over PBC are assumed to be UTF-8
|
217
220
|
encoded.
|
218
|
-
* The newer Excon API is now supported (>= 0.19.0)
|
221
|
+
* The newer Excon API is now supported `(>= 0.19.0)`.
|
219
222
|
* When enabling the search commit hook, the 'precommit' property will
|
220
223
|
now be checked more safely.
|
221
224
|
|
222
|
-
## 1.1.1 Patch/Bugfix Release - 2013-01-10
|
225
|
+
## `1.1.1` Patch/Bugfix Release - 2013-01-10
|
223
226
|
|
224
|
-
Release 1.1.1 fixes a minor bug with Net::HTTP on Ruby 1.8.7 with
|
227
|
+
Release `1.1.1` fixes a minor bug with Net::HTTP on Ruby `1.8.7` with
|
225
228
|
patch level less than 315, where an exception would cause closing the
|
226
229
|
socket before it was opened.
|
227
230
|
|
228
|
-
## 1.1.0 Feature Release - 2012-11-07
|
231
|
+
## `1.1.0` Feature Release - 2012-11-07
|
229
232
|
|
230
|
-
Release 1.1.0 includes full Riak 1.2 compatibility, and includes
|
233
|
+
Release `1.1.0` includes full Riak `1.2` compatibility, and includes
|
231
234
|
improvements to the handling of siblings, the node generation
|
232
235
|
tools, and resolves a number of important bugs.
|
233
236
|
|
@@ -235,12 +238,12 @@ Features:
|
|
235
238
|
|
236
239
|
* Client features are enabled or disabled based on the detected Riak
|
237
240
|
version.
|
238
|
-
* Riak 1.2 compatibility, including search and 2I over Protocol
|
241
|
+
* Riak `1.2` compatibility, including search and 2I over Protocol
|
239
242
|
Buffers.
|
240
|
-
* Phaseless MapReduce (which was available in 1.1) is allowed, using
|
243
|
+
* Phaseless MapReduce (which was available in `1.1`) is allowed, using
|
241
244
|
feature detection to determine whether an exception is raised.
|
242
245
|
* Conditional store_object operations on Protocol Buffers use the
|
243
|
-
message features available since Riak 1.0
|
246
|
+
message features available since Riak `1.0`.
|
244
247
|
* The integration test-suite can be run without generating a test
|
245
248
|
node, which lets us support riak_test.
|
246
249
|
|
@@ -272,32 +275,32 @@ Bugfixes:
|
|
272
275
|
required all HTTP requests to use streaming, even if invoked without
|
273
276
|
a block.
|
274
277
|
|
275
|
-
## 1.0.5 Packaging Fix Release - 2012-10-12
|
278
|
+
## `1.0.5` Packaging Fix Release - 2012-10-12
|
276
279
|
|
277
|
-
Release 1.0.5 fixes a bug with the RubyGems packaging that
|
280
|
+
Release `1.0.5` fixes a bug with the RubyGems packaging that
|
278
281
|
inadvertently included the `pkg` directory, which might have included
|
279
282
|
old gem versions. No client functionality has changed with this
|
280
283
|
release.
|
281
284
|
|
282
|
-
## 1.0.4 Patch/Bugfix Release - 2012-07-06
|
285
|
+
## `1.0.4` Patch/Bugfix Release - 2012-07-06
|
283
286
|
|
284
|
-
Release 1.0.4 fixes some bugs and adds configurable timeouts to the
|
287
|
+
Release `1.0.4` fixes some bugs and adds configurable timeouts to the
|
285
288
|
Excon HTTP backend.
|
286
289
|
|
287
|
-
**NOTE** This will likely be the last release in the 1.0.x series. The
|
288
|
-
planned changes for 1.1.x are:
|
290
|
+
**NOTE** This will likely be the last release in the `1.0.x` series. The
|
291
|
+
planned changes for `1.1.x` are:
|
289
292
|
|
290
293
|
* `Riak::Client::Pool` will be replaced by the `innertube` gem, which
|
291
294
|
is its extraction.
|
292
|
-
* Riak 1.2 will be fully supported, including the new native 2I and
|
295
|
+
* Riak `1.2` will be fully supported, including the new native 2I and
|
293
296
|
Search features over PBC.
|
294
297
|
* A richer exception hierarchy so that applications can deal more
|
295
298
|
intelligently with request failures.
|
296
299
|
|
297
|
-
Changes in 1.0.4
|
300
|
+
Changes in `1.0.4`:
|
298
301
|
|
299
302
|
* A function in the `app_helper` module that does not exist on Riak
|
300
|
-
1.1 and earlier was copied into the KV test backend.
|
303
|
+
`1.1` and earlier was copied into the KV test backend.
|
301
304
|
* Excon's configuration logic was made more idempotent.
|
302
305
|
* Added timeout support to the Excon HTTP backend. [Mat Brown]
|
303
306
|
* Corrected an misnamed constant in Excon which would cause timeouts
|
@@ -309,9 +312,9 @@ Changes in 1.0.4:
|
|
309
312
|
* Deprecation warnings for later versions of MultiJson are now
|
310
313
|
resolved.
|
311
314
|
|
312
|
-
## 1.0.3 Patch/Bugfix Release - 2012-04-17
|
315
|
+
## `1.0.3` Patch/Bugfix Release - 2012-04-17
|
313
316
|
|
314
|
-
Release 1.0.3 fixes some bugs and adds support for secondary indexes
|
317
|
+
Release `1.0.3` fixes some bugs and adds support for secondary indexes
|
315
318
|
when using `Riak::TestServer`.
|
316
319
|
|
317
320
|
* Added tests for secondary index features to the unified backend
|
@@ -324,7 +327,7 @@ when using `Riak::TestServer`.
|
|
324
327
|
generated nodes.
|
325
328
|
* `Riak::Node::Console` no longer overrides the `SIGWINCH` signal
|
326
329
|
handler.
|
327
|
-
* [Excon](http://rubygems.org/gems/excon) versions >= 0.7.0 are now
|
330
|
+
* [Excon](http://rubygems.org/gems/excon) versions >= `0.7.0` are now
|
328
331
|
supported.
|
329
332
|
* IO-style objects will now be emitted properly when using the
|
330
333
|
`NetHTTPBackend`. [#1](https://github.com/basho/riak-ruby-client/issues/1)
|
@@ -338,14 +341,14 @@ when using `Riak::TestServer`.
|
|
338
341
|
* Nodes should now generate properly when the `riak` script is a
|
339
342
|
symlink (e.g. Homebrew). [#26](https://github.com/basho/riak-ruby-client/issues/26)
|
340
343
|
|
341
|
-
## 1.0.2 Repackaging - 2012-04-02
|
344
|
+
## `1.0.2` Repackaging - 2012-04-02
|
342
345
|
|
343
|
-
Release 1.0.2 relaxes the multi_json dependency so that the client
|
344
|
-
will function with Rails 3.2. Version 1.0.1 was yanked.
|
346
|
+
Release `1.0.2` relaxes the multi_json dependency so that the client
|
347
|
+
will function with Rails 3.2. Version `1.0.1` was yanked.
|
345
348
|
|
346
|
-
## 1.0.1 Patch/Bugfix Release - 2012-04-02
|
349
|
+
## `1.0.1` Patch/Bugfix Release - 2012-04-02
|
347
350
|
|
348
|
-
Release 1.0.1 is a minor bugfix/patch release. Included in this
|
351
|
+
Release `1.0.1` is a minor bugfix/patch release. Included in this
|
349
352
|
release are:
|
350
353
|
|
351
354
|
* I18n messages now include the French locale. [Eric Cestari]
|
@@ -356,18 +359,18 @@ release are:
|
|
356
359
|
is not clobbered by the `Riak::TestServer` when adding the location
|
357
360
|
of the test backend code.
|
358
361
|
|
359
|
-
## 1.0.0 Feature Release - 2012-02-03
|
362
|
+
## `1.0.0` Feature Release - 2012-02-03
|
360
363
|
|
361
|
-
Release 1.0.0 is a major feature release and is the first where
|
364
|
+
Release `1.0.0` is a major feature release and is the first where
|
362
365
|
`riak-client`, `ripple`, and `riak-sessions` will be released
|
363
366
|
independently (see below). Because there too many individual changes
|
364
367
|
to recount, this entry will cover the major features and bugfixes
|
365
368
|
present in the release.
|
366
369
|
|
367
|
-
### Riak 1.0
|
370
|
+
### Riak `1.0`/`1.1` Compatibility
|
368
371
|
|
369
|
-
`riak-client` is fully compatible with Riak 1.0.x and
|
370
|
-
(yet-to-be-released) 1.1.x
|
372
|
+
`riak-client` is fully compatible with Riak `1.0.x` and
|
373
|
+
(yet-to-be-released) `1.1.x`, including supporting secondary indexes,
|
371
374
|
integrated search, and cluster membership commands.
|
372
375
|
|
373
376
|
### Multi-node Connections and Retries
|
@@ -441,7 +444,7 @@ The new gem and repository locations are below:
|
|
441
444
|
|
442
445
|
### Significant Known Issues
|
443
446
|
|
444
|
-
Attempting to use the Protocol Buffers transport with a 0.14.x cluster
|
447
|
+
Attempting to use the Protocol Buffers transport with a `0.14.x` cluster
|
445
448
|
may cause the connection to dump because of incompatibilities in
|
446
449
|
certain protocol messages. This will be addressed in a future
|
447
450
|
patch/bugfix release.
|
@@ -449,7 +452,7 @@ patch/bugfix release.
|
|
449
452
|
The new node generation and test server intermittently fails on JRuby,
|
450
453
|
specifically from deadlocks related to blocking opens for the console
|
451
454
|
FIFOs. The JRuby team has helped on this issue, but there may not be a
|
452
|
-
clear resolution path until JRuby 1.7 or later.
|
455
|
+
clear resolution path until JRuby `1.7` or later.
|
453
456
|
|
454
457
|
Other known issues may be found on the
|
455
458
|
[Github issue tracker](https://github.com/basho/riak-ruby-client/issues?milestone=1).
|
data/lib/riak/bucket.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'riak/util/string'
|
1
2
|
require 'riak/util/translation'
|
2
3
|
require 'riak/client'
|
3
4
|
require 'riak/robject'
|
@@ -8,6 +9,7 @@ module Riak
|
|
8
9
|
# Represents and encapsulates operations on a Riak bucket. You may retrieve a bucket
|
9
10
|
# using {Client#bucket}, or create it manually and retrieve its meta-information later.
|
10
11
|
class Bucket
|
12
|
+
include Util::String
|
11
13
|
include Util::Translation
|
12
14
|
|
13
15
|
# (Riak Search) The precommit specification for kv/search integration
|
@@ -294,12 +296,7 @@ module Riak
|
|
294
296
|
def ==(other)
|
295
297
|
return false unless self.class == other.class
|
296
298
|
return false unless self.client == other.client
|
297
|
-
return
|
298
|
-
unless self.name.respond_to?(:bytes) && other.name.respond_to?(:bytes)
|
299
|
-
return false
|
300
|
-
end
|
301
|
-
return false unless self.name.bytes == other.name.bytes
|
302
|
-
true
|
299
|
+
return equal_bytes?(self.name, other.name)
|
303
300
|
end
|
304
301
|
end
|
305
302
|
end
|
data/lib/riak/bucket_type.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
+
require 'riak/util/string'
|
1
2
|
require 'riak/bucket_typed/bucket'
|
2
3
|
require 'riak/errors/crdt_error'
|
3
4
|
|
4
5
|
module Riak
|
5
6
|
# A representation of a bucket type
|
6
7
|
class BucketType
|
8
|
+
include Util::String
|
9
|
+
|
7
10
|
attr_reader :client, :name
|
8
11
|
|
9
12
|
# The name of Riak's default bucket type.
|
@@ -70,8 +73,7 @@ module Riak
|
|
70
73
|
def ==(other)
|
71
74
|
return false unless self.class == other.class
|
72
75
|
return false unless self.client == other.client
|
73
|
-
return
|
74
|
-
true
|
76
|
+
return equal_bytes?(self.name, other.name)
|
75
77
|
end
|
76
78
|
end
|
77
79
|
end
|
@@ -20,9 +20,13 @@ module Riak
|
|
20
20
|
|
21
21
|
private
|
22
22
|
def start_tcp_socket(host, port, options = {})
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
sock = if options[:connect_timeout] && RUBY_VERSION >= '2.0.0'
|
24
|
+
Socket.tcp(host, port, connect_timeout: options[:connect_timeout])
|
25
|
+
else
|
26
|
+
Socket.tcp(host, port)
|
27
|
+
end
|
28
|
+
sock.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)
|
29
|
+
sock
|
26
30
|
end
|
27
31
|
|
28
32
|
def start_tls_socket(host, port, options)
|