jmoses-couchbase 1.3.6

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.
Files changed (91) hide show
  1. data/.gitignore +15 -0
  2. data/.travis.yml +22 -0
  3. data/.yardopts +5 -0
  4. data/CONTRIBUTING.markdown +75 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE +201 -0
  7. data/Makefile +3 -0
  8. data/README.markdown +665 -0
  9. data/RELEASE_NOTES.markdown +819 -0
  10. data/Rakefile +20 -0
  11. data/couchbase.gemspec +49 -0
  12. data/examples/chat-em/Gemfile +7 -0
  13. data/examples/chat-em/README.markdown +45 -0
  14. data/examples/chat-em/server.rb +82 -0
  15. data/examples/chat-goliath-grape/Gemfile +5 -0
  16. data/examples/chat-goliath-grape/README.markdown +50 -0
  17. data/examples/chat-goliath-grape/app.rb +67 -0
  18. data/examples/chat-goliath-grape/config/app.rb +20 -0
  19. data/examples/transcoders/Gemfile +3 -0
  20. data/examples/transcoders/README.markdown +59 -0
  21. data/examples/transcoders/cb-zcat +40 -0
  22. data/examples/transcoders/cb-zcp +45 -0
  23. data/examples/transcoders/gzip_transcoder.rb +49 -0
  24. data/examples/transcoders/options.rb +54 -0
  25. data/ext/couchbase_ext/.gitignore +4 -0
  26. data/ext/couchbase_ext/arguments.c +956 -0
  27. data/ext/couchbase_ext/arithmetic.c +316 -0
  28. data/ext/couchbase_ext/bucket.c +1373 -0
  29. data/ext/couchbase_ext/context.c +65 -0
  30. data/ext/couchbase_ext/couchbase_ext.c +1364 -0
  31. data/ext/couchbase_ext/couchbase_ext.h +644 -0
  32. data/ext/couchbase_ext/delete.c +163 -0
  33. data/ext/couchbase_ext/eventmachine_plugin.c +452 -0
  34. data/ext/couchbase_ext/extconf.rb +169 -0
  35. data/ext/couchbase_ext/get.c +316 -0
  36. data/ext/couchbase_ext/gethrtime.c +129 -0
  37. data/ext/couchbase_ext/http.c +432 -0
  38. data/ext/couchbase_ext/multithread_plugin.c +1090 -0
  39. data/ext/couchbase_ext/observe.c +171 -0
  40. data/ext/couchbase_ext/plugin_common.c +171 -0
  41. data/ext/couchbase_ext/result.c +129 -0
  42. data/ext/couchbase_ext/stats.c +163 -0
  43. data/ext/couchbase_ext/store.c +542 -0
  44. data/ext/couchbase_ext/timer.c +192 -0
  45. data/ext/couchbase_ext/touch.c +186 -0
  46. data/ext/couchbase_ext/unlock.c +176 -0
  47. data/ext/couchbase_ext/utils.c +551 -0
  48. data/ext/couchbase_ext/version.c +142 -0
  49. data/lib/action_dispatch/middleware/session/couchbase_store.rb +38 -0
  50. data/lib/active_support/cache/couchbase_store.rb +430 -0
  51. data/lib/couchbase.rb +155 -0
  52. data/lib/couchbase/bucket.rb +457 -0
  53. data/lib/couchbase/cluster.rb +119 -0
  54. data/lib/couchbase/connection_pool.rb +58 -0
  55. data/lib/couchbase/constants.rb +12 -0
  56. data/lib/couchbase/result.rb +26 -0
  57. data/lib/couchbase/transcoder.rb +120 -0
  58. data/lib/couchbase/utils.rb +62 -0
  59. data/lib/couchbase/version.rb +21 -0
  60. data/lib/couchbase/view.rb +506 -0
  61. data/lib/couchbase/view_row.rb +272 -0
  62. data/lib/ext/multi_json_fix.rb +56 -0
  63. data/lib/rack/session/couchbase.rb +108 -0
  64. data/tasks/benchmark.rake +6 -0
  65. data/tasks/compile.rake +160 -0
  66. data/tasks/test.rake +100 -0
  67. data/tasks/util.rake +21 -0
  68. data/test/profile/.gitignore +1 -0
  69. data/test/profile/Gemfile +6 -0
  70. data/test/profile/benchmark.rb +195 -0
  71. data/test/setup.rb +178 -0
  72. data/test/test_arithmetic.rb +185 -0
  73. data/test/test_async.rb +316 -0
  74. data/test/test_bucket.rb +276 -0
  75. data/test/test_cas.rb +235 -0
  76. data/test/test_couchbase.rb +77 -0
  77. data/test/test_couchbase_connection_pool.rb +77 -0
  78. data/test/test_couchbase_rails_cache_store.rb +361 -0
  79. data/test/test_delete.rb +120 -0
  80. data/test/test_errors.rb +82 -0
  81. data/test/test_eventmachine.rb +70 -0
  82. data/test/test_format.rb +164 -0
  83. data/test/test_get.rb +407 -0
  84. data/test/test_stats.rb +57 -0
  85. data/test/test_store.rb +216 -0
  86. data/test/test_timer.rb +42 -0
  87. data/test/test_touch.rb +97 -0
  88. data/test/test_unlock.rb +119 -0
  89. data/test/test_utils.rb +58 -0
  90. data/test/test_version.rb +52 -0
  91. metadata +353 -0
