libcouchbase 1.3.0 → 1.3.2

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 (155) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +2 -2
  3. data/ext/libcouchbase/CMakeLists.txt +51 -25
  4. data/ext/libcouchbase/CONTRIBUTING.md +46 -65
  5. data/ext/libcouchbase/RELEASE_NOTES.markdown +163 -0
  6. data/ext/libcouchbase/cmake/Modules/DownloadLcbDep.cmake +9 -11
  7. data/ext/libcouchbase/cmake/Modules/FindProfiler.cmake +16 -0
  8. data/ext/libcouchbase/cmake/Modules/GetVersionInfo.cmake +6 -6
  9. data/ext/libcouchbase/cmake/config-cmake.h.in +2 -0
  10. data/ext/libcouchbase/cmake/configure +16 -0
  11. data/ext/libcouchbase/example/CMakeLists.txt +17 -2
  12. data/ext/libcouchbase/example/analytics/.gitignore +1 -0
  13. data/ext/libcouchbase/example/analytics/analytics.c +158 -0
  14. data/ext/libcouchbase/example/analytics/build-queries.rb +34 -0
  15. data/ext/libcouchbase/example/analytics/cJSON.c +1 -0
  16. data/ext/libcouchbase/example/analytics/cJSON.h +1 -0
  17. data/ext/libcouchbase/example/analytics/queries.h +113 -0
  18. data/ext/libcouchbase/example/analytics/queries/00-show-dataverse.json +5 -0
  19. data/ext/libcouchbase/example/analytics/queries/01-setup-dataset-breweries.json +6 -0
  20. data/ext/libcouchbase/example/analytics/queries/02-setup-dataset-beers.json +6 -0
  21. data/ext/libcouchbase/example/analytics/queries/03-initiate-shadow.json +6 -0
  22. data/ext/libcouchbase/example/analytics/queries/04-list-datasets.json +7 -0
  23. data/ext/libcouchbase/example/analytics/queries/05-count-breweries.json +5 -0
  24. data/ext/libcouchbase/example/analytics/queries/06-first-brewery.json +6 -0
  25. data/ext/libcouchbase/example/analytics/queries/07-key-based-lookup.json +6 -0
  26. data/ext/libcouchbase/example/analytics/queries/08-exact-match-lookup.json +7 -0
  27. data/ext/libcouchbase/example/analytics/queries/09-exact-match-lookup-different-shape.json +6 -0
  28. data/ext/libcouchbase/example/analytics/queries/10-other-query-filters.json +6 -0
  29. data/ext/libcouchbase/example/analytics/queries/11-equijoin.json +9 -0
  30. data/ext/libcouchbase/example/analytics/queries/12-equijoin-select-star.json +10 -0
  31. data/ext/libcouchbase/example/analytics/queries/13-ansi-join.json +8 -0
  32. data/ext/libcouchbase/example/analytics/queries/14-join-select-values.json +8 -0
  33. data/ext/libcouchbase/example/analytics/queries/15-nested-outer-join.json +7 -0
  34. data/ext/libcouchbase/example/analytics/queries/16-theta-join.json +8 -0
  35. data/ext/libcouchbase/example/analytics/queries/17-existential-quantification.json +9 -0
  36. data/ext/libcouchbase/example/analytics/queries/18-universal-quantification.json +7 -0
  37. data/ext/libcouchbase/example/analytics/queries/19-simple-aggregation.json +6 -0
  38. data/ext/libcouchbase/example/analytics/queries/20-simple-aggregation-unwrapped-value.json +6 -0
  39. data/ext/libcouchbase/example/analytics/queries/21-simple-aggregation-explicit.json +6 -0
  40. data/ext/libcouchbase/example/analytics/queries/22-grouping-and-aggregation.json +6 -0
  41. data/ext/libcouchbase/example/analytics/queries/23-grouping-and-aggregation-with-hint.json +7 -0
  42. data/ext/libcouchbase/example/analytics/queries/24-grouping-and-limits.json +7 -0
  43. data/ext/libcouchbase/example/analytics/queries/25-named-parameters.json +7 -0
  44. data/ext/libcouchbase/example/analytics/queries/26-positional-parameters.json +7 -0
  45. data/ext/libcouchbase/example/crypto/common_provider.c +2 -0
  46. data/ext/libcouchbase/example/crypto/common_provider.h +2 -0
  47. data/ext/libcouchbase/example/crypto/openssl_symmetric_decrypt.c +5 -0
  48. data/ext/libcouchbase/example/crypto/openssl_symmetric_encrypt.c +0 -1
  49. data/ext/libcouchbase/example/crypto/openssl_symmetric_provider.c +16 -26
  50. data/ext/libcouchbase/example/db/db.c +10 -6
  51. data/ext/libcouchbase/example/fts/.gitignore +1 -0
  52. data/ext/libcouchbase/example/fts/build-queries.rb +33 -0
  53. data/ext/libcouchbase/example/fts/fts.c +142 -0
  54. data/ext/libcouchbase/example/fts/queries.h +61 -0
  55. data/ext/libcouchbase/example/fts/queries/00-simple-text-query.json +12 -0
  56. data/ext/libcouchbase/example/fts/queries/01-simple-text-query-on-non-default-index.json +9 -0
  57. data/ext/libcouchbase/example/fts/queries/02-simple-text-query-on-stored-field.json +13 -0
  58. data/ext/libcouchbase/example/fts/queries/03-match-query-with-facet.json +19 -0
  59. data/ext/libcouchbase/example/fts/queries/04-docid-query.json +11 -0
  60. data/ext/libcouchbase/example/fts/queries/05-unanalyzed-term-query-with-fuzziness-level-of-0.json +13 -0
  61. data/ext/libcouchbase/example/fts/queries/06-unanalyzed-term-query-with-fuzziness-level-of-2.json +14 -0
  62. data/ext/libcouchbase/example/fts/queries/07-match-phrase-query.json +13 -0
  63. data/ext/libcouchbase/example/fts/queries/08-phrase-query.json +16 -0
  64. data/ext/libcouchbase/example/fts/queries/09-query-string-query.json +9 -0
  65. data/ext/libcouchbase/example/fts/queries/10-conjunction-query.json +21 -0
  66. data/ext/libcouchbase/example/fts/queries/11-wild-card-query.json +13 -0
  67. data/ext/libcouchbase/example/fts/queries/12-numeric-range-query.json +11 -0
  68. data/ext/libcouchbase/example/fts/queries/13-regexp-query.json +13 -0
  69. data/ext/libcouchbase/example/minimal/.gitignore +1 -0
  70. data/ext/libcouchbase/example/minimal/query.c +185 -0
  71. data/ext/libcouchbase/example/subdoc/subdoc-xattrs.c +2 -2
  72. data/ext/libcouchbase/example/tracing/cJSON.c +1 -1
  73. data/ext/libcouchbase/example/tracing/cJSON.h +1 -1
  74. data/ext/libcouchbase/include/libcouchbase/cbft.h +38 -4
  75. data/ext/libcouchbase/include/libcouchbase/cntl-private.h +8 -97
  76. data/ext/libcouchbase/include/libcouchbase/cntl.h +288 -8
  77. data/ext/libcouchbase/include/libcouchbase/couchbase.h +47 -10
  78. data/ext/libcouchbase/include/libcouchbase/crypto.h +214 -48
  79. data/ext/libcouchbase/include/libcouchbase/deprecated.h +12 -0
  80. data/ext/libcouchbase/include/libcouchbase/error.h +33 -2
  81. data/ext/libcouchbase/include/libcouchbase/ixmgmt.h +1 -1
  82. data/ext/libcouchbase/include/libcouchbase/n1ql.h +87 -13
  83. data/ext/libcouchbase/include/libcouchbase/subdoc.h +3 -7
  84. data/ext/libcouchbase/include/libcouchbase/tracing.h +174 -56
  85. data/ext/libcouchbase/include/libcouchbase/vbucket.h +21 -1
  86. data/ext/libcouchbase/include/libcouchbase/views.h +49 -4
  87. data/ext/libcouchbase/packaging/deb/control +2 -3
  88. data/ext/libcouchbase/packaging/parse-git-describe.pl +1 -1
  89. data/ext/libcouchbase/plugins/io/libev/CMakeLists.txt +7 -5
  90. data/ext/libcouchbase/plugins/io/libevent/CMakeLists.txt +7 -5
  91. data/ext/libcouchbase/plugins/io/libuv/CMakeLists.txt +14 -12
  92. data/ext/libcouchbase/plugins/io/libuv/libuv_compat.h +3 -0
  93. data/ext/libcouchbase/plugins/io/libuv/plugin-libuv.c +14 -6
  94. data/ext/libcouchbase/plugins/io/select/CMakeLists.txt +7 -5
  95. data/ext/libcouchbase/src/bootstrap.cc +6 -1
  96. data/ext/libcouchbase/src/bucketconfig/bc_cccp.cc +2 -7
  97. data/ext/libcouchbase/src/bucketconfig/bc_file.cc +1 -1
  98. data/ext/libcouchbase/src/bucketconfig/bc_http.cc +4 -11
  99. data/ext/libcouchbase/src/bucketconfig/clconfig.h +29 -36
  100. data/ext/libcouchbase/src/bucketconfig/confmon.cc +4 -2
  101. data/ext/libcouchbase/src/cntl.cc +181 -151
  102. data/ext/libcouchbase/src/config_static.h +1 -1
  103. data/ext/libcouchbase/src/connspec.cc +5 -1
  104. data/ext/libcouchbase/src/connspec.h +3 -1
  105. data/ext/libcouchbase/src/crypto.cc +93 -80
  106. data/ext/libcouchbase/src/dns-srv.cc +1 -1
  107. data/ext/libcouchbase/src/handler.cc +0 -1
  108. data/ext/libcouchbase/src/http/http-priv.h +1 -0
  109. data/ext/libcouchbase/src/http/http.cc +1 -2
  110. data/ext/libcouchbase/src/instance.cc +21 -2
  111. data/ext/libcouchbase/src/internal.h +1 -0
  112. data/ext/libcouchbase/src/lcbio/ctx.c +24 -3
  113. data/ext/libcouchbase/src/lcbio/ioutils.cc +1 -1
  114. data/ext/libcouchbase/src/lcbio/rw-inl.h +22 -1
  115. data/ext/libcouchbase/src/lcbio/ssl.h +2 -0
  116. data/ext/libcouchbase/src/mc/compress.cc +18 -11
  117. data/ext/libcouchbase/src/mc/mcreq.c +2 -0
  118. data/ext/libcouchbase/src/mc/mcreq.h +1 -1
  119. data/ext/libcouchbase/src/mcserver/mcserver.cc +163 -6
  120. data/ext/libcouchbase/src/mcserver/negotiate.cc +17 -7
  121. data/ext/libcouchbase/src/n1ql/n1ql.cc +12 -3
  122. data/ext/libcouchbase/src/newconfig.cc +4 -3
  123. data/ext/libcouchbase/src/nodeinfo.cc +1 -7
  124. data/ext/libcouchbase/src/operations/observe.cc +1 -0
  125. data/ext/libcouchbase/src/operations/ping.cc +5 -3
  126. data/ext/libcouchbase/src/retryq.cc +22 -0
  127. data/ext/libcouchbase/src/retryq.h +2 -1
  128. data/ext/libcouchbase/src/rnd.cc +5 -12
  129. data/ext/libcouchbase/src/settings.c +4 -7
  130. data/ext/libcouchbase/src/settings.h +6 -2
  131. data/ext/libcouchbase/src/strcodecs/base64.c +59 -0
  132. data/ext/libcouchbase/src/strcodecs/strcodecs.h +2 -0
  133. data/ext/libcouchbase/src/trace.h +2 -2
  134. data/ext/libcouchbase/src/tracing/span.cc +177 -45
  135. data/ext/libcouchbase/src/tracing/threshold_logging_tracer.cc +70 -28
  136. data/ext/libcouchbase/src/tracing/tracing-internal.h +33 -48
  137. data/ext/libcouchbase/src/vbucket/vbucket.c +146 -30
  138. data/ext/libcouchbase/src/wait.cc +1 -1
  139. data/ext/libcouchbase/tests/CMakeLists.txt +13 -4
  140. data/ext/libcouchbase/tests/iotests/mock-environment.cc +1 -1
  141. data/ext/libcouchbase/tests/iotests/t_misc.cc +2 -2
  142. data/ext/libcouchbase/tests/iotests/t_views.cc +1 -1
  143. data/ext/libcouchbase/tests/iotests/testutil.cc +3 -2
  144. data/ext/libcouchbase/tests/vbucket/confdata/map_node_present_nodesext_missing_nodes.json +94 -0
  145. data/ext/libcouchbase/tests/vbucket/t_config.cc +15 -0
  146. data/ext/libcouchbase/tools/CMakeLists.txt +11 -6
  147. data/ext/libcouchbase/tools/cbc-handlers.h +9 -0
  148. data/ext/libcouchbase/tools/cbc-proxy.cc +1 -1
  149. data/ext/libcouchbase/tools/cbc.cc +33 -5
  150. data/ext/libcouchbase/tools/common/options.cc +1 -1
  151. data/ext/libcouchbase/tools/extract-packets.rb +110 -0
  152. data/lib/libcouchbase/connection.rb +13 -5
  153. data/lib/libcouchbase/ext/tasks.rb +1 -1
  154. data/lib/libcouchbase/version.rb +1 -1
  155. metadata +62 -7
