libcouchbase 1.2.8 → 1.3.0

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 (186) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -4
  3. data/README.md +16 -8
  4. data/ext/libcouchbase/CMakeLists.txt +34 -32
  5. data/ext/libcouchbase/RELEASE_NOTES.markdown +277 -6
  6. data/ext/libcouchbase/cmake/Modules/ConfigureDtrace.cmake +14 -0
  7. data/ext/libcouchbase/cmake/Modules/FindCouchbaseLibevent.cmake +2 -0
  8. data/ext/libcouchbase/cmake/Modules/FindCouchbaseLibuv.cmake +2 -1
  9. data/ext/libcouchbase/cmake/Modules/GenerateConfigDotH.cmake +2 -0
  10. data/ext/libcouchbase/cmake/Modules/GetLibcouchbaseFlags.cmake +8 -1
  11. data/ext/libcouchbase/cmake/Modules/GetVersionInfo.cmake +3 -3
  12. data/ext/libcouchbase/cmake/config-cmake.h.in +14 -0
  13. data/ext/libcouchbase/cmake/configure +8 -26
  14. data/ext/libcouchbase/cmake/defs.mk.in +2 -2
  15. data/ext/libcouchbase/cmake/libcouchbase.stp.in +829 -0
  16. data/ext/libcouchbase/cmake/source_files.cmake +11 -2
  17. data/ext/libcouchbase/contrib/cbsasl/CMakeLists.txt +18 -2
  18. data/ext/libcouchbase/contrib/cbsasl/include/cbsasl/cbsasl.h +44 -2
  19. data/ext/libcouchbase/contrib/cbsasl/src/client.c +285 -73
  20. data/ext/libcouchbase/contrib/cbsasl/src/common.c +4 -0
  21. data/ext/libcouchbase/contrib/cbsasl/src/scram-sha/scram_utils.c +500 -0
  22. data/ext/libcouchbase/contrib/cbsasl/src/scram-sha/scram_utils.h +99 -0
  23. data/ext/libcouchbase/contrib/cliopts/CMakeLists.txt +1 -1
  24. data/ext/libcouchbase/contrib/cliopts/cliopts.h +14 -1
  25. data/ext/libcouchbase/contrib/snappy/CMakeLists.txt +2 -3
  26. data/ext/libcouchbase/contrib/snappy/snappy-sinksource.cc +4 -0
  27. data/ext/libcouchbase/contrib/snappy/snappy-stubs-public.h +7 -5
  28. data/ext/libcouchbase/contrib/snappy/snappy.cc +7 -2
  29. data/ext/libcouchbase/example/crypto/.gitignore +2 -0
  30. data/ext/libcouchbase/example/crypto/Makefile +13 -0
  31. data/ext/libcouchbase/example/crypto/common_provider.c +24 -0
  32. data/ext/libcouchbase/example/crypto/common_provider.h +31 -0
  33. data/ext/libcouchbase/example/crypto/openssl_symmetric_decrypt.c +139 -0
  34. data/ext/libcouchbase/example/crypto/openssl_symmetric_encrypt.c +147 -0
  35. data/ext/libcouchbase/example/crypto/openssl_symmetric_provider.c +281 -0
  36. data/ext/libcouchbase/example/crypto/openssl_symmetric_provider.h +29 -0
  37. data/ext/libcouchbase/example/tracing/.gitignore +2 -0
  38. data/ext/libcouchbase/example/tracing/Makefile +8 -0
  39. data/ext/libcouchbase/example/tracing/cJSON.c +1 -0
  40. data/ext/libcouchbase/example/tracing/cJSON.h +1 -0
  41. data/ext/libcouchbase/example/tracing/tracing.c +439 -0
  42. data/ext/libcouchbase/example/tracing/views.c +444 -0
  43. data/ext/libcouchbase/include/libcouchbase/auth.h +56 -4
  44. data/ext/libcouchbase/include/libcouchbase/cbft.h +8 -0
  45. data/ext/libcouchbase/include/libcouchbase/cntl-private.h +55 -1
  46. data/ext/libcouchbase/include/libcouchbase/cntl.h +101 -1
  47. data/ext/libcouchbase/include/libcouchbase/configuration.h.in +6 -0
  48. data/ext/libcouchbase/include/libcouchbase/couchbase.h +109 -6
  49. data/ext/libcouchbase/include/libcouchbase/crypto.h +140 -0
  50. data/ext/libcouchbase/include/libcouchbase/error.h +38 -2
  51. data/ext/libcouchbase/include/libcouchbase/kvbuf.h +6 -1
  52. data/ext/libcouchbase/include/libcouchbase/metrics.h +79 -0
  53. data/ext/libcouchbase/include/libcouchbase/n1ql.h +9 -0
  54. data/ext/libcouchbase/include/libcouchbase/tracing.h +319 -0
  55. data/ext/libcouchbase/include/libcouchbase/vbucket.h +1 -1
  56. data/ext/libcouchbase/include/libcouchbase/views.h +8 -0
  57. data/ext/libcouchbase/include/memcached/protocol_binary.h +40 -10
  58. data/ext/libcouchbase/packaging/rpm/libcouchbase.spec.in +6 -14
  59. data/ext/libcouchbase/plugins/io/libuv/plugin-internal.h +3 -0
  60. data/ext/libcouchbase/plugins/io/libuv/plugin-libuv.c +1 -0
  61. data/ext/libcouchbase/plugins/io/select/plugin-select.c +4 -1
  62. data/ext/libcouchbase/src/auth-priv.h +36 -4
  63. data/ext/libcouchbase/src/auth.cc +66 -27
  64. data/ext/libcouchbase/src/bootstrap.cc +1 -1
  65. data/ext/libcouchbase/src/bucketconfig/bc_cccp.cc +12 -7
  66. data/ext/libcouchbase/src/bucketconfig/bc_http.cc +26 -17
  67. data/ext/libcouchbase/src/bucketconfig/bc_http.h +1 -1
  68. data/ext/libcouchbase/src/bucketconfig/clconfig.h +4 -2
  69. data/ext/libcouchbase/src/bucketconfig/confmon.cc +6 -3
  70. data/ext/libcouchbase/src/cbft.cc +48 -0
  71. data/ext/libcouchbase/src/cntl.cc +138 -2
  72. data/ext/libcouchbase/src/config_static.h +17 -0
  73. data/ext/libcouchbase/src/connspec.cc +54 -6
  74. data/ext/libcouchbase/src/connspec.h +9 -1
  75. data/ext/libcouchbase/src/crypto.cc +386 -0
  76. data/ext/libcouchbase/src/ctx-log-inl.h +23 -6
  77. data/ext/libcouchbase/src/dump.cc +4 -0
  78. data/ext/libcouchbase/src/getconfig.cc +1 -2
  79. data/ext/libcouchbase/src/handler.cc +65 -27
  80. data/ext/libcouchbase/src/hostlist.cc +35 -7
  81. data/ext/libcouchbase/src/hostlist.h +7 -0
  82. data/ext/libcouchbase/src/http/http-priv.h +2 -0
  83. data/ext/libcouchbase/src/http/http.cc +77 -37
  84. data/ext/libcouchbase/src/http/http_io.cc +19 -2
  85. data/ext/libcouchbase/src/instance.cc +90 -17
  86. data/ext/libcouchbase/src/internal.h +5 -0
  87. data/ext/libcouchbase/src/lcbio/connect.cc +39 -4
  88. data/ext/libcouchbase/src/lcbio/connect.h +27 -0
  89. data/ext/libcouchbase/src/lcbio/ctx.c +49 -23
  90. data/ext/libcouchbase/src/lcbio/ioutils.cc +30 -3
  91. data/ext/libcouchbase/src/lcbio/ioutils.h +2 -0
  92. data/ext/libcouchbase/src/lcbio/manager.cc +44 -8
  93. data/ext/libcouchbase/src/lcbio/manager.h +2 -0
  94. data/ext/libcouchbase/src/lcbio/rw-inl.h +1 -0
  95. data/ext/libcouchbase/src/lcbio/ssl.h +3 -5
  96. data/ext/libcouchbase/src/logging.c +1 -1
  97. data/ext/libcouchbase/src/logging.h +2 -0
  98. data/ext/libcouchbase/src/mc/compress.cc +164 -0
  99. data/ext/libcouchbase/src/mc/compress.h +7 -12
  100. data/ext/libcouchbase/src/mc/mcreq-flush-inl.h +5 -1
  101. data/ext/libcouchbase/src/mc/mcreq.c +11 -1
  102. data/ext/libcouchbase/src/mc/mcreq.h +35 -4
  103. data/ext/libcouchbase/src/mcserver/mcserver.cc +30 -7
  104. data/ext/libcouchbase/src/mcserver/mcserver.h +7 -0
  105. data/ext/libcouchbase/src/mcserver/negotiate.cc +103 -57
  106. data/ext/libcouchbase/src/mcserver/negotiate.h +2 -2
  107. data/ext/libcouchbase/src/mctx-helper.h +11 -0
  108. data/ext/libcouchbase/src/metrics.cc +132 -0
  109. data/ext/libcouchbase/src/n1ql/ixmgmt.cc +2 -1
  110. data/ext/libcouchbase/src/n1ql/n1ql.cc +66 -0
  111. data/ext/libcouchbase/src/newconfig.cc +9 -2
  112. data/ext/libcouchbase/src/operations/counter.cc +2 -1
  113. data/ext/libcouchbase/src/operations/durability-cas.cc +11 -0
  114. data/ext/libcouchbase/src/operations/durability-seqno.cc +3 -0
  115. data/ext/libcouchbase/src/operations/durability.cc +24 -2
  116. data/ext/libcouchbase/src/operations/durability_internal.h +19 -0
  117. data/ext/libcouchbase/src/operations/get.cc +4 -2
  118. data/ext/libcouchbase/src/operations/observe-seqno.cc +1 -0
  119. data/ext/libcouchbase/src/operations/observe.cc +113 -62
  120. data/ext/libcouchbase/src/operations/ping.cc +246 -67
  121. data/ext/libcouchbase/src/operations/remove.cc +2 -1
  122. data/ext/libcouchbase/src/operations/store.cc +17 -14
  123. data/ext/libcouchbase/src/operations/touch.cc +3 -0
  124. data/ext/libcouchbase/src/packetutils.h +68 -4
  125. data/ext/libcouchbase/src/probes.d +132 -161
  126. data/ext/libcouchbase/src/rdb/bigalloc.c +1 -1
  127. data/ext/libcouchbase/src/retryq.cc +6 -2
  128. data/ext/libcouchbase/src/rnd.cc +68 -0
  129. data/ext/libcouchbase/src/rnd.h +39 -0
  130. data/ext/libcouchbase/src/settings.c +27 -0
  131. data/ext/libcouchbase/src/settings.h +67 -3
  132. data/ext/libcouchbase/src/ssl/CMakeLists.txt +0 -12
  133. data/ext/libcouchbase/src/ssl/ssl_common.c +23 -4
  134. data/ext/libcouchbase/src/strcodecs/base64.c +141 -16
  135. data/ext/libcouchbase/src/strcodecs/strcodecs.h +16 -1
  136. data/ext/libcouchbase/src/trace.h +68 -61
  137. data/ext/libcouchbase/src/tracing/span.cc +289 -0
  138. data/ext/libcouchbase/src/tracing/threshold_logging_tracer.cc +171 -0
  139. data/ext/libcouchbase/src/tracing/tracer.cc +53 -0
  140. data/ext/libcouchbase/src/tracing/tracing-internal.h +213 -0
  141. data/ext/libcouchbase/src/utilities.c +5 -0
  142. data/ext/libcouchbase/src/vbucket/CMakeLists.txt +2 -2
  143. data/ext/libcouchbase/src/vbucket/vbucket.c +50 -18
  144. data/ext/libcouchbase/src/views/docreq.cc +26 -1
  145. data/ext/libcouchbase/src/views/docreq.h +17 -0
  146. data/ext/libcouchbase/src/views/viewreq.cc +64 -1
  147. data/ext/libcouchbase/src/views/viewreq.h +21 -0
  148. data/ext/libcouchbase/tests/CMakeLists.txt +6 -6
  149. data/ext/libcouchbase/tests/basic/t_base64.cc +34 -6
  150. data/ext/libcouchbase/tests/basic/t_connstr.cc +14 -0
  151. data/ext/libcouchbase/tests/basic/t_creds.cc +10 -10
  152. data/ext/libcouchbase/tests/basic/t_host.cc +22 -2
  153. data/ext/libcouchbase/tests/basic/t_scram.cc +514 -0
  154. data/ext/libcouchbase/tests/check-all.cc +6 -2
  155. data/ext/libcouchbase/tests/iotests/mock-environment.cc +64 -0
  156. data/ext/libcouchbase/tests/iotests/mock-environment.h +27 -1
  157. data/ext/libcouchbase/tests/iotests/t_confmon.cc +2 -2
  158. data/ext/libcouchbase/tests/iotests/t_forward.cc +8 -0
  159. data/ext/libcouchbase/tests/iotests/t_netfail.cc +124 -0
  160. data/ext/libcouchbase/tests/iotests/t_smoke.cc +1 -1
  161. data/ext/libcouchbase/tests/iotests/t_snappy.cc +316 -0
  162. data/ext/libcouchbase/tests/socktests/socktest.cc +2 -2
  163. data/ext/libcouchbase/tests/socktests/t_basic.cc +6 -6
  164. data/ext/libcouchbase/tests/socktests/t_manager.cc +1 -1
  165. data/ext/libcouchbase/tests/socktests/t_ssl.cc +1 -1
  166. data/ext/libcouchbase/tools/CMakeLists.txt +1 -1
  167. data/ext/libcouchbase/tools/cbc-handlers.h +17 -0
  168. data/ext/libcouchbase/tools/cbc-n1qlback.cc +7 -4
  169. data/ext/libcouchbase/tools/cbc-pillowfight.cc +408 -100
  170. data/ext/libcouchbase/tools/cbc-proxy.cc +134 -3
  171. data/ext/libcouchbase/tools/cbc-subdoc.cc +1 -2
  172. data/ext/libcouchbase/tools/cbc.cc +113 -8
  173. data/ext/libcouchbase/tools/common/histogram.cc +1 -0
  174. data/ext/libcouchbase/tools/common/options.cc +28 -1
  175. data/ext/libcouchbase/tools/common/options.h +5 -0
  176. data/ext/libcouchbase/tools/docgen/docgen.h +36 -10
  177. data/ext/libcouchbase/tools/docgen/loc.h +5 -4
  178. data/ext/libcouchbase/tools/docgen/seqgen.h +28 -0
  179. data/lib/libcouchbase/ext/libcouchbase/enums.rb +10 -0
  180. data/lib/libcouchbase/n1ql.rb +6 -1
  181. data/lib/libcouchbase/version.rb +1 -1
  182. data/spec/connection_spec.rb +6 -6
  183. metadata +38 -5
  184. data/ext/libcouchbase/cmake/Modules/FindCouchbaseSnappy.cmake +0 -11
  185. data/ext/libcouchbase/src/mc/compress.c +0 -90
  186. data/ext/libcouchbase/tools/common/my_inttypes.h +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57c24a3675fadb2c90585132fad12c9c096d0954