@@ -0,0 +1,819 @@
1
+ # Release Notes
2
+
3
+ This document is a list of user visible feature changes and important
4
+ bugfixes. Do not forget to update this doc in every important patch.
5
+
6
+ ## 1.3.6 (2014-02-17)
7
+
8
+ * [major] Fix linkage issue which blocks library installation on
9
+ windows.
10
+
11
+ ## 1.3.5 (2014-02-05)
12
+
13
+ * [major] RCBC-159, RCBC-152 Honor the :environment constructor argument
14
+
15
+ * [major] Allow inheritance from `Couchbase::Bucket`. It wasn't
16
+ possible to create a view with subclass of the `Couchbase::Bucket`.
17
+
18
+ * [major] Ensure that an exception raised early will not prevent the
19
+ finalizer from being called in the underlying client being constructed.
20
+ One example situation where this could occur:
21
+
22
+ class Couchbase::Bucket
23
+ def initialize(*args)
24
+ raise "something wrong"
25
+ super
26
+ end
27
+ end
28
+
29
+ ## 1.3.4 (2014-01-08)
30
+
31
+ * [major] Build 64-bit versions of the extensions for Windows
32
+ platform. Also support ruby 2.0 and 2.1.
33
+
34
+ * [minor] Update hacking section in README
35
+
36
+ * [minor] Fix gemspec warnings regarding versions of the dependencies.
37
+ Now it honours semantic versioning and doesn't use strict versions.
38
+
39
+ * [major] RCBC-151 Return CAS in extended mode for incr/decr
40
+
41
+ * [minor] RCBC-150 Update list of options on `Cluster.create_bucket`.
42
+ Added new options: `:replica_index`, `:flush_enabled`,
43
+ `:parallel_db_and_view_compaction`.
44
+
45
+ * [major] Allow retries on Couchbase::Bucket#cas collisions. Now it
46
+ takes a `:retry` Fixnum option that specifies the maximum number of
47
+ times the method should retry the entire get/update/set operation
48
+ when a `Couchbase::Error::KeyExists` error is encountered due to a
49
+ concurrent update from another writer between its `#get` and `#set`
50
+ calls.
51
+
52
+ * [major] MD5 and truncate ActiveSupport::Cache keys that are longer
53
+ than 250 characters.
54
+
55
+ ## 1.3.3 (2013-09-12)
56
+
57
+ * [major] RCBC-134 Allow application to use several connections with
58
+ thread-local singleton.
59
+
60
+ * [major] RCBC-135 Fixed invalid memory access which was detected by
61
+ using 'GC.stress = true' in tests.
62
+
63
+ * [major] RCBC-141 Initialize event indexes correctly. The plugin
64
+ didn't trace event callbacks, which might lead to invalid memory
65
+ access during rebalance, where libcouchbase creates/removes a lot of
66
+ events because of a fast-changing topology.
67
+
68
+ * [major] RCBC-137 Add selection options for new IO engines: select
69
+ and iocp.
70
+
71
+ * [major] When setting the username field, check for password
72
+ presence. Fixes segmentation fault in this code:
73
+
74
+ Couchbase.connect(:username => "default", :bucket => "default")
75
+
76
+ * [minor] Allow to determine the version of libcouchbase:
77
+
78
+ Couchbase.libcouchbase_version
79
+
80
+ * [major] RCBC-136 Build shared object for ruby 2.0 on windows. Also
81
+ fixes build script when using latest rake and rake-compiler.
82
+
83
+ * [minor] Fix deprecation warning on ruby 2.x. On newer versions it
84
+ should use `rb_thread_call_without_gvl()`.
85
+
86
+ ext/couchbase_ext/multithread_plugin.c: In function ‘loop_run_poll’:
87
+ ext/couchbase_ext/multithread_plugin.c:772:5: warning: ‘rb_thread_blocking_region’ is deprecated (declared at .../2.0.0-p247-dbg/include/ruby-2.0.0/ruby/intern.h:839) [-Wdeprecated-declarations]
88
+ rb_thread_blocking_region(loop_blocking_poll, args, RUBY_UBF_PROCESS, NULL);
89
+
90
+ * [major] Do not try to compile with plugins for Windows platform.
91
+
92
+ * [major] Force handle to be NULL on `lcb_create()` failure.
93
+ `lcb_create()` can leave garbage in the pointer even if the call
94
+ itself failed. This behaviour could lead to illegal memory access
95
+ on GC.
96
+
97
+ * [minor] Remove usage of `RARRAY_PTR` in favor of `rb_ary_entry`.
98
+ This improves performance significantly on Rubinius and also
99
+ improves compatibility with future CRuby 2.1 which introduces
100
+ generational garbage collection. This results in these arrays not
101
+ having to be rescanned in Rubinius and not marked as shady in
102
+ RBGCENC in CRuby 2.1.
103
+ For more discussion, also see: https://bugs.ruby-lang.org/issues/8399
104
+
105
+ ## 1.3.2 (2013-07-10)
106
+
107
+ * [major] RCBC-133 Allow application to select the strategy of reading
108
+ from replica nodes. **This version requires libcouchbase >= 2.0.7.**
109
+ Now three strategies are available:
110
+
111
+ * `:first` - synonym to `true`, previous behaviour now the
112
+ default. It means that the library will sequentially iterate
113
+ over all replicas in the configuration supplied by the cluster
114
+ and will return as soon as it finds a successful response, or
115
+ report an error.
116
+
117
+ c.get("foo", :replica => true)
118
+ c.get("foo", :replica => :first)
119
+ #=> "bar"
120
+ c.get("foo", :replica => :first, :extended => true)
121
+ #=> ["bar", 0, 11218368683493556224]
122
+
123
+ * `:all` - query all replicas in parallel. In this case the method
124
+ will return the array of the values on the all replica nodes without
125
+ a particular order. Also if the key isn't on the node, it will be
126
+ skipped in the result array.
127
+
128
+ c.get("foo", :replica => :all)
129
+ #=> ["bar", "bar", "bar"]
130
+ c.get("foo", :replica => :all, :extended => true)
131
+ #=> [["bar", 0, 11218368683493556224],
132
+ # ["bar", 0, 11218368683493556224],
133
+ # ["bar", 0, 11218368683493556224]]
134
+
135
+ * `Fixnum` - you can also select specific replica node by its
136
+ index in the cluster configuration. It should be in interval
137
+ `0...c.num_replicas`
138
+
139
+ 0...c.num_replicas
140
+ #=> 0...3
141
+ c.get("foo", :replica => 1)
142
+ #=> "bar"
143
+ c.get("foo", :replica => 42)
144
+ #=> ArgumentError: replica index should be in interval 0...3
145
+
146
+ Note that applications should not assume the order of the
147
+ replicas indicates more recent data is at a lower index number.
148
+ It is up to the application to determine which version of a
149
+ document/item it may wish to use in the case of retrieving data
150
+ from a replica.
151
+
152
+
153
+ ## 1.3.1 (2013-06-05)
154
+
155
+ * [major] RCBC-131 Couchbase::Cluster instance shouldn't require
156
+ persistent connection.
157
+
158
+ * Fix compatibility with multi_json 1.7.5. They removed VERSION
159
+ constant
160
+
161
+ ## 1.3.0 (2013-05-07)
162
+
163
+ * [major] RCBC-46 implement Couchbase::ConnectionPool to allow
164
+ applications (and ActiveSupport::Cache::CouchbaseStore) use it in
165
+ multi-threaded environment
166
+
167
+ * [major] Introduce Transcoders. This mechanism is more flexible, and
168
+ similar to how other clients encode values.
169
+
170
+ * [minor] Deprecate numeric argument to 'default_format'. Instead
171
+ of this style:
172
+
173
+ Couchbase.connect(:default_format => Couchbase::Bucket::FMT_MARSHAL)
174
+
175
+ Symbol notation or explicit transcoder entity should be used
176
+
177
+ Couchbase.connect(:default_format => :marshal)
178
+ Couchbase.connect(:transcoder => Couchbase::Transcoder::Marshal)
179
+
180
+ ## 1.2.3 (2013-04-02)
181
+
182
+ * [major] Make ActiveSupport::Cache::CouchbaseStore threadsafe
183
+
184
+ * [minor] Check for gethrtime. Needed for solaris/smartos
185
+
186
+ * [minor] Update documentation bits regarding SET operations
187
+
188
+ ## 1.2.2 (2013-02-11)
189
+
190
+ * [minor] Bucket#design_docs will return a Hash with DesignDoc
191
+ instances as a values.
192
+
193
+ * [critical] RCBC-104 Data corruption on intensive store operations.
194
+ The issue could also lead to segfaults.
195
+
196
+ * [major] RCBC-118 Alias #total_rows as #total_entries on view result
197
+ set to match documentation.
198
+
199
+ * [minor] View#fetch_all - async method for fetching all records
200
+
201
+ conn.run do
202
+ doc.recent_posts.fetch_all do |posts|
203
+ do_something_with_all_posts(posts)
204
+ end
205
+ end
206
+
207
+ * [major] Allow to use Bucket instance in completely asynchronous
208
+ environment like this, without blocking on connect:
209
+
210
+ conn = Couchbase.new(:async => true)
211
+ conn.run do
212
+ conn.on_connect do |res|
213
+ if res.success?
214
+ #
215
+ # schedule async requests
216
+ #
217
+ end
218
+ end
219
+ end
220
+
221
+ * [major] RCBC-27 EventMachine plugin to integrate with EventMachine
222
+ library. Note that the plugin is experimental at this stage.
223
+ Example:
224
+
225
+ require 'eventmachine'
226
+ require 'couchbase'
227
+
228
+ EM.epoll = true if EM.epoll?
229
+ EM.kqueue = true if EM.kqueue?
230
+ EM.run do
231
+ con = Couchbase.connect(:engine => :eventmachine, :async => true)
232
+ con.on_connect do |res|
233
+ puts "connected: #{res.inspect}"
234
+ if res.success?
235
+ con.set("emfoo", "bar") do |res|
236
+ puts "set: #{res.inspect}"
237
+ con.get("emfoo") do |res|
238
+ puts "get: #{res.inspect}"
239
+ EM.stop
240
+ end
241
+ end
242
+ else
243
+ EM.stop
244
+ end
245
+ end
246
+ end
247
+
248
+
249
+ ## 1.2.1 (2012-12-28)
250
+
251
+ * [major] RCBC-101 Persistence constraints wasn't passed to mutation
252
+ methods, so they haven't been applied properly.
253
+
254
+ * [major] RCBC-102 Inconsistent return values in case of storage
255
+ functions with persistence constraints. It always return a Hash like
256
+ in case of multi-set, even if there is only one document is being
257
+ set.
258
+
259
+ * [minor] Improve internal structures of multi-threaded IO plugin to
260
+ protect it from memory leaks when the Fiber object is forgotten.
261
+
262
+ ## 1.2.0 (2012-12-12)
263
+
264
+ 30 files changed, 2079 insertions(+), 662 deletions(-)
265
+
266
+ * Specialized io plugin for releasing Ruby GVL (thanks to
267
+ Sokolov Yura aka funny_falcon).
268
+
269
+ * Ruby 1.9.x uses global lock for ensuring integrity, and blocking
270
+ calls should be called inside rb_thread_blocking_region to allow
271
+ other threads to be runned.
272
+
273
+ * Ruby 1.8.7 have only green threads, so that rb_thread_schedule
274
+ should be called manually.
275
+
276
+ * RCBC-42 Catch exceptions from ruby callbacks
277
+
278
+ * RCBC-99 read out the StringIO contents in json gem monkey patch
279
+
280
+ * Use marshal serializer by default for session store
281
+
282
+ * Remove debugger development dependency
283
+
284
+ * Fix memory leaks and performance improvements
285
+
286
+ ## 1.2.0.z.beta5 (2012-11-29)
287
+
288
+ 25 files changed, 1419 insertions(+), 1230 deletions(-)
289
+
290
+ * RCBC-95 Use response body to clarify Couchbase::Error::HTTP
291
+
292
+ * Fix memory leaks: in async mode context wasn't freed
293
+
294
+ * Allow to setup default initial value for INCR/DECR on per connection
295
+ level.
296
+
297
+ * Make error message about libcouchbase dependency more verbose
298
+
299
+ ## 1.2.0.z.beta4 (2012-11-21)
300
+
301
+ 27 files changed, 311 insertions(+), 123 deletions(-)
302
+
303
+ * Increase default connection timeout for Views up to 75 seconds
304
+
305
+ * RCBC-94 Reset global exception after usage
306
+
307
+ * RCBC-89 Do not expose docs embedded in HTTP response. Use binary
308
+ protocol for it.
309
+
310
+ * Remove all_docs mentions. It isn't recommended to use it because of
311
+ performance issues
312
+
313
+ * Protect against non string values in :plain mode. Will raise error
314
+ if the value given isn't a string.
315
+
316
+ * RCBC-90 Update documentation about session store
317
+
318
+ * Make rack session store adapter quiet
319
+
320
+ * Update to recent libcouchbase API
321
+
322
+ * Adjust version check for MultiJson monkeypatch (8098da1)
323
+
324
+ * Do not hide ValueFormat reason. It is accessible using
325
+ Couchbase::Error::Value#inner_exception.
326
+
327
+ ## 1.2.0.z.beta3 (2012-10-16)
328
+
329
+ 18 files changed, 241 insertions(+), 57 deletions(-)
330
+
331
+ * RCBC-52 Implement bucket create/delete operations. Examples:
332
+
333
+ conn = Couchbase::Cluster.new(:hostname => "localhost",
334
+ :username => "Administrator", :password => "secret")
335
+ conn.create_bucket("my_protected_bucket",
336
+ :ram_quota => 500, # megabytes
337
+ :sasl_password => "s3cr3tBuck3t")
338
+
339
+ * Propagate status code for HTTP responses
340
+
341
+ * RCBC-87 Fix build error on Mac OS X
342
+
343
+ * Use global scope to find Error classes (thanks to @wr0ngway)
344
+
345
+ * Fix memory leaks
346
+
347
+ * Update to recent libcouchbase API
348
+
349
+ ## 1.2.0.z.beta2 (2012-09-21)
350
+
351
+ 3 files changed, 6 insertions(+), 2 deletions(-)
352
+
353
+ * RCBC-82 Not all rubies are fat on Mac OS X. Fixes build there
354
+
355
+ ## 1.2.0.z.beta (2012-09-18)
356
+
357
+ 2 files changed, 5 insertions(+), 1 deletion(-)
358
+
359
+ * Fix version ordering by using ".z" prefix before .beta. The problem
360
+ is that DP (Developer Preview) should have lower precedence than
361
+ Beta, but alphabetially ".beta" orders before ".dp". This is why
362
+ further Beta versions have ".z".
363
+
364
+ ## 1.2.0.beta (2012-09-18)
365
+
366
+ 51 files changed, 9301 insertions(+), 3364 deletions(-)
367
+
368
+ * RCBC-81 Protect against NoMethodError in extconf.rb. Fixes
369
+ gem installation
370
+
371
+ * RCBC-79 Use RESTful flush
372
+
373
+ * Various build fixes
374
+
375
+ * Add attribute reader for Error::Base status code
376
+
377
+ * CCBC-98 Expose client temporary failure error
378
+
379
+ * RCBC-28 Implement Bucket#unlock
380
+
381
+ # Unlock the single key
382
+ val, _, cas = c.get("foo", :lock => true, :extended => true)
383
+ c.unlock("foo", :cas => cas)
384
+
385
+ # Unlock several keys
386
+ c.unlock("foo" => cas1, :bar => cas2)
387
+ #=> {"foo" => true, "bar" => true}
388
+
389
+ * Fix CAS conversion for Bucket#delete method for 32-bit systems
390
+
391
+ ## 1.1.5 (2012-09-17)
392
+
393
+ 3 files changed, 9 insertions(+), 5 deletions(-)
394
+
395
+ * RCBC-81 Fixed installing issue on Mac OS X.
396
+
397
+ ## 1.1.4 (2012-08-30)
398
+
399
+ 5 files changed, 64 insertions(+), 30 deletions(-)
400
+
401
+ * RCBC-37 Allow to pass intial list of nodes which will allow to
402
+ iterate addresses until alive node will be found.
403
+
404
+ Couchbase.connect(:node_list => ['example.com:8091', 'example.org:8091', 'example.net'])
405
+
406
+ * RCBC-70 Fixed UTF-8 in the keys. Original discussion
407
+ https://groups.google.com/d/topic/couchbase/bya0lSf9uGE/discussion
408
+
409
+ ## 1.2.0.dp6 (2012-06-28)
410
+
411
+ 21 files changed, 1520 insertions(+), 428 deletions(-)
412
+
413
+ * RCBC-47 Allow to skip username for protected buckets. The will use
414
+ bucket name for credentials.
415
+
416
+ * Expose number of replicas to the user
417
+
418
+ * RCBC-6 Implement Bucket#observe command to query durable state.
419
+ Examples:
420
+
421
+ # Query state of single key
422
+ c.observe("foo")
423
+ #=> [#<Couchbase::Result:0x00000001650df0 ...>, ...]
424
+
425
+ # Query state of multiple keys
426
+ keys = ["foo", "bar"]
427
+ stats = c.observe(keys)
428
+ stats.size #=> 2
429
+ stats["foo"] #=> [#<Couchbase::Result:0x00000001650df0 ...>, ...]
430
+
431
+ * RCBC-49 Storage functions with durability requirements
432
+
433
+ # Ensure that the key will be persisted at least on the one node
434
+ c.set("foo", "bar", :observe => {:persisted => 1})
435
+
436
+ * RCBC-50 Allow to read keys from replica
437
+
438
+ * RCBC-57 Expose timers API from libcouchbase
439
+
440
+ * RCBC-59 Replicate flags in Bucket#cas operation
441
+
442
+ * Apply timeout value before connection. Currently libcouchbase shares
443
+ timeouts for connection and IO operations. This patch allows to
444
+ setup timeout on the instantiating the connection.
445
+
446
+ * RCBC-39 Allow to specify delta for incr/decr in options
447
+
448
+ * RCBC-40 Fix Bucket#cas operation behaviour in async mode. The
449
+ callback of the Bucket#cas method is triggered only once, when it
450
+ fetches old value, and it isn't possible to receive notification if
451
+ the next store operation was successful. Example, append JSON
452
+ encoded value asynchronously:
453
+
454
+ c.default_format = :document
455
+ c.set("foo", {"bar" => 1})
456
+ c.run do
457
+ c.cas("foo") do |val|
458
+ case val.operation
459
+ when :get
460
+ val["baz"] = 2
461
+ val
462
+ when :set
463
+ # verify all is ok
464
+ puts "error: #{ret.error.inspect}" unless ret.success?
465
+ end
466
+ end
467
+ end
468
+ c.get("foo") #=> {"bar" => 1, "baz" => 2}
469
+
470
+ * RCBC-43 More docs and examples on views
471
+
472
+ * RCBC-37 Bootstrapping using multiple nodes
473
+
474
+ Couchbase.connect(:node_list => ['example.com:8091', 'example.org:8091', 'example.net'])
475
+
476
+ * Inherit StandardError instead RuntimeError for errors
477
+
478
+ ## 1.2.0.dp5 (2012-06-15)
479
+
480
+ 12 files changed, 939 insertions(+), 20 deletions(-)
481
+
482
+ * Integrate with Rack and Rails session store
483
+
484
+ # rack
485
+ require 'rack/session/couchbase'
486
+ use Rack::Session::Couchbase
487
+
488
+ # rails
489
+ require 'action_dispatch/middleware/session/couchbase_store'
490
+ AppName::Application.config.session_store :couchbase_store
491
+
492
+ * Implement cache store adapter for Rails
493
+
494
+ cache_options = {
495
+ :bucket => 'protected',
496
+ :username => 'protected',
497
+ :password => 'secret',
498
+ :expires_in => 30.seconds
499
+ }
500
+ config.cache_store = :couchbase_store, cache_options
501
+
502
+ * Implement key prefix (simple namespacing)
503
+
504
+ Couchbase.connect(:key_prefix => "prefix:")
505
+
506
+ * Allow to force assembling result Hash for multi-get
507
+
508
+ connection.get("foo", "bar")
509
+ #=> [1, 2]
510
+ connection.get("foo", "bar", :assemble_hash => true)
511
+ #=> {"foo" => 1, "bar" => 2}
512
+
513
+ ## 1.2.0.dp4 (2012-06-07)
514
+
515
+ 4 files changed, 34 insertions(+), 19 deletions(-)
516
+
517
+ * Update Bucket#replace documentation: it accepts :cas option
518
+
519
+ * RCBC-36 Fix segfault. Occasional segfault when accessing the
520
+ results of a View. https://gist.github.com/2883925
521
+
522
+ ## 1.2.0.dp3 (2012-06-06)
523
+
524
+ 4 files changed, 22 insertions(+), 4 deletions(-)
525
+
526
+ * Fix for multi_json < 1.3.3
527
+
528
+ * Break out from event loop for non-chunked responses. View results
529
+ are chunked by default, so there no problems, but other requests
530
+ like Bucket#save_design_doc() were "locking" awaiting forever.
531
+
532
+ ## 1.2.0.dp2 (2012-06-06)
533
+
534
+ 22 files changed, 859 insertions(+), 253 deletions(-)
535
+
536
+ * RCBC-31 Make Bucket#get more consistent. The pattern of using more
537
+ than one argument to determine if an array should be returned is not
538
+ idiomatic. Consider the case of a multi-get in an application where
539
+ I have n items to return. If there happens to be only one item it
540
+ will be treated differently than if there happens to be 2 items.
541
+
542
+ get(["foo"]) #=> ["bar"]
543
+ get("foo") #=> "bar"
544
+ get(["x"], :extended => true) #=> {"x"=>["xval", 0, 18336939621176836096]}
545
+
546
+ * Use monotonic high resolution clock
547
+
548
+ * Implement threshold for outgoing commands
549
+
550
+ * Allow to stop event loop from ruby
551
+
552
+ * RCBC-35 Fix the View parameters escaping. More info at
553
+ https://gist.github.com/2775050
554
+
555
+ * RCBC-34 Use multi_json gem. json_gem compatibility (require
556
+ 'yajl/json_gem') is notorious for causing all kinds of issues with
557
+ various gems. The most compatible way to use yajl is to call
558
+ Yajl::Parser and Yajl::Encoder directly.
559
+
560
+ * Allow to block and wait for part of the requests
561
+
562
+ * Fixed view iterator. It doesn't lock event loop anymore This used to
563
+ cause "locks", memory leaks or even segmentation fault.
564
+
565
+ * Define views only if "views" key presented
566
+
567
+ * Require yajl as development dependency
568
+
569
+ * RCBC-76 Implement get with lock operation. Examples:
570
+
571
+ # Get and lock key using default timeout
572
+ c.get("foo", :lock => true)
573
+
574
+ # Determine lock timeout parameters
575
+ c.stats.values_at("ep_getl_default_timeout", "ep_getl_max_timeout")
576
+ #=> [{"127.0.0.2:11210"=>"15"}, {"127.0.0.1:11210"=>"30"}]
577
+
578
+ # Get and lock key using custom timeout
579
+ c.get("foo", :lock => 3)
580
+
581
+ * Update documentation
582
+
583
+ ## 1.1.3 (2012-07-27)
584
+
585
+ 5 files changed, 192 insertions(+), 101 deletions(-)
586
+
587
+ * RCBC-64 The Couchbase::Bucket class hasn't implemented the #dup
588
+ method. So it caused SEGFAULT. The patch is implementing correct
589
+ function, which copy the internals and initializes new connection.
590
+
591
+ * RCBC-59 The flags might be reset if caller will use
592
+ Couchbase::Bucket#cas operation. Here is IRB session demonstrating
593
+ the issue:
594
+
595
+ irb> Couchbase.bucket.set("foo", "bar", :flags => 0x100)
596
+ 17982951084586893312
597
+ irb> Couchbase.bucket.cas("foo") { "baz" }
598
+ 1712422461213442048
599
+ irb> Couchbase.bucket.get("foo", :extended => true)
600
+ ["baz", 0, 1712422461213442048]
601
+
602
+
603
+ * RCBC-60 Make object_space GC protector per-bucket object. Previous
604
+ version provided not completely thread-safe bucket instance, because
605
+ it was sharing global hash for protecting objects, created in
606
+ extension, from garbage collecting.
607
+
608
+ ## 1.1.2 (2012-06-05)
609
+
610
+ 5 files changed, 9 insertions(+), 4 deletions(-)
611
+
612
+ * Upgrade libcouchbase dependency to 1.0.4. Version 1.0.4 includes
613
+ important stability fixes.
614
+
615
+ * Backport debugger patch. The gem used to require debugger as
616
+ development dependency. Unfortunately ruby-debug19 isn't supported
617
+ anymore for ruby 1.9.x. But there is new gem 'debugger'. This patch
618
+ replaces this dependency.
619
+
620
+ ## 1.2.0.dp (2012-04-10)
621
+
622
+ 19 files changed, 1606 insertions(+), 93 deletions(-)
623
+
624
+ * Properly handle hashes as Couchbase.connection_options. Fixed a bug
625
+ when 'Couchbase.connection_options' for "default" connection, when
626
+ there are several arguments to pass to the connect() function when
627
+ establishing thread local connection as below:
628
+
629
+ Couchbase.connection_options = {:port => 9000, :bucket => 'myapp'}
630
+
631
+ * Implement views. Couchbase Server Views are accessible using the
632
+ view APIs. Please refer to
633
+ http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views.html
634
+ for getting started with views.
635
+
636
+ * Use verbose mode by default throwing exceptions on NOT_FOUND errors.
637
+ This means that quiet attribute is false now on new connections.
638
+
639
+ * Documentation fixes
640
+
641
+ ## 1.1.1 (2012-03-19)
642
+
643
+ 5 files changed, 83 insertions(+), 23 deletions(-)
644
+
645
+ * Flags are used differently in different clients for example between
646
+ Python and Ruby. This fix will force the format to a known value
647
+ irrespective of the flags.
648
+
649
+ * Calls between Ruby and C libraries for Couchbase which involved
650
+ default arguments had an associated arity of -1 which was not being
651
+ handled correctly. That is being handled correctly now.
652
+
653
+ ## 1.1.0 (2012-03-07)
654
+
655
+ 27 files changed, 2460 insertions(+), 849 deletions(-)
656
+
657
+ * With the usage of the URI parser from stdlib it is possible to
658
+ validate the bucket URI more strictly. Also, it is possible to
659
+ specify credentials in the URI like:
660
+ http://username:password@example.com:8091/pools/default/buckets/custom
661
+
662
+ * The "default" connection is available in thread local storage. This
663
+ mean that using the Couchbase.bucket method it is possible to get
664
+ access to current connection and there is no need to share
665
+ connections when running in multi-thread environment. Each thread
666
+ has its own connection reference.
667
+
668
+ * The direct dependency on libevent and libsasl has been removed. Now
669
+ the library doesn't require libevent headers installed.
670
+
671
+ * The disconnect and reconnect interfaces are implemented which
672
+ provide routines for explicit resource management. Connections were
673
+ freed only when the Garbage Collector found that the connection was
674
+ not being used. Now it's possible for the client to check if the
675
+ bucket was connected using 'connected?' or 'disconnect' it manually
676
+ or 'reconnect' using old settings.
677
+
678
+ * There were spurious timeout issues with a compound statement like
679
+ below. No timeout will occur unless there is a problem with the
680
+ connection.
681
+
682
+ connection.run do
683
+ connection.get("foo") {|ret| puts "got foo = #{ret.value}"}
684
+ sleep(5)
685
+ end
686
+
687
+ * It is not required to install libcouchbase or libvbucket on windows.
688
+
689
+ * It is possible to store nil as a value. It is possible to
690
+ distinguish a nil value from a missing key by looking at at the
691
+ value returned and the flags and CAS values as well.
692
+
693
+ * Based on the time out fix (CCBC-20), clients will be notified when
694
+ the connection was dropped or host isn't available.
695
+
696
+ ## 1.0.0 (2012-01-23)
697
+
698
+ 50 files changed, 4696 insertions(+), 2647 deletions(-)
699
+
700
+ * Port library to use libcouchbase instead of memcached gem.
701
+ Implemented following operations:
702
+
703
+ * get, []
704
+ * set, []=
705
+ * add
706
+ * replace
707
+ * append
708
+ * prepend
709
+ * compare-and-swap
710
+ * arithmetic (incr/decr)
711
+ * flush
712
+ * stats
713
+ * delete
714
+ * touch
715
+
716
+ * Introduce support for three data formats:
717
+
718
+ * document
719
+ * marshal
720
+ * plain
721
+
722
+ * Removed Views support
723
+
724
+ * Added benchmarks, couchbase vs. memcached vs. dalli
725
+
726
+ * Implement asynchronous protocol
727
+
728
+ ## 0.9.8 (2011-12-16)
729
+
730
+ 3 files changed, 8 insertions(+), 3 deletions(-)
731
+
732
+ * RCBC-10 Always specify credentials for non-default buckets. It was
733
+ impossible to store data in non-default buckets
734
+
735
+ ## 0.9.7 (2011-10-05)
736
+
737
+ 7 files changed, 31 insertions(+), 19 deletions(-)
738
+
739
+ * Fix design doc removing
740
+
741
+ * Fix 'set' method signature: add missing options argument
742
+
743
+ * Rename gem to 'couchbase' for easy of use. The github project still
744
+ is 'couchbase-ruby-client'
745
+
746
+ ## 0.9.6 (2011-10-04)
747
+
748
+ 13 files changed, 609 insertions(+), 99 deletions(-)
749
+
750
+ * Fix bug with decoding multiget result
751
+
752
+ * Allow create design documents from IO and String
753
+
754
+ * Rename 'json' format to 'document', and describe possible formats
755
+
756
+ * Allow to handle errors in view result stream
757
+
758
+ * Remove dependency on libyajl library: it bundled with yaji now
759
+
760
+ ## 0.9.5 (2011-08-24)
761
+
762
+ 4 files changed, 59 insertions(+), 28 deletions(-)
763
+
764
+ * Update README. Make it more human-friendly
765
+
766
+ * Removed dependency on will_paginate in development mode
767
+
768
+ ## 0.9.4 (2011-08-01)
769
+
770
+ 24 files changed, 1240 insertions(+), 78 deletions(-)
771
+
772
+ * Use streaming json parser to iterate over view results
773
+
774
+ * Update memcached gem dependency to v1.3
775
+
776
+ * Proxy TOUCH command to memcached client
777
+
778
+ * Fix minor bugs in RestClient and Document classes
779
+
780
+ * Disable CouchDB API for nodes without 'couchApiBase' key provided.
781
+
782
+ * Fix bug with unicode parsing in config listener
783
+
784
+ * 61f394e RCBC-5 Add Dave's test case: ensure memcached client
785
+ initialized. Fixes Timeout error on connecting to membase with
786
+ Couchbase.new on Ruby 1.8.7
787
+
788
+ ## 0.9.3 (2011-07-29)
789
+
790
+ 6 files changed, 167 insertions(+), 9 deletions(-)
791
+
792
+ * Use Latch (via Mutex and ConditionVariable) to wait until initial
793
+ setup will be finished.
794
+
795
+ * Update prefix for development views (from '$dev_' to 'dev_')
796
+
797
+ ## 0.9.2 (2011-07-28)
798
+
799
+ 5 files changed, 31 insertions(+), 20 deletions(-)
800
+
801
+ * Use zero TTL by default to store records forever
802
+
803
+ * Update documentation
804
+
805
+ * Wait until configuration is done
806
+
807
+ ## 0.9.1 (2011-07-25)
808
+
809
+ 3 files changed, 5 insertions(+), 2 deletions(-)
810
+
811
+ * Minor bugfix for RestClient initialization
812
+
813
+ ## 0.9.0 (2011-07-25)
814
+
815
+ 19 files changed, 1174 insertions(+)
816
+
817
+ * Initial public release. It supports most of the binary protocol
818
+ commands through memcached gem and also is able to listen to bucket
819
+ configuration and make View requests.