@@ -88,12 +88,12 @@ static void n1qlrow_callback(lcb_t instance, int type, const lcb_RESPN1QL *resp)
88
88
  char *start = "{\"docID\":\"";
89
89
  char *stop = "\"";
90
90
 
91
- char *key = strnstr(resp->row, start, resp->nrow);
91
+ char *key = strstr(resp->row, start);
92
92
  if (key == NULL || key != resp->row) {
93
93
  return;
94
94
  }
95
95
  key += strlen(start);
96
- char *z = strnstr(key, stop, resp->nrow - (resp->row - key));
96
+ char *z = strstr(key, stop);
97
97
  if (z == NULL) {
98
98
  return;
99
99
  }
@@ -1 +1 @@
1
- ext/libcouchbase/example/tracing/../../contrib/cJSON/cJSON.c
1
+ ../../contrib/cJSON/cJSON.c
@@ -1 +1 @@
1
- ext/libcouchbase/example/tracing/../../contrib/cJSON/cJSON.h
1
+ ../../contrib/cJSON/cJSON.h
@@ -24,7 +24,7 @@ extern "C" {
24
24
 
25
25
  /**
26
26
  * @ingroup lcb-public-api
27
- * @defgroup lcb-cbft-api Full Text Search (Experimental)
27
+ * @defgroup lcb-cbft-api Full Text Search
28
28
  * @brief Search for strings in documents and more
29
29
  */
30
30
 
@@ -55,6 +55,9 @@ typedef struct {
55
55
  } lcb_RESPFTS;
56
56
 
57
57
  typedef void (*lcb_FTSCALLBACK)(lcb_t, int, const lcb_RESPFTS *);
58
+ /**
59
+ * Pointer for request instance
60
+ */
58
61
  typedef struct lcb_FTSREQ* lcb_FTSHANDLE;
59
62
 
60
63
  /**
@@ -100,17 +103,48 @@ LIBCOUCHBASE_API
100
103
  void
101
104
  lcb_fts_cancel(lcb_t, lcb_FTSHANDLE);
102
105
 
106
+ /**
107
+ * @}
108
+ */
109
+
110
+ /**
111
+ * @ingroup lcb-public-api
112
+ * @addtogroup lcb-tracing-api
113
+ * @{
114
+ */
103
115
  #ifdef LCB_TRACING
116
+
104
117
  /**
105
- * @uncommitted
118
+ * Associate parent tracing span with the FTS request.
119
+ *
120
+ * @param instance the instance
121
+ * @param handle FTS request handle
122
+ * @param span parent span
123
+ *
124
+ * @par Attach parent tracing span to request object.
125
+ * @code{.c}
126
+ * lcb_CMDFTS cmd = {};
127
+ * // initialize FTS command...
128
+ *
129
+ * lcb_FTSHANDLE handle = NULL;
130
+ * cmd->handle = &handle;
131
+ *
132
+ * lcb_error_t err = lcb_fts_query(instance, cookie, cmd);
133
+ * if (err == LCB_SUCCESS) {
134
+ * lcb_fts_set_parent_span(instance, handle, span);
135
+ * }
136
+ * @endcode
137
+ *
138
+ * @committed
106
139
  */
107
140
  LIBCOUCHBASE_API
108
141
  void lcb_fts_set_parent_span(lcb_t instance, lcb_FTSHANDLE handle, lcbtrace_SPAN *span);
109
- #endif
110
142
 
143
+ #endif
111
144
  /**
112
- * @}
145
+ * @} (Group: Tracing)
113
146
  */
147
+
114
148
  #ifdef __cplusplus
115
149
  }