4
- data.tar.gz: 29ddf992c956f4ae85486e7b7bd95665b125eb16
3
+ metadata.gz: 7e84d37abd4f01d3b311fa83fb9e16ce72bd6915
4
+ data.tar.gz: c4ad09758711a1d26e27a41182f06c4100e023d9
5
5
  SHA512:
6
- metadata.gz: 5fd06f34047dced44d9a717e0a66101c2f279f9ff904fb52fe1d30afd98e63fa0f0f00cf6186e84f8a32cbb6b9e9609c8572b506359b74701927faa82816c5d0
7
- data.tar.gz: 85df59fdd0db12c889bf91bd6774a1f929a67f4ad13d913a3f392f7ea524f4f1091f80cee3a28130e5c2f5c9174e94f41b6b1e61dc230879603698044cdc11ef
6
+ metadata.gz: 771464b5f1b88f5f4e123628639a3fd8dfb3adaecd55645f8cdf4b69888b7cf2ab38aace66c45105c2e9af6905a4b90a46455055e158d75e89f66f1c47ff117d
7
+ data.tar.gz: 74f4262314b368ade557710421460d7a13e382e3f828ccf9fb0481aa86aea0153e5d581a064d9241baa0eae85800d2f2137255eca39a900eca2615ed4bb3a10d
data/.travis.yml CHANGED
@@ -6,7 +6,7 @@ rvm:
6
6
  - jruby-9.1.13.0
7
7
  - jruby-head
8
8
  - rubinius
9
- - rubinius-3.86
9
+ - rubinius-3.103
10
10
  branches:
11
11
  only:
12
12
  - master
@@ -14,8 +14,8 @@ before_install:
14
14
  - git submodule update --init --recursive
15
15
  - gem install ffi
16
16
  - sudo apt-get install libev-dev python-httplib2
17
- - sudo wget https://packages.couchbase.com/releases/5.0.0/couchbase-server-enterprise_5.0.0-ubuntu14.04_amd64.deb
18
- - sudo dpkg -i couchbase-server-enterprise_5.0.0-ubuntu14.04_amd64.deb
17
+ - sudo wget https://packages.couchbase.com/releases/5.1.0/couchbase-server-enterprise_5.1.0-ubuntu14.04_amd64.deb
18
+ - sudo dpkg -i couchbase-server-enterprise_5.1.0-ubuntu14.04_amd64.deb
19
19
  - sleep 8
20
20
  - sudo service couchbase-server status
21
21
  - /opt/couchbase/bin/couchbase-cli cluster-init -c 127.0.0.1:8091 --cluster-username=admin --cluster-password=password --cluster-ramsize=320 --cluster-index-ramsize=256 --cluster-fts-ramsize=256 --services=data,index,query,fts