116
150
  #endif
@@ -215,68 +215,6 @@ struct lcb_cntl_iops_info_st {
215
215
  */
216
216
  #define LCB_CNTL_REINIT_CONNSTR 0x2B
217
217
 
218
- /**
219
- * Options for how to handle compression
220
- */
221
- typedef enum {
222
- /** Do not perform compression in any direction. Data which is received
223
- * compressed via the server will be indicated as such by having the
224
- * `LCB_VALUE_F_SNAPPYCOMP` flag set in the lcb_GETRESPv0::datatype field */
225
- LCB_COMPRESS_NONE = 0x00,
226
-
227
- /**
228
- * Decompress incoming data, if the data has been compressed at the server.
229
- * If this is set, the `datatype` field in responses will always be stripped
230
- * of the `LCB_VALUE_F_SNAPPYCOMP` flag.
231
- */
232
- LCB_COMPRESS_IN = 1 << 0,
233
-
234
- /**
235
- * Compress outgoing data. Note that if the `datatype` field contains the
236
- * `LCB_VALUE_F_SNAPPYCOMP` flag, then the data will never be compressed
237
- * as it is assumed that it is already compressed.
238
- */
239
- LCB_COMPRESS_OUT = 1 << 1,
240
-
241
-
242
- LCB_COMPRESS_INOUT = (LCB_COMPRESS_IN|LCB_COMPRESS_OUT),
243
-
244
- /**
245
- * By default the library will send a HELLO command to the server to
246
- * determine whether compression is supported or not. Because commands may
247
- * be pipelined prior to the scheduing of the HELLO command it is possible
248
- * that the first few commands may not be compressed when schedule due to
249
- * the library not yet having negotiated settings with the server. Setting
250
- * this flag will force the client to assume that all servers support
251
- * compression despite a HELLO not having been intially negotiated.
252
- */
253
- LCB_COMPRESS_FORCE = 1 << 2
254
- } lcb_COMPRESSOPTS;
255
-
256
- /**
257
- * @committed
258
- *
259
- * @brief Control how the library handles compression and deflation to and from
260
- * the server.
261
- *
262
- * Starting in Couchbase Server 3.0, compression can optionally be applied to
263
- * incoming and outcoming data. For incoming (i.e. `GET` requests) the data
264
- * may be received in compressed format and then allow the client to inflate
265
- * the data upon receipt. For outgoing (i.e. `SET` requests) the data may be
266
- * compressed on the client side and then be stored and recognized on the
267
- * server itself.
268
- *
269
- * The default behavior is to transparently handle compression for both incoming
270
- * and outgoing data.
271
- *
272
- * Note that if the lcb_STORECMDv0::datatype field is set with compression
273
- * flags, the data will _never_ be compressed by the library as this is an
274
- * indication that it is _already_ compressed.
275
- *
276
- * @cntl_arg_both{`int*` (value is one of @ref lcb_COMPRESSOPTS)}
277
- */
278
- #define LCB_CNTL_COMPRESSION_OPTS 0x26
279
-
280
218
 
281
219
  struct rdb_ALLOCATOR;
282
220
  typedef struct rdb_ALLOCATOR* (*lcb_RDBALLOCFACTORY)(void);
@@ -301,21 +239,6 @@ struct lcb_cntl_rdballocfactory {
301
239
  #define LCB_CNTL_RDBALLOCFACTORY 0x27
302
240
 
303
241
 
304
- typedef enum {
305
- LCB_IPV6_DISABLED = 0x00, LCB_IPV6_ONLY = 0x1, LCB_IPV6_ALLOW = 0x02
306
- } lcb_ipv6_t;
307
-
308
- /**
309
- * @brief IPv4/IPv6 selection policy
310
- *
311
- * Setting which controls whether hostname lookups should prefer IPv4 or IPv6
312
- *
313
- * @cntl_arg_both{lcb_ipv6_t*}
314
- * @uncommitted
315
- */
316
- #define LCB_CNTL_IP6POLICY 0x0b
317
-
318
-
319
242
  /**
320
243
  * @brief Persist heuristic vbucket information across updates.
321
244
  *
@@ -372,37 +295,25 @@ typedef enum {
372
295
  #define LCB_CNTL_USE_COLLECTIONS 0x4a
373
296
 
374
297
  /**
375
- * Activate end-to-end tracing.
298
+ * Do not use fast-forward map from cluster configuration.
376
299
  *
377
- * Use `enable_tracing` in the connection string
300
+ * Use `vb_noremap` in the connection string
378
301
  *
379
302
  * @cntl_arg_both{int* (as boolean)}
380
303
  * @uncommitted
381
304
  */
382
- #define LCB_CNTL_ENABLE_TRACING 0x4e
383
-
384
- #define LCB_CNTL_TRACING_ORPHANED_QUEUE_FLUSH_INTERVAL 0x4f
385
- #define LCB_CNTL_TRACING_ORPHANED_QUEUE_SIZE 0x50
386
- #define LCB_CNTL_TRACING_THRESHOLD_QUEUE_FLUSH_INTERVAL 0x51
387
- #define LCB_CNTL_TRACING_THRESHOLD_QUEUE_SIZE 0x52
388
- #define LCB_CNTL_TRACING_THRESHOLD_KV 0x53
389
- #define LCB_CNTL_TRACING_THRESHOLD_N1QL 0x54
390
- #define LCB_CNTL_TRACING_THRESHOLD_VIEW 0x55
391
- #define LCB_CNTL_TRACING_THRESHOLD_FTS 0x56
392
- #define LCB_CNTL_TRACING_THRESHOLD_ANALYTICS 0x57
305
+ #define LCB_CNTL_VB_NOREMAP 0x5a
393
306
 
394
- #define LCB_CNTL_COMPRESSION_MIN_SIZE 0x58
395
- #define LCB_CNTL_COMPRESSION_MIN_RATIO 0x59
396
307
 
397
308
  /**
398
- * Do not use fast-forward map from cluster configuration.
399
- *
400
- * Use `vb_noremap` in the connection string
309
+ * Do not wait for GET_CLUSTER_CONFIG request to finish in lcb_wait(),
310
+ * when it is the only request in retry queue. Consider such retry queue
311
+ * as empty, and breakout to the place where lcb_wait() was invoked.
401
312
  *
402
313
  * @cntl_arg_both{int* (as boolean)}
314
+ *
403
315
  * @uncommitted
404
316
  */
405
- #define LCB_CNTL_VB_NOREMAP 0x5a
406
-
317
+ #define LCB_CNTL_WAIT_FOR_CONFIG 0x5c
407
318
 
408
319
  /**@}*/
@@ -238,6 +238,28 @@ typedef struct lcb_cntl_vbinfo_st {
238
238
  */
239
239
  #define LCB_CNTL_VBMAP 0x07
240
240
 
241
+
242
+ /**
243
+ * Modes for handling IPv6 in the IO layer.
244
+ */
245
+ typedef enum {
246
+ LCB_IPV6_DISABLED = 0x00, /**< disable IPv6 */
247
+ LCB_IPV6_ONLY = 0x1, /**< enforce only IPv6 */
248
+ LCB_IPV6_ALLOW = 0x02 /**< use both IPv6 and IPv4 */
249
+ } lcb_ipv6_t;
250
+
251
+ /**
252
+ * @brief IPv4/IPv6 selection policy
253
+ *
254
+ * Setting which controls whether hostname lookups should prefer IPv4 or IPv6
255
+ *
256
+ * Use `ipv6` in the connection string (e.g. "ipv6=allow" or "ipv6=only")
257
+ *
258
+ * @cntl_arg_both{lcb_ipv6_t*}
259
+ * @committed
260
+ */
261
+ #define LCB_CNTL_IP6POLICY 0x0b
262
+
241
263
  /**
242
264
  * @brief Configuration error threshold.
243
265
  *
@@ -262,13 +284,15 @@ typedef struct lcb_cntl_vbinfo_st {
262
284
  */
263
285
  #define LCB_CNTL_DURABILITY_TIMEOUT 0x0d
264
286
 
265
- /**@brief Polling grace interval for lcb_durability_poll()
287
+ /**
288
+ * @brief Polling grace interval for lcb_durability_poll()
266
289
  *
267
290
  * This is the time the client will wait between repeated probes to
268
291
  * a given server.
269
292
  *
270
293
  * @cntl_arg_both{lcb_U32*}
271
- * @committed*/
294
+ * @committed
295
+ */
272
296
  #define LCB_CNTL_DURABILITY_INTERVAL 0x0e
273
297
 
274
298
  /**
@@ -278,7 +302,8 @@ typedef struct lcb_cntl_vbinfo_st {
278
302
  * user management, etc.
279
303
  *
280
304
  * @cntl_arg_both{lcb_U32*}
281
- * @committed*/
305
+ * @committed
306
+ */
282
307
  #define LCB_CNTL_HTTP_TIMEOUT 0x0f
283
308
 
284
309
  /**
@@ -377,9 +402,18 @@ typedef struct lcb_cntl_vbinfo_st {
377
402
  * @{
378
403
  */
379
404
 
380
- /** @brief Logging Levels */
381
- typedef enum { LCB_LOG_TRACE = 0, LCB_LOG_DEBUG, LCB_LOG_INFO, LCB_LOG_WARN,
382
- LCB_LOG_ERROR, LCB_LOG_FATAL, LCB_LOG_MAX
405
+ /**
406
+ * @brief Logging Levels
407
+ * @committed
408
+ */
409
+ typedef enum {
410
+ LCB_LOG_TRACE = 0, /**< the most verbose level */
411
+ LCB_LOG_DEBUG, /**< diagnostic information, required to investigate problems */
412
+ LCB_LOG_INFO, /**< useful notices, not often */
413
+ LCB_LOG_WARN, /**< error notifications */
414
+ LCB_LOG_ERROR, /**< error messages, usually the library have to re-initialize connection instance */
415
+ LCB_LOG_FATAL, /**< fatal errors, the library cannot proceed */
416
+ LCB_LOG_MAX /**< internal value for total number of levels */
383
417
  } lcb_log_severity_t;
384
418
 
385
419
  struct lcb_logprocs_st;
@@ -587,6 +621,11 @@ typedef struct lcb_logprocs_st {
587
621
  */
588
622
  #define LCB_CNTL_CONFIGCACHE_RO 0x36
589
623
 
624
+ /**
625
+ * SSL options
626
+ *
627
+ * @committed
628
+ */
590
629
  typedef enum {
591
630
  LCB_SSL_ENABLED = 1 << 0, /**< Use SSL */
592
631
  LCB_SSL_NOVERIFY = 1 << 1, /**< Don't verify certificates */
@@ -601,6 +640,7 @@ typedef enum {
601
640
  * within the connection string. See @ref lcb_create_st3 for details.
602
641
  *
603
642
  * @cntl_arg_getonly{`int*` (value is one of @ref lcb_SSLOPTS)}
643
+ * @committed
604
644
  */
605
645
  #define LCB_CNTL_SSL_MODE 0x22
606
646
 
@@ -611,6 +651,7 @@ typedef enum {
611
651
  *
612
652
  * @cntl_arg_getonly{`char**`}
613
653
  * @see LCB_CNTL_SSL_MODE
654
+ * @committed
614
655
  */
615
656
  #define LCB_CNTL_SSL_CERT 0x23
616
657
 
@@ -624,6 +665,7 @@ typedef enum {
624
665
  * @cntl_arg_getonly{`char**`}
625
666
  * @see LCB_CNTL_SSL_MODE
626
667
  * @see https://developer.couchbase.com/documentation/server/5.0/security/security-certs-auth.html
668
+ * @committed
627
669
  */
628
670
  #define LCB_CNTL_SSL_KEY 0x4b
629
671
 
@@ -635,6 +677,7 @@ typedef enum {
635
677
  * @cntl_arg_getonly{`char**`}
636
678
  * @see LCB_CNTL_SSL_MODE
637
679
  * @see https://developer.couchbase.com/documentation/server/5.0/security/security-certs-auth.html
680
+ * @committed
638
681
  */
639
682
  #define LCB_CNTL_SSL_TRUSTSTORE 0x4d
640
683
 
@@ -1108,11 +1151,23 @@ typedef const char *lcb_BUCKETCRED[2];
1108
1151
  * expected to have specific info.
1109
1152
  *
1110
1153
  * Use `log_redaction` in the connection string
1111
-
1154
+ *
1112
1155
  * @cntl_arg_both{int* (as boolean)}
1156
+ * @committed
1113
1157
  */
1114
1158
  #define LCB_CNTL_LOG_REDACTION 0x4c
1115
1159
 
1160
+ /**
1161
+ * Activate/deactivate end-to-end tracing.
1162
+ *
1163
+ * Use `enable_tracing` in the connection string
1164
+ *
1165
+ * @cntl_arg_both{int* (as boolean)}
1166
+ * @see lcb-tracing-api
1167
+ * @committed
1168
+ */
1169
+ #define LCB_CNTL_ENABLE_TRACING 0x4e
1170
+
1116
1171
  typedef enum {
1117
1172
  LCBTRACE_THRESHOLD_KV = 0,
1118
1173
  LCBTRACE_THRESHOLD_N1QL,
@@ -1122,11 +1177,236 @@ typedef enum {
1122
1177
  LCBTRACE_THRESHOLD__MAX
1123
1178
  } lcbtrace_THRESHOLDOPTS;
1124
1179
 
1180
+ /**
1181
+ * Flush interval for orphaned spans queue in default tracer.
1182
+ *
1183
+ * This is the time the tracer will wait between repeated attempts
1184
+ * to flush most recent orphaned spans.
1185
+ *
1186
+ * Use `tracing_orphaned_queue_flush_interval` in the connection string
1187
+ *
1188
+ * @code{.c}
1189
+ * lcb_U32 tmo = 10000000; // 10 seconds in microseconds
1190
+ * lcb_cntl(instance, LCB_CNTL_SET, LCB_CNTL_TRACING_ORPHANED_QUEUE_FLUSH_INTERVAL, &tmo);
1191
+ * @endcode
1192
+ *
1193
+ * @code{.c}
1194
+ * rv = lcb_cntl_string("tracing_orphaned_queue_flush_interval", "10.0");
1195
+ * @endcode
1196
+ *
1197
+ * @cntl_arg_both{lcb_U32*}
1198
+ * @committed
1199
+ */
1200
+ #define LCB_CNTL_TRACING_ORPHANED_QUEUE_FLUSH_INTERVAL 0x4f
1201
+
1202
+ /**
1203
+ * Size of orphaned spans queue in default tracer.
1204
+ *
1205
+ * Queues in default tracer has fixed size, and it will remove information about older spans,
1206
+ * when the limit will be reached before flushing time.
1207
+ *
1208
+ * Use `tracing_orphaned_queue_size` in the connection string
1209
+ *
1210
+ * @cntl_arg_both{lcb_U32*}
1211
+ * @committed
1212
+ */
1213
+ #define LCB_CNTL_TRACING_ORPHANED_QUEUE_SIZE 0x50
1214
+
1215
+ /**
1216
+ * Flush interval for spans with total time over threshold in default tracer.
1217
+ *
1218
+ * This is the time the tracer will wait between repeated attempts
1219
+ * to flush threshold queue.
1220
+ *
1221
+ * Use `tracing_threshold_queue_flush_interval` in the connection string
1222
+ *
1223
+ * @code{.c}
1224
+ * lcb_U32 tmo = 10000000; // 10 seconds in microseconds
1225
+ * lcb_cntl(instance, LCB_CNTL_SET, LCB_CNTL_TRACING_THRESHOLD_QUEUE_FLUSH_INTERVAL, &tmo);
1226
+ * @endcode
1227
+ *
1228
+ * @code{.c}
1229
+ * rv = lcb_cntl_string("tracing_threshold_queue_flush_interval", "10.0");
1230
+ * @endcode
1231
+ *
1232
+ * @cntl_arg_both{lcb_U32*}
1233
+ * @committed
1234
+ */
1235
+ #define LCB_CNTL_TRACING_THRESHOLD_QUEUE_FLUSH_INTERVAL 0x51
1236
+
1237
+ /**
1238
+ * Size of threshold queue in default tracer.
1239
+ *
1240
+ * Queues in default tracer has fixed size, and it will remove information about older spans,
1241
+ * when the limit will be reached before flushing time.
1242
+ *
1243
+ * Use `tracing_threshold_queue_size` in the connection string
1244
+ *
1245
+ * @cntl_arg_both{lcb_U32*}
1246
+ * @committed
1247
+ */
1248
+ #define LCB_CNTL_TRACING_THRESHOLD_QUEUE_SIZE 0x52
1249
+
1250
+ /**
1251
+ * Minimum time for the tracing span of KV service to be considered by threshold tracer.
1252
+ *
1253
+ * Use `tracing_threshold_kv` in the connection string
1254
+ *
1255
+ * @cntl_arg_both{lcb_U32*}
1256
+ * @committed
1257
+ */
1258
+ #define LCB_CNTL_TRACING_THRESHOLD_KV 0x53
1259
+
1260
+ /**
1261
+ * Minimum time for the tracing span of N1QL service to be considered by threshold tracer.
1262
+ *
1263
+ * Use `tracing_threshold_n1ql` in the connection string
1264
+ *
1265
+ * @cntl_arg_both{lcb_U32*}
1266
+ * @committed
1267
+ */
1268
+ #define LCB_CNTL_TRACING_THRESHOLD_N1QL 0x54
1269
+
1270
+ /**
1271
+ * Minimum time for the tracing span of VIEW service to be considered by threshold tracer.
1272
+ *
1273
+ * Use `tracing_threshold_view` in the connection string
1274
+ *
1275
+ * @cntl_arg_both{lcb_U32*}
1276
+ * @committed
1277
+ */
1278
+ #define LCB_CNTL_TRACING_THRESHOLD_VIEW 0x55
1279
+
1280
+ /**
1281
+ * Minimum time for the tracing span of FTS service to be considered by threshold tracer.
1282
+ *
1283
+ * Use `tracing_threshold_fts` in the connection string
1284
+ *
1285
+ * @cntl_arg_both{lcb_U32*}
1286
+ * @committed
1287
+ */
1288
+ #define LCB_CNTL_TRACING_THRESHOLD_FTS 0x56
1289
+
1290
+ /**
1291
+ * Minimum time for the tracing span of ANALYTICS service to be considered by threshold tracer.
1292
+ *
1293
+ * Use `tracing_threshold_analytics` in the connection string
1294
+ *
1295
+ * @cntl_arg_both{lcb_U32*}
1296
+ * @committed
1297
+ */
1298
+ #define LCB_CNTL_TRACING_THRESHOLD_ANALYTICS 0x57
1299
+
1300
+ /**
1301
+ * Options for how to handle compression
1302
+ *
1303
+ * @committed
1304
+ */
1305
+ typedef enum {
1306
+ /** Do not perform compression in any direction. Data which is received
1307
+ * compressed via the server will be indicated as such by having the
1308
+ * `LCB_VALUE_F_SNAPPYCOMP` flag set in the lcb_GETRESPv0::datatype field */
1309
+ LCB_COMPRESS_NONE = 0x00,
1310
+
1311
+ /**
1312
+ * Decompress incoming data, if the data has been compressed at the server.
1313
+ * If this is set, the `datatype` field in responses will always be stripped
1314
+ * of the `LCB_VALUE_F_SNAPPYCOMP` flag.
1315
+ */
1316
+ LCB_COMPRESS_IN = 1 << 0,
1317
+
1318
+ /**
1319
+ * Compress outgoing data. Note that if the `datatype` field contains the
1320
+ * `LCB_VALUE_F_SNAPPYCOMP` flag, then the data will never be compressed
1321
+ * as it is assumed that it is already compressed.
1322
+ */
1323
+ LCB_COMPRESS_OUT = 1 << 1,
1324
+
1325
+
1326
+ LCB_COMPRESS_INOUT = (LCB_COMPRESS_IN|LCB_COMPRESS_OUT),
1327
+
1328
+ /**
1329
+ * By default the library will send a HELLO command to the server to
1330
+ * determine whether compression is supported or not. Because commands may
1331
+ * be pipelined prior to the scheduing of the HELLO command it is possible
1332
+ * that the first few commands may not be compressed when schedule due to
1333
+ * the library not yet having negotiated settings with the server. Setting
1334
+ * this flag will force the client to assume that all servers support
1335
+ * compression despite a HELLO not having been intially negotiated.
1336
+ */
1337
+ LCB_COMPRESS_FORCE = 1 << 2
1338
+ } lcb_COMPRESSOPTS;
1339
+
1340
+ /**
1341
+ * @brief Control how the library handles compression and deflation to and from
1342
+ * the server.
1343
+ *
1344
+ * Starting in Couchbase Server 3.0, compression can optionally be applied to
1345
+ * incoming and outcoming data. For incoming (i.e. `GET` requests) the data
1346
+ * may be received in compressed format and then allow the client to inflate
1347
+ * the data upon receipt. For outgoing (i.e. `SET` requests) the data may be
1348
+ * compressed on the client side and then be stored and recognized on the
1349
+ * server itself.
1350
+ *
1351
+ * The default behavior is to transparently handle compression for both incoming
1352
+ * and outgoing data.
1353
+ *
1354
+ * Note that if the lcb_STORECMDv0::datatype field is set with compression
1355
+ * flags, the data will _never_ be compressed by the library as this is an
1356
+ * indication that it is _already_ compressed.
1357
+ *
1358
+ * @cntl_arg_both{`int*` (value is one of @ref lcb_COMPRESSOPTS)}
1359
+ * @committed
1360
+ */
1361
+ #define LCB_CNTL_COMPRESSION_OPTS 0x26
1362
+
1363
+ /**
1364
+ * Minimum size of the document payload to be compressed when compression enabled.
1365
+ *
1366
+ * Use `compression_min_size` in the connection string
1367
+ *
1368
+ * @cntl_arg_both{lcb_U32*}
1369
+ * @committed
1370
+ */
1371
+ #define LCB_CNTL_COMPRESSION_MIN_SIZE 0x58
1372
+
1373
+ /**
1374
+ * Minimum compression ratio (compressed / original) of the compressed payload to allow sending it to cluster.
1375
+ *
1376
+ * Use `compression_min_ratio` in the connection string
1377
+ *
1378
+ * @cntl_arg_both{lcb_U32*}
1379
+ * @committed
1380
+ */
1381
+ #define LCB_CNTL_COMPRESSION_MIN_RATIO 0x59
1382
+
1383
+
1384
+ /**
1385
+ * Select type of network (alternative addresses).
1386
+ *
1387
+ * Use `network` in the connection string
1388
+ *
1389
+ * @cntl_arg_get_and_set{`const char**`, `const char*`}
1390
+ *
1391
+ * @uncommitted
1392
+ */
1393
+ #define LCB_CNTL_NETWORK 0x5b
1394
+
1395
+ /**
1396
+ * The amount of time the pool should wait before closing idle connections.
1397
+ *
1398
+ * Use `http_pool_timeout` in the connection string
1399
+ *
1400
+ * @cntl_arg_both{lcb_U32*}
1401
+ * @committed
1402
+ */
1403
+ #define LCB_CNTL_HTTP_POOL_TIMEOUT 0x5d
1404
+
1125
1405
  /**
1126
1406
  * This is not a command, but rather an indicator of the last item.
1127
1407
  * @internal
1128
1408
  */
1129
- #define LCB_CNTL__MAX 0x5b
1409
+ #define LCB_CNTL__MAX 0x5e
1130
1410
  /**@}*/
1131
1411
 
1132
1412
  #ifdef __cplusplus