@@ -33,6 +33,6 @@ matrix:
33
33
  - rvm: jruby-head
34
34
  - rvm: ruby-head
35
35
  - rvm: rubinius
36
- - rvm: rubinius-3.86
36
+ - rvm: rubinius-3.103
37
37
  sudo: required
38
38
  dist: trusty
data/README.md CHANGED
@@ -92,16 +92,16 @@ bucket = Libcouchbase::Bucket.new(hosts: '127.0.0.1', bucket: 'default', passwor
92
92
  bucket = Libcouchbase::Bucket.new(hosts: ['cb1.org', 'cb2.org'], bucket: 'app_data', password: 'goodluck')
93
93
  ```
94
94
 
95
- By default connections use `:quiet` mode. This mean it won't raise
95
+ Connections can be configured to use `:quiet` mode. This mean it won't raise
96
96
  exceptions when the given key does not exist:
97
97
 
98
98
  ```ruby
99
+ bucket.quiet = true
99
100
  bucket.get(:missing_key) #=> nil
100
101
  ```
101
102
 
102
- It could be useful when you are trying to make you code a bit efficient
103
- by avoiding exception handling. (See `#add` and `#replace` operations).
104
- You can turn on these exceptions by passing `:quiet => false` when you
103
+ It could be useful avoiding exception handling. (See `#add` and `#replace` operations).
104
+ You can turn off these exceptions by passing `:quiet => true` when you
105
105
  are instantiating the connection or change corresponding attribute:
106
106
 
107
107
  ```ruby
@@ -187,8 +187,17 @@ bucket.touch(:foo, expire_at: (Time.now + 30))
187
187
 
188
188
  ### Set
189
189
 
190
- The add command will fail if the key already exists. It accepts the same
191
- options as set command above.
190
+ The set command will unconditionally store an object in couchbase.
191
+
192
+ ```ruby
193
+ bucket.add("foo", "bar")
194
+ bucket.add("foo", "bar", ttl: 30)
195
+ ```
196
+
197
+
198
+ ### Add
199
+
200
+ The add command will fail if the key already exists.
192
201
 
193
202
  ```ruby
194
203
  bucket.add("foo", "bar")
@@ -198,8 +207,7 @@ bucket.add("foo", "bar", ttl: 30)
198
207
 
199
208
  ### Replace
200
209
 
201
- The replace command will fail if the key already exists. It accepts the same
202
- options as set command above.
210
+ The replace command will fail if the key doesn't already exist.
203
211
 
204
212
  ```ruby
205
213
  bucket.replace("foo", "bar")
@@ -1,3 +1,5 @@
1
+ # -*- mode: cmake; cmake-tab-width: 4; indent-tabs-mode: nil -*-
2
+ #
1
3
  # libcouchbase
2
4
  # Copyright (C) 2013 Couchbase, Inc
3
5
  # All rights reserved.
@@ -21,7 +23,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
21
23
  # These variables can be modified as needed
22
24
 
23
25
  # Couchbase mock path to download
24
- SET(COUCHBASE_MOCK_VERSION CouchbaseMock-1.5.12.jar)
26
+ SET(COUCHBASE_MOCK_VERSION CouchbaseMock-1.5.19.jar)
25
27
  # Maven repository where ${COUCHBASE_MOCK_VERSION} is to be found
26
28
  SET(COUCHBASE_MOCK_DLSERVER http://packages.couchbase.com/clients/c/mock)
27
29
  project(libcouchbase)
@@ -34,10 +36,8 @@ OPTION(LCB_BUILD_LIBEV "Build the libev plugin (if available)" ON)
34
36
  OPTION(LCB_BUILD_LIBUV "Build the libuv plugin (if available)" ON)
35
37
  OPTION(LCB_MAINTAINER_MODE "Enables maintainer mode" OFF)
36
38
  OPTION(LCB_NO_SSL "Do not compile SSL support" OFF)
37
- OPTION(LCB_NO_SNAPPY "Do not compile snappy support" ON)
38
39
  OPTION(LCB_USE_ASAN "Use AddressSanitizer support (Requires Clang)" OFF)
39
40
  OPTION(LCB_USE_COVERAGE "Build with code coverage support" OFF)
40
- OPTION(LCB_STATIC_SNAPPY "Use the bundled libsnappy. Do not link with system snappy" ${WIN32})
41
41
  OPTION(LCB_USE_ARCHLIBDIR "Use architecture-prefixed library installation directory, if possible" OFF)
42
42
  OPTION(LCB_BUILD_EXAMPLES "Build example applications" OFF)
43
43
  OPTION(LCB_NO_MOCK "Don't run tests which depend on the mock" OFF)
@@ -45,6 +45,7 @@ OPTION(LCB_BUILD_DTRACE "Build DTrace instrumentation, if available on platform"
45
45
  OPTION(LCB_EMBED_PLUGIN_LIBEVENT "Embed the libevent plugin" OFF)
46
46
  OPTION(LCB_STATIC_LIBEVENT "Link static libevent (only applicable if EMBED_PLUGIN_LIBEVENT is ON" OFF)
47
47
  OPTION(LCB_USE_HDR_HISTOGRAM "Use HdrHistogram for statistics recording" OFF)
48
+ OPTION(LCB_TRACING "Enable builtin tracing" ON)
48
49
 
49
50
  ### END CONFIGURABLES ###
50
51
  IF(MSVC)
@@ -203,6 +204,7 @@ ENDMACRO()
203
204
  ADD_LIBRARY(netbuf OBJECT ${LCB_NETBUF_SRC})
204
205
  ADD_LIBRARY(netbuf-malloc OBJECT ${LCB_NETBUF_SRC})
205
206
  ADD_LIBRARY(mcreq OBJECT ${LCB_MC_SRC})
207
+ ADD_LIBRARY(mcreq-cxx OBJECT ${LCB_MC_CXXSRC})
206
208
  ADD_LIBRARY(rdb OBJECT ${LCB_RDB_SRC})
207
209
  ADD_LIBRARY(lcbio OBJECT ${LCB_IO_SRC})
208
210
  ADD_LIBRARY(lcbio-cxx OBJECT ${LCB_IO_CXXSRC})
@@ -218,24 +220,41 @@ LCB_UTIL(lcbio)
218
220
  LCB_CXXUTIL(lcbio-cxx)
219
221
  LCB_UTIL(couchbase_utils)
220
222
  LCB_UTIL(mcreq)
223
+ LCB_CXXUTIL(mcreq-cxx)
221
224
  LCB_UTIL(lcbht)
222
225
  LCB_UTIL(lcbcore)
223
226
  LCB_CXXUTIL(lcbcore-cxx)
224
227
 
228
+ IF(LCB_NO_SSL)
229
+ MESSAGE(STATUS "SSL support will be disabled")
230
+ ADD_DEFINITIONS(-DLCB_NO_SSL=1)
231
+ ELSE()
232
+ IF(APPLE)
233
+ IF(NOT OpenSSL_DIR)
234
+ EXECUTE_PROCESS(COMMAND brew --prefix openssl
235
+ OUTPUT_VARIABLE OPENSSL_ROOT_DIR
236
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
237
+ MESSAGE(STATUS "Found OpenSSL Prefix: ${OPENSSL_ROOT_DIR}")
238
+ ENDIF()
239
+ ENDIF()
240
+ FIND_PACKAGE(OpenSSL)
241
+ IF(OPENSSL_FOUND)
242
+ MESSAGE(STATUS "SSL Found")
243
+ ELSE()
244
+ MESSAGE(STATUS "SSL Not Found")
245
+ ENDIF()
246
+ ENDIF()
247
+
225
248
  ADD_SUBDIRECTORY(src/vbucket)
226
249
  ADD_SUBDIRECTORY(contrib/cbsasl)
227
250
  ADD_SUBDIRECTORY(contrib/cliopts)
228
251
  ADD_SUBDIRECTORY(src/ssl)
229
252
  ADD_SUBDIRECTORY(contrib/lcb-jsoncpp)
253
+ ADD_SUBDIRECTORY(contrib/snappy)
230
254
  IF(LCB_BUILD_EXAMPLES)
231
255
  ADD_SUBDIRECTORY(example)
232
256
  ENDIF()
233
257
 
234
- IF(LCB_NO_SSL)
235
- MESSAGE(STATUS "SSL support will be disabled")
236
- ADD_DEFINITIONS(-DLCB_NO_SSL=1)
237
- ENDIF()
238
-
239
258
  IF(LCB_BUILD_STATIC)
240
259
  SET(_lcb_linkspec STATIC)
241
260
  ELSE()
@@ -251,13 +270,16 @@ FILE(GLOB LCB_JSPARSE_SRC src/jsparse/*.cc)
251
270
  ADD_LIBRARY(lcb_jsparse OBJECT ${LCB_JSPARSE_SRC})
252
271
  LCB_CXXUTIL(lcb_jsparse)
253
272
 
273
+ INCLUDE_DIRECTORIES(contrib/snappy)
274
+
254
275
  SET(LCB_CORE_OBJS
255
276
  $<TARGET_OBJECTS:couchbase_select>
256
277
  $<TARGET_OBJECTS:couchbase_utils>
257
- $<TARGET_OBJECTS:vbucket>
278
+ $<TARGET_OBJECTS:vbucket-lcb>
258
279
  $<TARGET_OBJECTS:mcreq>
280
+ $<TARGET_OBJECTS:mcreq-cxx>
259
281
  $<TARGET_OBJECTS:netbuf>
260
- $<TARGET_OBJECTS:cbsasl>
282
+ $<TARGET_OBJECTS:cbsasl-lcb>
261
283
  $<TARGET_OBJECTS:lcbio>
262
284
  $<TARGET_OBJECTS:lcbio-cxx>
263
285
  $<TARGET_OBJECTS:rdb>
@@ -266,6 +288,7 @@ SET(LCB_CORE_OBJS
266
288
  $<TARGET_OBJECTS:lcbcore-cxx>
267
289
  $<TARGET_OBJECTS:lcb_jsparse>
268
290
  $<TARGET_OBJECTS:lcb_jsoncpp>
291
+ $<TARGET_OBJECTS:lcb_snappy>
269
292
  ${LCB_DTRACE_OBJECT}
270
293
  ${lcb_plat_objs}
271
294
  ${lcb_ssl_objs})
@@ -305,30 +328,9 @@ ELSE()
305
328
  DESTINATION ${CMAKE_INSTALL_LIBDIR})
306
329
  ENDIF()
307
330
 
308
-
309
- IF(NOT LCB_NO_SNAPPY)
310
- IF(LCB_STATIC_SNAPPY)
311
- MESSAGE(STATUS "Will use embedded libsnappy")
312
- ADD_SUBDIRECTORY(contrib/snappy)
313
- SET(LCB_SNAPPY_LINK lcbsnappy)
314
- ELSE()
315
- INCLUDE(cmake/Modules/FindCouchbaseSnappy.cmake)
316
- IF(NOT SNAPPY_FOUND)
317
- MESSAGE(FATAL_ERROR "Snappy not found and building with dynamic snappy requested")
318
- ELSE()
319
- SET(LCB_SNAPPY_LINK ${SNAPPY_LIBRARIES})
320
- INCLUDE_DIRECTORIES(${SNAPPY_INCLUDES})
321
- ENDIF()
322
- ENDIF()
323
- ELSE()
324
- MESSAGE(STATUS "Compression support will be disabled")
325
- ADD_DEFINITIONS(-DLCB_NO_SNAPPY=1)
326
- SET(LCB_SNAPPY_LINK "")
327
- ENDIF()
328
-
329
331
  SET_TARGET_PROPERTIES(couchbase PROPERTIES PREFIX "lib")
330
332
  SET_TARGET_PROPERTIES(couchbase PROPERTIES IMPORT_PREFIX "lib")
331
- SET(LCB_LINK_DEPS ${lcb_plat_libs} ${lcb_ssl_libs} ${LCB_SNAPPY_LINK} ${LCB_HDR_HISTOGRAM_LINK})
333
+ SET(LCB_LINK_DEPS ${lcb_plat_libs} ${lcb_ssl_libs} ${LCB_HDR_HISTOGRAM_LINK})
332
334
  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
333
335
  SET(LCB_LINK_DEPS ${LCB_LINK_DEPS} rt)
334
336
  ENDIF()
@@ -1,5 +1,271 @@
1
1
  # Release Notes
2
2
 
3
+ ## 2.8.7 (May 2 2018)
4
+
5
+ * [CCBC-917](https://issues.couchbase.com/browse/CCBC-917): Add tracing for
6
+ observe. So now the library will group all CAS-observe operations, and in
7
+ general will nest observe operations under common parent when
8
+ `lcb_storedur3` API used.
9
+
10
+ * [CCBC-918](https://issues.couchbase.com/browse/CCBC-918): Don't ping KV on
11
+ nodes without DATA service.
12
+
13
+ * [CCBC-685](https://issues.couchbase.com/browse/CCBC-685): Implementation of
14
+ SCRAM-SHA{1,256,512} authentication mechanisms for KV service. Support for
15
+ SCRAM-SHA* SASL auth is disabled by default, because it is not portable, and
16
+ not every Couchbase service supports it. But if it is necessary, it could be
17
+ enabled using `lcb_cntl(..., LCB_CNTL_FORCE_SASL_MECH, ...)` operation, or
18
+ `"force_sasl_mech=SCRAM-SHA512"` option in connection string.
19
+
20
+ * [CCBC-919](https://issues.couchbase.com/browse/CCBC-919): More granular
21
+ settings for compression. Now it is possible to specify minimum size of the
22
+ value to be considered for compression, and also the minimal ratio
23
+ `(compressed / original)`. See `LCB_CNTL_COMPRESSION_MIN_SIZE` (or
24
+ `"compression_min_size=100"` in bytes), and `LCB_CNTL_COMPRESSION_MIN_RATIO`
25
+ (or `"compression=0.9"`).
26
+
27
+ * [CCBC-916](https://issues.couchbase.com/browse/CCBC-916): Do not set JSON
28
+ datatype if server didn't ack it. Fixes behavior where old server rejecting
29
+ commands as invalid when compression is enabled.
30
+
31
+ * [CCBC-923](https://issues.couchbase.com/browse/CCBC-923): Allow to disable
32
+ fast-forward map for NMV handler. See `LCB_CNTL_VB_NOREMAP`
33
+ (`"vb_noremap=true"`). This option is disabled by default.
34
+
35
+ Build improvements:
36
+
37
+ * [CCBC-915](https://issues.couchbase.com/browse/CCBC-915): Fix builds
38
+ where DEBUG macro is defined
39
+
40
+ * [CBD-2405](https://issues.couchbase.com/browse/CBD-2405): Change
41
+ target names in conflict with Server targets
42
+
43
+ ## 2.8.6 (April 5 2018)
44
+
45
+ * [CCBC-888](https://issues.couchbase.com/browse/CCBC-888): Add threshold
46
+ logging tracer, which tracks and reports above threshold and orphaned operations.
47
+ This is beta functionality, which is disabled by default. To enable it, use
48
+ `enable_tracing=on` in the connection string.
49
+
50
+ * [CCBC-910](https://issues.couchbase.com/browse/CCBC-910): Field encryption
51
+ API. The `lcbcrypto_*` functions abstracts encrypted field layout from actual
52
+ crypto implementations (OpenSSL, libsodium, etc.). The wrapper or application
53
+ using libcouchbase is expected to connect their own crypto and key providers, while
54
+ libcouchbase provides transformation of the encrypted data. See
55
+ sample crypto provider in [example/crypto](example/crypto).
56
+
57
+ * [CCBC-904](https://issues.couchbase.com/browse/CCBC-904): Remove trailing
58
+ comma in `lcb_KVBUFTYPE` enum. Fixes build on some older
59
+ compilers.
60
+
61
+ * [CCBC-907](https://issues.couchbase.com/browse/CCBC-907): cbc-n1qlback: Do
62
+ not require trailing empty line for input.
63
+
64
+ * [CCBC-908](https://issues.couchbase.com/browse/CCBC-908): cbc-n1qlback:
65
+ Report number of loaded queries.
66
+
67
+ * Add ability to write OPS/SEC from cbc-pillowfight to a file
68
+
69
+ cbc-pillowfight 2> /tmp/stats.txt
70
+
71
+ or, when writing to terminal required
72
+
73
+ cbc-pillowfight 2>&1 | tee /tmp/stats.txt
74
+
75
+ * Build improvements for easier integration into with server manifest (and TLM project).
76
+
77
+ ## 2.8.5 (February 23 2018)
78
+
79
+ * [CCBC-883](https://issues.couchbase.com/browse/CCBC-883): Always use built-in compression.
80
+ It is not possible to unbundle the Snappy library, as libcouchbase uses the C++ API which is not
81
+ exported in the headers. Also, compression can now work on all types of buffers, including
82
+ `LCB_KV_IOV` and `LCB_KV_IOVCOPY`. This fixes compression in `cbc-pillowfight` tool.
83
+
84
+ * [CCBC-895](https://issues.couchbase.com/browse/CCBC-895): Fix typo in rendering IPv6 addresses
85
+ in `lcb_diag`.
86
+
87
+ * [CCBC-879](https://issues.couchbase.com/browse/CCBC-879): Implement log redaction. When
88
+ `log_redaction=on` is specified in the connection string, the library will wrap sensitive
89
+ data in the logs in special tags, which can be processed by the
90
+ `cblogredaction` tool from the server distribution.
91
+
92
+ * [CCBC-893](https://issues.couchbase.com/browse/CCBC-894): Updated list of subdoc error codes.
93
+
94
+ * [CCBC-892](https://issues.couchbase.com/browse/CCBC-892): Enable the SSL trust store to be in
95
+ a separate file. Trust store has to be specified with option `truststorepath=…`, otherwise
96
+ the library will expect it to be stored with the certificate in `certpath=`.
97
+
98
+ * [CCBC-888](https://issues.couchbase.com/browse/CCBC-888): Per operation tracing. When
99
+ compiled with tracing support (`cmake -DLCB_TRACING=ON`), the library will expose the tracing
100
+ API, which allows to measure time of every data operation, and include some extra information.
101
+ The API is modeled after OpenTracing and allows one to write custom tracers to consume this
102
+ information. For more information, see an example in
103
+ [example/tracing/tracing.c](example/tracing/tracing.c). This is uncommitted API at this time.
104
+
105
+ Also this feature includes support for new type of the server responses, which include
106
+ time spent to execute the KV command on the server. This feature controlled by `enable_tracing`
107
+ option in connection string or `lcb_cntl(..., LCB_CNTL_ENABLE_TRACING, ...)`.
108
+
109
+ * Added basic support of JSON datatype. The library will negotiate a mode, in which the
110
+ application will see `LCB_VALUE_F_JSON` flag on datatype field of the response in the
111
+ operation callback, if the cluster detected the content of the document to be valid JSON.
112
+ Also the application can send this flag on the outgoing documents to notify the server
113
+ about payload format.
114
+
115
+ * Refresh dtrace/systemtap integration. Also adds tapset for SystemTap to simplify access to
116
+ trace points.
117
+
118
+ * cbc-pillowfight improvements and changes:
119
+ * dump diagnostics on `SIGQUIT` (CTRL-\ in terminal).
120
+ * with `-J`/`--json`, the JSON datatype will be sent on the documents.
121
+ * enable randomized document bodies with `-R`/`--random-body` switch.
122
+ * durability checks for pillowfight with `--persist-to`/`--replicate-to`.
123
+ * pessimistic locking of keys before updating with `--lock`.
124
+ * when requesting timings with `-T`/`--timings`, the application will no longer dump them
125
+ periodically.Instead it will await for the user to signal `SIGQUIT` and also dump
126
+ them on exit. The old mode of reporting regularly is enabled by repeating the switch more than
127
+ once (e.g. `-TT`).
128
+
129
+ * Added the cbc-watch command to monitor server stats. By default it tracks `cmd_total_ops`,
130
+ `cmd_total_gets` and `cmd_total_sets` updating stats once a second, and displaying
131
+ diff with the previous value.
132
+
133
+
134
+ ## 2.8.4 (December 20 2017)
135
+
136
+ * [CCBC-880](https://issues.couchbase.com/browse/CCBC-880): Implement x.509 client
137
+ certificate authentication. Connection string must use TLS-enabled scheme
138
+ (`couchbases://` or `https://`) and set options `certpath` and `keypath`. For example,
139
+
140
+ couchbases://127.0.0.1?certpath=/path/to/chain.pem&keypath=/path/to/client.key
141
+
142
+ Read more at server docs: https://developer.couchbase.com/documentation/server/5.0/security/security-x509certsintro.html
143
+
144
+ * [CCBC-883](https://issues.couchbase.com/browse/CCBC-883): Revisit builtin compression
145
+ implementation (snappy). Add compression to cbc tools (see `--compress`, `-y` options).
146
+ Future versions of Couchbase Server will have end-to-end compression.
147
+
148
+ * [CCBC-885](https://issues.couchbase.com/browse/CCBC-885): Do not skip HTTP Basic
149
+ authentication when password is empty.
150
+
151
+ * [CCBC-876](https://issues.couchbase.com/browse/CCBC-876): Make sure that server
152
+ authority is always specified. In some cases, when libcouchbase generates vbucket
153
+ configuration or data service is not available, the authority of the server might be
154
+ NULL. This could cause issues, as we compare servers from configs using their authority
155
+ fields.
156
+
157
+ * [CCBC-878](https://issues.couchbase.com/browse/CCBC-878): Support collections in
158
+ cbc-pillowfight.
159
+
160
+ Note that this change does not expose anything related to Collections API for
161
+ libcouchbase. It defines hidden switches for pillowfight tool to allow benchmark of
162
+ collections. The switches are not documented and might be removed in the future. Use
163
+ with care.
164
+
165
+ Generate only `beer:<seqno>` keys:
166
+
167
+ cbc pillowfight --separator : --collection beer
168
+
169
+ Using many --collection will alternate in generating `beer:<seqno>`, `brewery:<seqno>`
170
+ keys (default separator is ":"):
171
+
172
+ cbc pillowfight --collection beer --collection brewery
173
+
174
+ * [CCBC-801](https://issues.couchbase.com/browse/CCBC-801): Expose information about
175
+ network IO for monitoring. The diagnostics exposed as string with encoded JSON object.
176
+
177
+ void diag_callback(lcb_t instance, int cbtype, const lcb_RESPBASE *rb)
178
+ {
179
+ const lcb_RESPDIAG *resp = (const lcb_RESPDIAG *)rb;
180
+ if (resp->rc != LCB_SUCCESS) {
181
+ fprintf(stderr, "failed: %s ", lcb_strerror(NULL, resp->rc));
182
+ } else {
183
+ if (resp->njson) {
184
+ fprintf(stderr, "%.*s", (int)resp->njson, resp->json);
185
+ }
186
+ }
187
+ }
188
+
189
+ lcb_install_callback3(instance, LCB_CALLBACK_DIAG, diag_callback);
190
+ lcb_CMDDIAG cmd = { 0 };
191
+ lcb_diag(instance, NULL, &cmd);
192
+ lcb_wait(instance);
193
+
194
+ * [CCBC-874](https://issues.couchbase.com/browse/CCBC-874): Dynamic authenticator. Note
195
+ that this feature should not be considered at public interface. To use it, application
196
+ have to define two callbacks, which will return username and password dependending on
197
+ bucket name and hostname/port of the endpoint.
198
+
199
+ std::map< std::string, std::string > credentials = {
200
+ {"protected", "secret"}
201
+ };
202
+ extern "C" {
203
+ static const char *get_username(void *cookie,
204
+ const char *host,
205
+ const char *port,
206
+ const char *bucket)
207
+ {
208
+ return bucket;
209
+ }
210
+
211
+ static const char *get_password(void *cookie,
212
+ const char *host,
213
+ const char *port,
214
+ const char *bucket)
215
+ {
216
+ std::map< std::string, std::string > *credentials =
217
+ static_cast<std::map< std::string, std::string > *>(cookie);
218
+ return (*credentials)[bucket].c_str();
219
+ }
220
+ }
221
+
222
+
223
+ and later pass these callbacks to authenticator like this:
224
+
225
+
226
+ lcb_AUTHENTICATOR *auth = lcbauth_new();
227
+ lcbauth_set_callbacks(auth, &credentials, get_username, get_password);
228
+ lcbauth_set_mode(auth, LCBAUTH_MODE_DYNAMIC);
229
+ lcb_set_auth(instance, auth);
230
+
231
+ * Include platform/compiler into client id, which included into HELLO and HTTP requests.
232
+
233
+ * Fix parallel build on Linux when dtrace enabled
234
+
235
+ * cbc-proxy: proxy N1QL, FTS and Analytics queries using STAT command.
236
+
237
+ ## 2.8.3 (November 21 2017)
238
+
239
+ * [CCBC-415](https://issues.couchbase.com/browse/CCBC-415): Fixes in IPv6 support.
240
+ To use IPv6 addresses, the application should connect to IPv6-enabled Couchbase Server,
241
+ and explicitly switch on option via connection string `ipv6=allow` or `ipv6=only`,
242
+ where first variant permits the library to use both IPv6 and IPv4, and the second --
243
+ disables IPv4. Alternatively this setting controlled with `LCB_CNTL_IP6POLICY` and
244
+ `lcb_cntl`.
245
+
246
+ * [CCBC-872](https://issues.couchbase.com/browse/CCBC-872): Metrics management
247
+ These metrics are intended at providing information on libcouchbase operations performed
248
+ over the lifetime of the current `lcb_t` instance (processed request packets, processed
249
+ response packets, request packets pending emission, server errors, server timeouts,
250
+ misrouted operations, retried operations).
251
+
252
+ Metrics collection is currently disabled by default. To enable metrics collection,
253
+ the user should call:
254
+
255
+ int activate = 1;
256
+ lcb_cntl(instance, LCB_CNTL_SET, LCB_CNTL_METRICS, &activate);
257
+
258
+ Access to the collected metrics is done using:
259
+
260
+ lcb_METRICS* my_metrics;
261
+ lcb_cntl(instance, LCB_CNTL_GET, LCB_CNTL_METRICS, &my_metrics);
262
+
263
+ * [CCBC-870](https://issues.couchbase.com/browse/CCBC-870): Fix updating URL on retry. When retrying HTTP request, instead of replacing just `host:port` part of the old URL, the library inserted full URL.
264
+
265
+ * [CCBC-547](https://issues.couchbase.com/browse/CCBC-547): Detect dead sockets under libuv.
266
+
267
+ * Ensure macros safe by surrounding values with parentheses
268
+
3
269
  ## 2.8.2 (October 17 2017)
4
270
 
5
271
  * [CCBC-833](https://issues.couchbase.com/browse/CCBC-833), [CCBC-834](https://issues.couchbase.com/browse/CCBC-834):
@@ -1723,7 +1989,7 @@ These changes extend existing features with enhanced APIs
1723
1989
 
1724
1990
  * [major] Add interface attributes to all API calls
1725
1991
  This properly documents all API calls with a certain API stability level
1726
- such as _committed_ (for stable APIs), _uncomitted_ for APIs which may, but
1992
+ such as _committed_ (for stable APIs), _uncommitted_ for APIs which may, but
1727
1993
  are not likely to change, and _volatile_ for APIs which are likely to be
1728
1994
  changed or removed.
1729
1995
 
@@ -1917,7 +2183,8 @@ These changes extend existing features with enhanced APIs
1917
2183
 
1918
2184
  lcb_error_t rc = lcb_create(&instance, &options);
1919
2185
  if (rc != LCB_SUCCESS) {
1920
- fprintf(stderr, "Failed to create instance: %s\n", lcb_strerror(instance, rc));
2186
+ fprintf(stderr, "Failed to create instance: %s
2187
+ ", lcb_strerror(instance, rc));
1921
2188
  }
1922
2189
 
1923
2190
  The above snippet will configure a client to _always_ use the `CCCP` protocol
@@ -1977,7 +2244,8 @@ These changes extend existing features with enhanced APIs
1977
2244
  node.v.v1.index = 0; /* first node */
1978
2245
  lcb_cntl(instance, LCB_CNTL_GET, LCB_CNTL_MEMDNODE_INFO, &node);
1979
2246
  if (node.v.v1.sasl_mech) {
1980
- printf("authenticated via SASL '%s'\n",
2247
+ printf("authenticated via SASL '%s'
2248
+ ",
1981
2249
  node.v.v1.sasl_mech);
1982
2250
  }
1983
2251
 
@@ -2013,9 +2281,11 @@ These changes extend existing features with enhanced APIs
2013
2281
  int is_loaded;
2014
2282
  lcb_cntl(instance, LCB_CNTL_GET, LCB_CNTL_CONFIG_CACHE_LOADED, &is_loaded);
2015
2283
  if (is_loaded) {
2016
- printf("Configuration cache saved us a trip to the config server\n");
2284
+ printf("Configuration cache saved us a trip to the config server
2285
+ ");
2017
2286
  } else {
2018
- printf("We had to contact the configuration server for some reason\n");
2287
+ printf("We had to contact the configuration server for some reason
2288
+ ");
2019
2289
  }
2020
2290
 
2021
2291
  * [major] CCBC-278 Use common config retry mechanism for bad
@@ -2043,7 +2313,8 @@ These changes extend existing features with enhanced APIs
2043
2313
  lcb_error_t user_map_error(lcb_t instance, lcb_uint16_t in)
2044
2314
  {
2045
2315
  if (in == PROTOCOL_BINARY_RESPONSE_ETMPFAIL) {
2046
- fprintf(stderr, "temporary failure on server\n");
2316
+ fprintf(stderr, "temporary failure on server
2317
+ ");
2047
2318
  }
2048
2319
  return default_callback(instance, in);
2049
2320
  }