couchbase 3.5.1 → 3.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1166) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/ext/0001-fix-build-for-mingw-w64-ucrt-x86_64-toolchain.patch +40 -0
  4. data/ext/CMakeLists.txt +22 -2
  5. data/ext/cache/extconf_include.rb +3 -3
  6. data/ext/cache/mozilla-ca-bundle.crt +19 -32
  7. data/ext/cache/mozilla-ca-bundle.sha256 +1 -1
  8. data/ext/couchbase/CMakeLists.txt +16 -9
  9. data/ext/couchbase/cmake/0001-fix-build-for-mingw-w64-ucrt-x86_64-toolchain.patch +3 -4
  10. data/ext/couchbase/cmake/CompilerWarnings.cmake +2 -1
  11. data/ext/couchbase/cmake/Packaging.cmake +41 -0
  12. data/ext/couchbase/cmake/Sanitizers.cmake +1 -0
  13. data/ext/couchbase/cmake/VersionInfo.cmake +5 -5
  14. data/ext/couchbase/cmake/build_version.hxx.in +1 -0
  15. data/ext/couchbase/cmake/couchbase-cxx-client.pc.in +10 -0
  16. data/ext/couchbase/cmake/test_boringssl.cxx +1 -1
  17. data/ext/couchbase/cmake/test_openssl.cxx +1 -1
  18. data/ext/couchbase/core/agent.cxx +353 -304
  19. data/ext/couchbase/core/agent.hxx +94 -76
  20. data/ext/couchbase/core/agent_config.cxx +9 -8
  21. data/ext/couchbase/core/agent_config.hxx +7 -7
  22. data/ext/couchbase/core/agent_group.cxx +132 -120
  23. data/ext/couchbase/core/agent_group.hxx +26 -22
  24. data/ext/couchbase/core/agent_group_config.cxx +8 -7
  25. data/ext/couchbase/core/agent_group_config.hxx +6 -6
  26. data/ext/couchbase/core/agent_unit_test_api.hxx +6 -6
  27. data/ext/couchbase/core/analytics_query_options.cxx +21 -21
  28. data/ext/couchbase/core/analytics_query_options.hxx +19 -18
  29. data/ext/couchbase/core/analytics_scan_consistency.hxx +2 -2
  30. data/ext/couchbase/core/bucket.cxx +848 -776
  31. data/ext/couchbase/core/bucket.hxx +151 -139
  32. data/ext/couchbase/core/capella_ca.hxx +20 -19
  33. data/ext/couchbase/core/cluster.cxx +1240 -927
  34. data/ext/couchbase/core/cluster.hxx +254 -167
  35. data/ext/couchbase/core/cluster_agent.cxx +7 -7
  36. data/ext/couchbase/core/cluster_agent.hxx +4 -4
  37. data/ext/couchbase/core/cluster_agent_config.cxx +8 -7
  38. data/ext/couchbase/core/cluster_agent_config.hxx +6 -6
  39. data/ext/couchbase/core/cluster_options.cxx +17 -17
  40. data/ext/couchbase/core/cluster_options.hxx +50 -47
  41. data/ext/couchbase/core/cluster_state.hxx +3 -3
  42. data/ext/couchbase/core/collection_id_cache_entry.hxx +5 -4
  43. data/ext/couchbase/core/collections_component.cxx +372 -329
  44. data/ext/couchbase/core/collections_component.hxx +17 -13
  45. data/ext/couchbase/core/collections_component_unit_test_api.hxx +6 -6
  46. data/ext/couchbase/core/collections_options.hxx +29 -27
  47. data/ext/couchbase/core/config_listener.hxx +3 -3
  48. data/ext/couchbase/core/config_profile.hxx +3 -3
  49. data/ext/couchbase/core/config_profiles.cxx +31 -31
  50. data/ext/couchbase/core/config_profiles.hxx +19 -19
  51. data/ext/couchbase/core/core_sdk_shim.cxx +2 -1
  52. data/ext/couchbase/core/core_sdk_shim.hxx +2 -2
  53. data/ext/couchbase/core/crud_component.cxx +310 -276
  54. data/ext/couchbase/core/crud_component.hxx +21 -15
  55. data/ext/couchbase/core/crud_options.hxx +361 -354
  56. data/ext/couchbase/core/crypto/cbcrypto.cc +732 -627
  57. data/ext/couchbase/core/crypto/cbcrypto.h +12 -3
  58. data/ext/couchbase/core/design_document_namespace.hxx +2 -2
  59. data/ext/couchbase/core/design_document_namespace_fmt.hxx +18 -18
  60. data/ext/couchbase/core/diagnostics.hxx +44 -44
  61. data/ext/couchbase/core/diagnostics_fmt.hxx +76 -76
  62. data/ext/couchbase/core/diagnostics_json.hxx +61 -60
  63. data/ext/couchbase/core/diagntostics_options.hxx +14 -14
  64. data/ext/couchbase/core/dispatcher.cxx +4 -3
  65. data/ext/couchbase/core/dispatcher.hxx +8 -7
  66. data/ext/couchbase/core/document_id.cxx +37 -34
  67. data/ext/couchbase/core/document_id.hxx +87 -86
  68. data/ext/couchbase/core/document_id_fmt.hxx +10 -10
  69. data/ext/couchbase/core/durability_options.hxx +50 -49
  70. data/ext/couchbase/core/error_context/analytics.hxx +18 -18
  71. data/ext/couchbase/core/error_context/analytics_json.hxx +115 -0
  72. data/ext/couchbase/core/error_context/base_error_context.hxx +184 -0
  73. data/ext/couchbase/core/error_context/http.hxx +14 -14
  74. data/ext/couchbase/core/error_context/http_json.hxx +90 -0
  75. data/ext/couchbase/core/error_context/internal_tof_metadata_json.hxx +36 -0
  76. data/ext/couchbase/core/error_context/key_value.cxx +27 -27
  77. data/ext/couchbase/core/error_context/key_value.hxx +41 -38
  78. data/ext/couchbase/core/error_context/key_value_error_context.hxx +235 -0
  79. data/ext/couchbase/core/error_context/key_value_error_map_attribute.hxx +142 -0
  80. data/ext/couchbase/core/error_context/key_value_error_map_info.hxx +139 -0
  81. data/ext/couchbase/core/error_context/key_value_extended_error_info.hxx +86 -0
  82. data/ext/couchbase/core/error_context/key_value_json.hxx +83 -0
  83. data/ext/couchbase/core/error_context/key_value_status_code.hxx +109 -0
  84. data/ext/couchbase/core/error_context/query.hxx +18 -18
  85. data/ext/couchbase/core/error_context/query_error_context.hxx +150 -0
  86. data/ext/couchbase/core/error_context/query_json.hxx +114 -0
  87. data/ext/couchbase/core/error_context/query_public_json.hxx +84 -0
  88. data/ext/couchbase/core/error_context/search.hxx +17 -17
  89. data/ext/couchbase/core/error_context/search_json.hxx +101 -0
  90. data/ext/couchbase/core/error_context/subdocument_error_context.hxx +147 -0
  91. data/ext/couchbase/core/error_context/subdocument_json.hxx +48 -0
  92. data/ext/couchbase/{couchbase → core/error_context}/transaction_error_context.hxx +22 -22
  93. data/ext/couchbase/core/error_context/transaction_op_error_context.hxx +79 -0
  94. data/ext/couchbase/core/error_context/view.hxx +17 -17
  95. data/ext/couchbase/core/fmt/key_value_error_map_attribute.hxx +100 -0
  96. data/ext/couchbase/{couchbase → core}/fmt/key_value_extended_error_info.hxx +20 -20
  97. data/ext/couchbase/core/fmt/key_value_status_code.hxx +269 -0
  98. data/ext/couchbase/core/free_form_http_request.cxx +26 -26
  99. data/ext/couchbase/core/free_form_http_request.hxx +34 -33
  100. data/ext/couchbase/core/impl/analytics.cxx +111 -131
  101. data/ext/couchbase/core/impl/analytics.hxx +5 -7
  102. data/ext/couchbase/core/impl/analytics_error_category.cxx +29 -28
  103. data/ext/couchbase/core/impl/analytics_index_manager.cxx +615 -516
  104. data/ext/couchbase/core/impl/best_effort_retry_strategy.cxx +53 -50
  105. data/ext/couchbase/core/impl/binary_collection.cxx +346 -285
  106. data/ext/couchbase/core/impl/boolean_field_query.cxx +10 -10
  107. data/ext/couchbase/core/impl/boolean_query.cxx +27 -27
  108. data/ext/couchbase/core/impl/bootstrap_state_listener.hxx +6 -6
  109. data/ext/couchbase/core/impl/bucket.cxx +39 -34
  110. data/ext/couchbase/core/impl/bucket_manager.cxx +354 -313
  111. data/ext/couchbase/core/impl/cluster.cxx +430 -325
  112. data/ext/couchbase/core/impl/collection.cxx +1033 -1187
  113. data/ext/couchbase/core/impl/collection_manager.cxx +201 -170
  114. data/ext/couchbase/core/impl/common_error_category.cxx +58 -55
  115. data/ext/couchbase/core/impl/configuration_profiles_registry.cxx +46 -32
  116. data/ext/couchbase/core/impl/conjunction_query.cxx +17 -17
  117. data/ext/couchbase/core/impl/date_range.cxx +24 -20
  118. data/ext/couchbase/core/impl/date_range_facet.cxx +22 -22
  119. data/ext/couchbase/core/impl/date_range_facet_result.cxx +6 -6
  120. data/ext/couchbase/core/impl/date_range_query.cxx +50 -48
  121. data/ext/couchbase/core/impl/diagnostics.cxx +211 -198
  122. data/ext/couchbase/core/impl/diagnostics.hxx +7 -6
  123. data/ext/couchbase/core/impl/disjunction_query.cxx +18 -17
  124. data/ext/couchbase/core/impl/dns_srv_tracker.cxx +92 -75
  125. data/ext/couchbase/core/impl/dns_srv_tracker.hxx +24 -20
  126. data/ext/couchbase/core/impl/doc_id_query.cxx +9 -9
  127. data/ext/couchbase/core/impl/encoded_search_facet.hxx +2 -2
  128. data/ext/couchbase/core/impl/encoded_search_query.hxx +2 -2
  129. data/ext/couchbase/core/impl/encoded_search_sort.hxx +2 -2
  130. data/ext/couchbase/core/impl/error.cxx +171 -0
  131. data/ext/couchbase/core/impl/error.hxx +64 -0
  132. data/ext/couchbase/core/impl/error_context.cxx +56 -0
  133. data/ext/couchbase/core/impl/expiry.cxx +66 -53
  134. data/ext/couchbase/core/impl/fail_fast_retry_strategy.cxx +5 -4
  135. data/ext/couchbase/core/impl/field_level_encryption_error_category.cxx +30 -28
  136. data/ext/couchbase/core/impl/geo_bounding_box_query.cxx +17 -17
  137. data/ext/couchbase/core/impl/geo_distance_query.cxx +14 -14
  138. data/ext/couchbase/core/impl/geo_polygon_query.cxx +17 -17
  139. data/ext/couchbase/core/impl/get_all_replicas.hxx +26 -22
  140. data/ext/couchbase/core/impl/get_any_replica.hxx +25 -23
  141. data/ext/couchbase/core/impl/get_replica.cxx +18 -15
  142. data/ext/couchbase/core/impl/get_replica.hxx +23 -18
  143. data/ext/couchbase/core/impl/internal_date_range_facet_result.cxx +16 -14
  144. data/ext/couchbase/core/impl/internal_date_range_facet_result.hxx +16 -15
  145. data/ext/couchbase/core/impl/internal_error_context.cxx +79 -0
  146. data/ext/couchbase/core/impl/internal_error_context.hxx +52 -0
  147. data/ext/couchbase/core/impl/internal_numeric_range_facet_result.cxx +18 -15
  148. data/ext/couchbase/core/impl/internal_numeric_range_facet_result.hxx +16 -15
  149. data/ext/couchbase/core/impl/internal_scan_result.hxx +7 -7
  150. data/ext/couchbase/core/impl/internal_search_error_context.cxx +25 -22
  151. data/ext/couchbase/core/impl/internal_search_error_context.hxx +32 -31
  152. data/ext/couchbase/core/impl/internal_search_meta_data.cxx +15 -13
  153. data/ext/couchbase/core/impl/internal_search_meta_data.hxx +10 -9
  154. data/ext/couchbase/core/impl/internal_search_result.cxx +30 -22
  155. data/ext/couchbase/core/impl/internal_search_result.hxx +10 -9
  156. data/ext/couchbase/core/impl/internal_search_row.cxx +10 -10
  157. data/ext/couchbase/core/impl/internal_search_row.hxx +16 -16
  158. data/ext/couchbase/core/impl/internal_search_row_location.hxx +2 -2
  159. data/ext/couchbase/core/impl/internal_search_row_locations.cxx +68 -65
  160. data/ext/couchbase/core/impl/internal_search_row_locations.hxx +16 -13
  161. data/ext/couchbase/core/impl/internal_term_facet_result.cxx +16 -14
  162. data/ext/couchbase/core/impl/internal_term_facet_result.hxx +15 -15
  163. data/ext/couchbase/core/impl/key_value_error_category.cxx +73 -72
  164. data/ext/couchbase/core/impl/key_value_error_context.cxx +65 -65
  165. data/ext/couchbase/core/impl/logger.cxx +91 -0
  166. data/ext/couchbase/core/impl/lookup_in_all_replicas.hxx +32 -29
  167. data/ext/couchbase/core/impl/lookup_in_any_replica.hxx +33 -29
  168. data/ext/couchbase/core/impl/lookup_in_replica.cxx +75 -68
  169. data/ext/couchbase/core/impl/lookup_in_replica.hxx +30 -26
  170. data/ext/couchbase/core/impl/management_error_category.cxx +41 -40
  171. data/ext/couchbase/core/impl/match_all_query.cxx +6 -6
  172. data/ext/couchbase/core/impl/match_none_query.cxx +6 -6
  173. data/ext/couchbase/core/impl/match_phrase_query.cxx +13 -13
  174. data/ext/couchbase/core/impl/match_query.cxx +28 -28
  175. data/ext/couchbase/core/impl/network_error_category.cxx +39 -38
  176. data/ext/couchbase/core/impl/numeric_range.cxx +6 -6
  177. data/ext/couchbase/core/impl/numeric_range_facet.cxx +22 -22
  178. data/ext/couchbase/core/impl/numeric_range_facet_result.cxx +6 -6
  179. data/ext/couchbase/core/impl/numeric_range_query.cxx +22 -22
  180. data/ext/couchbase/core/impl/observe_poll.cxx +294 -277
  181. data/ext/couchbase/core/impl/observe_poll.hxx +1 -1
  182. data/ext/couchbase/core/impl/observe_seqno.cxx +21 -18
  183. data/ext/couchbase/core/impl/observe_seqno.hxx +31 -26
  184. data/ext/couchbase/core/impl/phrase_query.cxx +10 -10
  185. data/ext/couchbase/core/impl/prefix_query.cxx +10 -10
  186. data/ext/couchbase/core/impl/query.cxx +163 -154
  187. data/ext/couchbase/core/impl/query.hxx +6 -7
  188. data/ext/couchbase/core/impl/query_error_category.cxx +22 -21
  189. data/ext/couchbase/core/impl/query_error_context.cxx +45 -45
  190. data/ext/couchbase/core/impl/query_index_manager.cxx +488 -408
  191. data/ext/couchbase/core/impl/query_string_query.cxx +7 -7
  192. data/ext/couchbase/core/impl/regexp_query.cxx +10 -10
  193. data/ext/couchbase/core/impl/replica_utils.cxx +66 -0
  194. data/ext/couchbase/core/impl/replica_utils.hxx +48 -0
  195. data/ext/couchbase/core/impl/retry_action.cxx +3 -3
  196. data/ext/couchbase/core/impl/retry_reason.cxx +129 -56
  197. data/ext/couchbase/core/impl/retry_reason.hxx +28 -0
  198. data/ext/couchbase/core/impl/scan_result.cxx +53 -49
  199. data/ext/couchbase/core/impl/scope.cxx +103 -94
  200. data/ext/couchbase/core/impl/search.cxx +139 -130
  201. data/ext/couchbase/core/impl/search.hxx +4 -4
  202. data/ext/couchbase/core/impl/search_error_category.cxx +18 -17
  203. data/ext/couchbase/core/impl/search_index_manager.cxx +492 -390
  204. data/ext/couchbase/core/impl/search_meta_data.cxx +3 -3
  205. data/ext/couchbase/core/impl/search_request.cxx +78 -78
  206. data/ext/couchbase/core/impl/search_result.cxx +5 -5
  207. data/ext/couchbase/core/impl/search_row.cxx +7 -7
  208. data/ext/couchbase/core/impl/search_row_location.cxx +9 -8
  209. data/ext/couchbase/core/impl/search_row_locations.cxx +8 -7
  210. data/ext/couchbase/core/impl/search_sort_field.cxx +53 -53
  211. data/ext/couchbase/core/impl/search_sort_geo_distance.cxx +49 -48
  212. data/ext/couchbase/core/impl/search_sort_id.cxx +10 -10
  213. data/ext/couchbase/core/impl/search_sort_score.cxx +10 -10
  214. data/ext/couchbase/core/impl/streaming_json_lexer_error_category.cxx +70 -68
  215. data/ext/couchbase/core/impl/subdoc/array_add_unique.cxx +6 -6
  216. data/ext/couchbase/core/impl/subdoc/array_append.cxx +6 -6
  217. data/ext/couchbase/core/impl/subdoc/array_insert.cxx +6 -6
  218. data/ext/couchbase/core/impl/subdoc/array_prepend.cxx +6 -6
  219. data/ext/couchbase/core/impl/subdoc/command.hxx +5 -5
  220. data/ext/couchbase/core/impl/subdoc/command_bundle.hxx +11 -11
  221. data/ext/couchbase/core/impl/subdoc/count.cxx +6 -6
  222. data/ext/couchbase/core/impl/subdoc/counter.cxx +6 -6
  223. data/ext/couchbase/core/impl/subdoc/exists.cxx +6 -6
  224. data/ext/couchbase/core/impl/subdoc/get.cxx +6 -6
  225. data/ext/couchbase/core/impl/subdoc/insert.cxx +6 -6
  226. data/ext/couchbase/core/impl/subdoc/join_values.cxx +25 -25
  227. data/ext/couchbase/core/impl/subdoc/lookup_in_macro.cxx +61 -60
  228. data/ext/couchbase/core/impl/subdoc/lookup_in_specs.cxx +9 -9
  229. data/ext/couchbase/core/impl/subdoc/mutate_in_macro.cxx +48 -39
  230. data/ext/couchbase/core/impl/subdoc/mutate_in_specs.cxx +9 -9
  231. data/ext/couchbase/core/impl/subdoc/opcode.hxx +16 -16
  232. data/ext/couchbase/core/impl/subdoc/path_flags.hxx +40 -17
  233. data/ext/couchbase/core/impl/subdoc/remove.cxx +6 -6
  234. data/ext/couchbase/core/impl/subdoc/replace.cxx +6 -6
  235. data/ext/couchbase/core/impl/subdoc/upsert.cxx +6 -6
  236. data/ext/couchbase/core/impl/term_facet.cxx +8 -8
  237. data/ext/couchbase/core/impl/term_facet_result.cxx +6 -6
  238. data/ext/couchbase/core/impl/term_query.cxx +25 -25
  239. data/ext/couchbase/core/impl/term_range_query.cxx +22 -22
  240. data/ext/couchbase/core/impl/transaction_error_category.cxx +21 -20
  241. data/ext/couchbase/core/impl/transaction_get_result.cxx +41 -30
  242. data/ext/couchbase/core/impl/transaction_op_error_category.cxx +55 -56
  243. data/ext/couchbase/core/impl/vector_query.cxx +15 -10
  244. data/ext/couchbase/core/impl/vector_search.cxx +9 -9
  245. data/ext/couchbase/core/impl/view_error_category.cxx +17 -16
  246. data/ext/couchbase/core/impl/wildcard_query.cxx +10 -10
  247. data/ext/couchbase/core/impl/with_legacy_durability.hxx +30 -29
  248. data/ext/couchbase/core/io/dns_client.cxx +257 -232
  249. data/ext/couchbase/core/io/dns_client.hxx +19 -18
  250. data/ext/couchbase/core/io/dns_codec.hxx +156 -154
  251. data/ext/couchbase/core/io/dns_config.cxx +114 -109
  252. data/ext/couchbase/core/io/dns_config.hxx +15 -13
  253. data/ext/couchbase/core/io/dns_message.hxx +365 -342
  254. data/ext/couchbase/core/io/http_command.hxx +155 -134
  255. data/ext/couchbase/core/io/http_context.hxx +5 -5
  256. data/ext/couchbase/core/io/http_message.hxx +75 -71
  257. data/ext/couchbase/core/io/http_parser.cxx +70 -67
  258. data/ext/couchbase/core/io/http_parser.hxx +18 -18
  259. data/ext/couchbase/core/io/http_session.hxx +620 -520
  260. data/ext/couchbase/core/io/http_session_manager.hxx +406 -315
  261. data/ext/couchbase/core/io/http_traits.hxx +7 -0
  262. data/ext/couchbase/core/io/ip_protocol.hxx +3 -3
  263. data/ext/couchbase/core/io/mcbp_command.hxx +298 -278
  264. data/ext/couchbase/core/io/mcbp_context.hxx +7 -6
  265. data/ext/couchbase/core/io/mcbp_message.cxx +8 -8
  266. data/ext/couchbase/core/io/mcbp_message.hxx +19 -19
  267. data/ext/couchbase/core/io/mcbp_parser.cxx +60 -51
  268. data/ext/couchbase/core/io/mcbp_parser.hxx +21 -17
  269. data/ext/couchbase/core/io/mcbp_session.cxx +1769 -1616
  270. data/ext/couchbase/core/io/mcbp_session.hxx +63 -57
  271. data/ext/couchbase/core/io/query_cache.hxx +34 -34
  272. data/ext/couchbase/core/io/retry_context.hxx +45 -45
  273. data/ext/couchbase/core/io/retry_orchestrator.hxx +52 -42
  274. data/ext/couchbase/core/io/streams.hxx +210 -193
  275. data/ext/couchbase/core/json_string.hxx +47 -47
  276. data/ext/couchbase/core/key_value_config.cxx +8 -8
  277. data/ext/couchbase/core/key_value_config.hxx +12 -11
  278. data/ext/couchbase/core/logger/configuration.hxx +35 -35
  279. data/ext/couchbase/core/logger/custom_rotating_file_sink.cxx +73 -72
  280. data/ext/couchbase/core/logger/custom_rotating_file_sink.hxx +20 -18
  281. data/ext/couchbase/core/logger/level.hxx +9 -1
  282. data/ext/couchbase/core/logger/logger.cxx +279 -252
  283. data/ext/couchbase/core/logger/logger.hxx +110 -58
  284. data/ext/couchbase/core/management/analytics_dataset.hxx +4 -4
  285. data/ext/couchbase/core/management/analytics_index.hxx +4 -4
  286. data/ext/couchbase/core/management/analytics_link_azure_blob_external.cxx +35 -33
  287. data/ext/couchbase/core/management/analytics_link_azure_blob_external.hxx +36 -35
  288. data/ext/couchbase/core/management/analytics_link_azure_blob_external_json.hxx +24 -20
  289. data/ext/couchbase/core/management/analytics_link_couchbase_remote.cxx +66 -65
  290. data/ext/couchbase/core/management/analytics_link_couchbase_remote.hxx +77 -70
  291. data/ext/couchbase/core/management/analytics_link_couchbase_remote_json.hxx +38 -32
  292. data/ext/couchbase/core/management/analytics_link_s3_external.cxx +26 -25
  293. data/ext/couchbase/core/management/analytics_link_s3_external.hxx +30 -30
  294. data/ext/couchbase/core/management/analytics_link_s3_external_json.hxx +18 -16
  295. data/ext/couchbase/core/management/bucket_settings.hxx +109 -91
  296. data/ext/couchbase/core/management/bucket_settings_json.hxx +112 -94
  297. data/ext/couchbase/core/management/design_document.hxx +9 -9
  298. data/ext/couchbase/core/management/eventing_function.hxx +124 -121
  299. data/ext/couchbase/core/management/eventing_function_json.hxx +228 -184
  300. data/ext/couchbase/core/management/eventing_status.hxx +41 -41
  301. data/ext/couchbase/core/management/eventing_status_json.hxx +53 -45
  302. data/ext/couchbase/core/management/rbac.hxx +33 -28
  303. data/ext/couchbase/core/management/rbac_fmt.hxx +21 -21
  304. data/ext/couchbase/core/management/rbac_json.hxx +132 -125
  305. data/ext/couchbase/core/management/search_index.cxx +79 -0
  306. data/ext/couchbase/core/management/search_index.hxx +11 -10
  307. data/ext/couchbase/core/management/search_index_json.hxx +27 -26
  308. data/ext/couchbase/core/mcbp/barrier_frame.hxx +4 -3
  309. data/ext/couchbase/core/mcbp/big_endian.cxx +22 -22
  310. data/ext/couchbase/core/mcbp/buffer_writer.cxx +22 -19
  311. data/ext/couchbase/core/mcbp/buffer_writer.hxx +9 -9
  312. data/ext/couchbase/core/mcbp/codec.cxx +419 -397
  313. data/ext/couchbase/core/mcbp/codec.hxx +14 -12
  314. data/ext/couchbase/core/mcbp/command_code.cxx +48 -48
  315. data/ext/couchbase/core/mcbp/completion_token.hxx +33 -33
  316. data/ext/couchbase/core/mcbp/datatype.hxx +3 -3
  317. data/ext/couchbase/core/mcbp/durability_level.hxx +8 -7
  318. data/ext/couchbase/core/mcbp/durability_level_frame.hxx +3 -2
  319. data/ext/couchbase/core/mcbp/durability_timeout_frame.hxx +4 -3
  320. data/ext/couchbase/core/mcbp/open_tracing_frame.hxx +3 -2
  321. data/ext/couchbase/core/mcbp/operation_consumer.cxx +3 -3
  322. data/ext/couchbase/core/mcbp/operation_consumer.hxx +9 -9
  323. data/ext/couchbase/core/mcbp/operation_queue.cxx +76 -70
  324. data/ext/couchbase/core/mcbp/operation_queue.hxx +18 -17
  325. data/ext/couchbase/core/mcbp/packet.cxx +65 -51
  326. data/ext/couchbase/core/mcbp/packet.hxx +25 -25
  327. data/ext/couchbase/core/mcbp/preserve_expiry_frame.hxx +4 -2
  328. data/ext/couchbase/core/mcbp/queue_callback.hxx +3 -2
  329. data/ext/couchbase/core/mcbp/queue_request.cxx +65 -62
  330. data/ext/couchbase/core/mcbp/queue_request.hxx +54 -52
  331. data/ext/couchbase/core/mcbp/queue_request_connection_info.hxx +3 -3
  332. data/ext/couchbase/core/mcbp/queue_response.hxx +7 -7
  333. data/ext/couchbase/core/mcbp/read_units_frame.hxx +3 -2
  334. data/ext/couchbase/core/mcbp/server_duration.cxx +7 -7
  335. data/ext/couchbase/core/mcbp/server_duration_frame.hxx +3 -2
  336. data/ext/couchbase/core/mcbp/stream_id_frame.hxx +3 -2
  337. data/ext/couchbase/core/mcbp/unsupported_frame.hxx +4 -3
  338. data/ext/couchbase/core/mcbp/user_impersonation_frame.hxx +1 -1
  339. data/ext/couchbase/core/mcbp/write_units_frame.hxx +3 -2
  340. data/ext/couchbase/core/meta/features.hxx +58 -0
  341. data/ext/couchbase/core/meta/version.cxx +255 -204
  342. data/ext/couchbase/core/meta/version.hxx +31 -20
  343. data/ext/couchbase/core/metrics/logging_meter.cxx +160 -154
  344. data/ext/couchbase/core/metrics/logging_meter.hxx +16 -15
  345. data/ext/couchbase/core/metrics/logging_meter_options.hxx +1 -1
  346. data/ext/couchbase/core/metrics/noop_meter.hxx +14 -13
  347. data/ext/couchbase/core/mozilla_ca_bundle.hxx +2 -2
  348. data/ext/couchbase/core/n1ql_query_options.cxx +31 -31
  349. data/ext/couchbase/core/n1ql_query_options.hxx +22 -21
  350. data/ext/couchbase/core/operation_map.hxx +3 -3
  351. data/ext/couchbase/core/operations/document_analytics.cxx +187 -176
  352. data/ext/couchbase/core/operations/document_analytics.hxx +79 -71
  353. data/ext/couchbase/core/operations/document_append.cxx +18 -15
  354. data/ext/couchbase/core/operations/document_append.hxx +18 -16
  355. data/ext/couchbase/core/operations/document_decrement.cxx +26 -23
  356. data/ext/couchbase/core/operations/document_decrement.hxx +24 -20
  357. data/ext/couchbase/core/operations/document_exists.cxx +23 -21
  358. data/ext/couchbase/core/operations/document_exists.hxx +25 -23
  359. data/ext/couchbase/core/operations/document_get.cxx +17 -15
  360. data/ext/couchbase/core/operations/document_get.hxx +17 -15
  361. data/ext/couchbase/core/operations/document_get_all_replicas.hxx +121 -92
  362. data/ext/couchbase/core/operations/document_get_and_lock.cxx +19 -16
  363. data/ext/couchbase/core/operations/document_get_and_lock.hxx +21 -17
  364. data/ext/couchbase/core/operations/document_get_and_touch.cxx +19 -16
  365. data/ext/couchbase/core/operations/document_get_and_touch.hxx +22 -18
  366. data/ext/couchbase/core/operations/document_get_any_replica.hxx +111 -82
  367. data/ext/couchbase/core/operations/document_get_projected.cxx +193 -184
  368. data/ext/couchbase/core/operations/document_get_projected.hxx +25 -21
  369. data/ext/couchbase/core/operations/document_increment.cxx +26 -23
  370. data/ext/couchbase/core/operations/document_increment.hxx +24 -20
  371. data/ext/couchbase/core/operations/document_insert.cxx +23 -20
  372. data/ext/couchbase/core/operations/document_insert.hxx +20 -18
  373. data/ext/couchbase/core/operations/document_lookup_in.cxx +80 -67
  374. data/ext/couchbase/core/operations/document_lookup_in.hxx +31 -27
  375. data/ext/couchbase/core/operations/document_lookup_in_all_replicas.hxx +187 -149
  376. data/ext/couchbase/core/operations/document_lookup_in_any_replica.hxx +190 -145
  377. data/ext/couchbase/core/operations/document_mutate_in.cxx +98 -80
  378. data/ext/couchbase/core/operations/document_mutate_in.hxx +38 -33
  379. data/ext/couchbase/core/operations/document_prepend.cxx +18 -15
  380. data/ext/couchbase/core/operations/document_prepend.hxx +18 -16
  381. data/ext/couchbase/core/operations/document_query.cxx +367 -356
  382. data/ext/couchbase/core/operations/document_query.hxx +83 -79
  383. data/ext/couchbase/core/operations/document_remove.cxx +18 -15
  384. data/ext/couchbase/core/operations/document_remove.hxx +18 -16
  385. data/ext/couchbase/core/operations/document_replace.cxx +27 -24
  386. data/ext/couchbase/core/operations/document_replace.hxx +22 -20
  387. data/ext/couchbase/core/operations/document_search.cxx +322 -308
  388. data/ext/couchbase/core/operations/document_search.hxx +125 -121
  389. data/ext/couchbase/core/operations/document_touch.cxx +16 -14
  390. data/ext/couchbase/core/operations/document_touch.hxx +19 -17
  391. data/ext/couchbase/core/operations/document_unlock.cxx +16 -14
  392. data/ext/couchbase/core/operations/document_unlock.hxx +19 -17
  393. data/ext/couchbase/core/operations/document_upsert.cxx +26 -23
  394. data/ext/couchbase/core/operations/document_upsert.hxx +21 -19
  395. data/ext/couchbase/core/operations/document_view.cxx +169 -159
  396. data/ext/couchbase/core/operations/document_view.hxx +68 -65
  397. data/ext/couchbase/core/operations/http_noop.cxx +38 -35
  398. data/ext/couchbase/core/operations/http_noop.hxx +12 -10
  399. data/ext/couchbase/core/operations/management/analytics_dataset_create.cxx +58 -56
  400. data/ext/couchbase/core/operations/management/analytics_dataset_create.hxx +20 -17
  401. data/ext/couchbase/core/operations/management/analytics_dataset_drop.cxx +49 -44
  402. data/ext/couchbase/core/operations/management/analytics_dataset_drop.hxx +18 -15
  403. data/ext/couchbase/core/operations/management/analytics_dataset_get_all.cxx +46 -43
  404. data/ext/couchbase/core/operations/management/analytics_dataset_get_all.hxx +16 -13
  405. data/ext/couchbase/core/operations/management/analytics_dataverse_create.cxx +48 -43
  406. data/ext/couchbase/core/operations/management/analytics_dataverse_create.hxx +17 -14
  407. data/ext/couchbase/core/operations/management/analytics_dataverse_drop.cxx +48 -43
  408. data/ext/couchbase/core/operations/management/analytics_dataverse_drop.hxx +17 -14
  409. data/ext/couchbase/core/operations/management/analytics_get_pending_mutations.cxx +38 -35
  410. data/ext/couchbase/core/operations/management/analytics_get_pending_mutations.hxx +16 -14
  411. data/ext/couchbase/core/operations/management/analytics_index_create.cxx +68 -66
  412. data/ext/couchbase/core/operations/management/analytics_index_create.hxx +20 -17
  413. data/ext/couchbase/core/operations/management/analytics_index_drop.cxx +56 -51
  414. data/ext/couchbase/core/operations/management/analytics_index_drop.hxx +19 -16
  415. data/ext/couchbase/core/operations/management/analytics_index_get_all.cxx +44 -42
  416. data/ext/couchbase/core/operations/management/analytics_index_get_all.hxx +16 -13
  417. data/ext/couchbase/core/operations/management/analytics_link_connect.cxx +49 -43
  418. data/ext/couchbase/core/operations/management/analytics_link_connect.hxx +23 -20
  419. data/ext/couchbase/core/operations/management/analytics_link_create.cxx +52 -51
  420. data/ext/couchbase/core/operations/management/analytics_link_create.hxx +33 -30
  421. data/ext/couchbase/core/operations/management/analytics_link_disconnect.cxx +46 -42
  422. data/ext/couchbase/core/operations/management/analytics_link_disconnect.hxx +22 -19
  423. data/ext/couchbase/core/operations/management/analytics_link_drop.cxx +70 -67
  424. data/ext/couchbase/core/operations/management/analytics_link_drop.hxx +22 -19
  425. data/ext/couchbase/core/operations/management/analytics_link_get_all.cxx +92 -85
  426. data/ext/couchbase/core/operations/management/analytics_link_get_all.hxx +27 -24
  427. data/ext/couchbase/core/operations/management/analytics_link_replace.cxx +52 -51
  428. data/ext/couchbase/core/operations/management/analytics_link_replace.hxx +33 -30
  429. data/ext/couchbase/core/operations/management/analytics_link_utils.hxx +6 -4
  430. data/ext/couchbase/core/operations/management/analytics_problem.hxx +2 -2
  431. data/ext/couchbase/core/operations/management/bucket_create.cxx +158 -149
  432. data/ext/couchbase/core/operations/management/bucket_create.hxx +14 -12
  433. data/ext/couchbase/core/operations/management/bucket_describe.cxx +118 -42
  434. data/ext/couchbase/core/operations/management/bucket_describe.hxx +47 -22
  435. data/ext/couchbase/core/operations/management/bucket_drop.cxx +19 -18
  436. data/ext/couchbase/core/operations/management/bucket_drop.hxx +13 -11
  437. data/ext/couchbase/core/operations/management/bucket_flush.cxx +25 -24
  438. data/ext/couchbase/core/operations/management/bucket_flush.hxx +13 -11
  439. data/ext/couchbase/core/operations/management/bucket_get.cxx +24 -22
  440. data/ext/couchbase/core/operations/management/bucket_get.hxx +14 -12
  441. data/ext/couchbase/core/operations/management/bucket_get_all.cxx +25 -23
  442. data/ext/couchbase/core/operations/management/bucket_get_all.hxx +13 -11
  443. data/ext/couchbase/core/operations/management/bucket_update.cxx +112 -107
  444. data/ext/couchbase/core/operations/management/bucket_update.hxx +15 -13
  445. data/ext/couchbase/core/operations/management/change_password.cxx +22 -20
  446. data/ext/couchbase/core/operations/management/change_password.hxx +13 -11
  447. data/ext/couchbase/core/operations/management/cluster_describe.cxx +52 -50
  448. data/ext/couchbase/core/operations/management/cluster_describe.hxx +31 -29
  449. data/ext/couchbase/core/operations/management/cluster_developer_preview_enable.cxx +14 -12
  450. data/ext/couchbase/core/operations/management/cluster_developer_preview_enable.hxx +13 -11
  451. data/ext/couchbase/core/operations/management/collection_create.cxx +48 -46
  452. data/ext/couchbase/core/operations/management/collection_create.hxx +19 -16
  453. data/ext/couchbase/core/operations/management/collection_drop.cxx +37 -35
  454. data/ext/couchbase/core/operations/management/collection_drop.hxx +16 -14
  455. data/ext/couchbase/core/operations/management/collection_update.cxx +49 -47
  456. data/ext/couchbase/core/operations/management/collection_update.hxx +19 -16
  457. data/ext/couchbase/core/operations/management/collections_manifest_get.cxx +11 -9
  458. data/ext/couchbase/core/operations/management/collections_manifest_get.hxx +17 -13
  459. data/ext/couchbase/core/operations/management/error_utils.cxx +210 -198
  460. data/ext/couchbase/core/operations/management/error_utils.hxx +3 -1
  461. data/ext/couchbase/core/operations/management/eventing_deploy_function.cxx +30 -28
  462. data/ext/couchbase/core/operations/management/eventing_deploy_function.hxx +17 -14
  463. data/ext/couchbase/core/operations/management/eventing_drop_function.cxx +31 -29
  464. data/ext/couchbase/core/operations/management/eventing_drop_function.hxx +17 -14
  465. data/ext/couchbase/core/operations/management/eventing_get_all_functions.cxx +49 -43
  466. data/ext/couchbase/core/operations/management/eventing_get_all_functions.hxx +17 -14
  467. data/ext/couchbase/core/operations/management/eventing_get_function.cxx +29 -27
  468. data/ext/couchbase/core/operations/management/eventing_get_function.hxx +18 -15
  469. data/ext/couchbase/core/operations/management/eventing_get_status.cxx +45 -39
  470. data/ext/couchbase/core/operations/management/eventing_get_status.hxx +17 -14
  471. data/ext/couchbase/core/operations/management/eventing_pause_function.cxx +30 -28
  472. data/ext/couchbase/core/operations/management/eventing_pause_function.hxx +17 -14
  473. data/ext/couchbase/core/operations/management/eventing_problem.hxx +3 -3
  474. data/ext/couchbase/core/operations/management/eventing_resume_function.cxx +30 -28
  475. data/ext/couchbase/core/operations/management/eventing_resume_function.hxx +17 -14
  476. data/ext/couchbase/core/operations/management/eventing_undeploy_function.cxx +30 -28
  477. data/ext/couchbase/core/operations/management/eventing_undeploy_function.hxx +17 -14
  478. data/ext/couchbase/core/operations/management/eventing_upsert_function.cxx +328 -318
  479. data/ext/couchbase/core/operations/management/eventing_upsert_function.hxx +17 -14
  480. data/ext/couchbase/core/operations/management/freeform.cxx +23 -22
  481. data/ext/couchbase/core/operations/management/freeform.hxx +19 -17
  482. data/ext/couchbase/core/operations/management/group_drop.cxx +18 -17
  483. data/ext/couchbase/core/operations/management/group_drop.hxx +13 -11
  484. data/ext/couchbase/core/operations/management/group_get.cxx +25 -23
  485. data/ext/couchbase/core/operations/management/group_get.hxx +14 -12
  486. data/ext/couchbase/core/operations/management/group_get_all.cxx +23 -22
  487. data/ext/couchbase/core/operations/management/group_get_all.hxx +13 -11
  488. data/ext/couchbase/core/operations/management/group_upsert.cxx +58 -55
  489. data/ext/couchbase/core/operations/management/group_upsert.hxx +14 -12
  490. data/ext/couchbase/core/operations/management/query_index_build.cxx +53 -48
  491. data/ext/couchbase/core/operations/management/query_index_build.hxx +25 -22
  492. data/ext/couchbase/core/operations/management/query_index_build_deferred.hxx +75 -67
  493. data/ext/couchbase/core/operations/management/query_index_create.cxx +128 -122
  494. data/ext/couchbase/core/operations/management/query_index_create.hxx +31 -28
  495. data/ext/couchbase/core/operations/management/query_index_drop.cxx +95 -93
  496. data/ext/couchbase/core/operations/management/query_index_drop.hxx +26 -24
  497. data/ext/couchbase/core/operations/management/query_index_get_all.cxx +97 -93
  498. data/ext/couchbase/core/operations/management/query_index_get_all.hxx +24 -21
  499. data/ext/couchbase/core/operations/management/query_index_get_all_deferred.cxx +66 -62
  500. data/ext/couchbase/core/operations/management/query_index_get_all_deferred.hxx +24 -22
  501. data/ext/couchbase/core/operations/management/role_get_all.cxx +24 -22
  502. data/ext/couchbase/core/operations/management/role_get_all.hxx +13 -11
  503. data/ext/couchbase/core/operations/management/scope_create.cxx +38 -36
  504. data/ext/couchbase/core/operations/management/scope_create.hxx +15 -13
  505. data/ext/couchbase/core/operations/management/scope_drop.cxx +33 -32
  506. data/ext/couchbase/core/operations/management/scope_drop.hxx +15 -13
  507. data/ext/couchbase/core/operations/management/scope_get_all.cxx +27 -25
  508. data/ext/couchbase/core/operations/management/scope_get_all.hxx +14 -12
  509. data/ext/couchbase/core/operations/management/search_get_stats.cxx +12 -10
  510. data/ext/couchbase/core/operations/management/search_get_stats.hxx +13 -11
  511. data/ext/couchbase/core/operations/management/search_index_analyze_document.cxx +72 -67
  512. data/ext/couchbase/core/operations/management/search_index_analyze_document.hxx +20 -18
  513. data/ext/couchbase/core/operations/management/search_index_control_ingest.cxx +62 -59
  514. data/ext/couchbase/core/operations/management/search_index_control_ingest.hxx +19 -16
  515. data/ext/couchbase/core/operations/management/search_index_control_plan_freeze.cxx +62 -59
  516. data/ext/couchbase/core/operations/management/search_index_control_plan_freeze.hxx +19 -17
  517. data/ext/couchbase/core/operations/management/search_index_control_query.cxx +62 -59
  518. data/ext/couchbase/core/operations/management/search_index_control_query.hxx +19 -16
  519. data/ext/couchbase/core/operations/management/search_index_drop.cxx +58 -55
  520. data/ext/couchbase/core/operations/management/search_index_drop.hxx +18 -15
  521. data/ext/couchbase/core/operations/management/search_index_get.cxx +59 -56
  522. data/ext/couchbase/core/operations/management/search_index_get.hxx +18 -16
  523. data/ext/couchbase/core/operations/management/search_index_get_all.cxx +51 -46
  524. data/ext/couchbase/core/operations/management/search_index_get_all.hxx +18 -15
  525. data/ext/couchbase/core/operations/management/search_index_get_documents_count.cxx +66 -61
  526. data/ext/couchbase/core/operations/management/search_index_get_documents_count.hxx +19 -17
  527. data/ext/couchbase/core/operations/management/search_index_get_stats.cxx +38 -36
  528. data/ext/couchbase/core/operations/management/search_index_get_stats.hxx +17 -14
  529. data/ext/couchbase/core/operations/management/search_index_upsert.cxx +98 -95
  530. data/ext/couchbase/core/operations/management/search_index_upsert.hxx +20 -17
  531. data/ext/couchbase/core/operations/management/user_drop.cxx +18 -17
  532. data/ext/couchbase/core/operations/management/user_drop.hxx +16 -12
  533. data/ext/couchbase/core/operations/management/user_get.cxx +25 -23
  534. data/ext/couchbase/core/operations/management/user_get.hxx +17 -13
  535. data/ext/couchbase/core/operations/management/user_get_all.cxx +24 -22
  536. data/ext/couchbase/core/operations/management/user_get_all.hxx +16 -12
  537. data/ext/couchbase/core/operations/management/user_upsert.cxx +63 -60
  538. data/ext/couchbase/core/operations/management/user_upsert.hxx +17 -13
  539. data/ext/couchbase/core/operations/management/view_index_drop.cxx +16 -12
  540. data/ext/couchbase/core/operations/management/view_index_drop.hxx +15 -13
  541. data/ext/couchbase/core/operations/management/view_index_get.cxx +40 -35
  542. data/ext/couchbase/core/operations/management/view_index_get.hxx +16 -14
  543. data/ext/couchbase/core/operations/management/view_index_get_all.cxx +73 -69
  544. data/ext/couchbase/core/operations/management/view_index_get_all.hxx +16 -13
  545. data/ext/couchbase/core/operations/management/view_index_upsert.cxx +39 -35
  546. data/ext/couchbase/core/operations/management/view_index_upsert.hxx +15 -12
  547. data/ext/couchbase/core/origin.cxx +259 -249
  548. data/ext/couchbase/core/origin.hxx +55 -49
  549. data/ext/couchbase/core/pending_operation.hxx +3 -3
  550. data/ext/couchbase/core/ping_collector.hxx +3 -3
  551. data/ext/couchbase/core/ping_options.hxx +30 -30
  552. data/ext/couchbase/core/ping_reporter.hxx +3 -3
  553. data/ext/couchbase/core/platform/backtrace.c +100 -91
  554. data/ext/couchbase/core/platform/base64.cc +135 -134
  555. data/ext/couchbase/core/platform/dirutils.cc +66 -63
  556. data/ext/couchbase/core/platform/random.cc +43 -42
  557. data/ext/couchbase/core/platform/random.h +4 -4
  558. data/ext/couchbase/core/platform/string_hex.cc +42 -40
  559. data/ext/couchbase/core/platform/terminate_handler.cc +54 -52
  560. data/ext/couchbase/core/platform/uuid.cc +47 -47
  561. data/ext/couchbase/core/protocol/client_opcode.hxx +336 -327
  562. data/ext/couchbase/core/protocol/client_opcode_fmt.hxx +291 -291
  563. data/ext/couchbase/core/protocol/client_request.cxx +13 -10
  564. data/ext/couchbase/core/protocol/client_request.hxx +133 -130
  565. data/ext/couchbase/core/protocol/client_response.cxx +40 -40
  566. data/ext/couchbase/core/protocol/client_response.hxx +153 -150
  567. data/ext/couchbase/core/protocol/cmd_append.cxx +24 -23
  568. data/ext/couchbase/core/protocol/cmd_append.hxx +65 -65
  569. data/ext/couchbase/core/protocol/cmd_cluster_map_change_notification.cxx +25 -21
  570. data/ext/couchbase/core/protocol/cmd_cluster_map_change_notification.hxx +33 -25
  571. data/ext/couchbase/core/protocol/cmd_decrement.cxx +38 -38
  572. data/ext/couchbase/core/protocol/cmd_decrement.hxx +87 -87
  573. data/ext/couchbase/core/protocol/cmd_get.cxx +17 -17
  574. data/ext/couchbase/core/protocol/cmd_get.hxx +59 -59
  575. data/ext/couchbase/core/protocol/cmd_get_and_lock.cxx +20 -20
  576. data/ext/couchbase/core/protocol/cmd_get_and_lock.hxx +72 -72
  577. data/ext/couchbase/core/protocol/cmd_get_and_touch.cxx +20 -20
  578. data/ext/couchbase/core/protocol/cmd_get_and_touch.hxx +72 -72
  579. data/ext/couchbase/core/protocol/cmd_get_cluster_config.cxx +46 -39
  580. data/ext/couchbase/core/protocol/cmd_get_cluster_config.hxx +57 -49
  581. data/ext/couchbase/core/protocol/cmd_get_collection_id.cxx +17 -17
  582. data/ext/couchbase/core/protocol/cmd_get_collection_id.hxx +59 -59
  583. data/ext/couchbase/core/protocol/cmd_get_collections_manifest.cxx +16 -14
  584. data/ext/couchbase/core/protocol/cmd_get_collections_manifest.hxx +39 -39
  585. data/ext/couchbase/core/protocol/cmd_get_error_map.cxx +18 -17
  586. data/ext/couchbase/core/protocol/cmd_get_error_map.hxx +62 -62
  587. data/ext/couchbase/core/protocol/cmd_get_meta.cxx +24 -23
  588. data/ext/couchbase/core/protocol/cmd_get_meta.hxx +81 -79
  589. data/ext/couchbase/core/protocol/cmd_get_replica.cxx +23 -23
  590. data/ext/couchbase/core/protocol/cmd_get_replica.hxx +44 -44
  591. data/ext/couchbase/core/protocol/cmd_hello.cxx +28 -27
  592. data/ext/couchbase/core/protocol/cmd_hello.hxx +106 -105
  593. data/ext/couchbase/core/protocol/cmd_increment.cxx +38 -38
  594. data/ext/couchbase/core/protocol/cmd_increment.hxx +87 -87
  595. data/ext/couchbase/core/protocol/cmd_info.hxx +3 -3
  596. data/ext/couchbase/core/protocol/cmd_insert.cxx +27 -27
  597. data/ext/couchbase/core/protocol/cmd_insert.hxx +81 -81
  598. data/ext/couchbase/core/protocol/cmd_lookup_in.cxx +54 -51
  599. data/ext/couchbase/core/protocol/cmd_lookup_in.hxx +90 -90
  600. data/ext/couchbase/core/protocol/cmd_lookup_in_replica.cxx +54 -51
  601. data/ext/couchbase/core/protocol/cmd_lookup_in_replica.hxx +88 -88
  602. data/ext/couchbase/core/protocol/cmd_mutate_in.cxx +105 -97
  603. data/ext/couchbase/core/protocol/cmd_mutate_in.hxx +161 -153
  604. data/ext/couchbase/core/protocol/cmd_noop.cxx +4 -4
  605. data/ext/couchbase/core/protocol/cmd_noop.hxx +32 -32
  606. data/ext/couchbase/core/protocol/cmd_observe_seqno.cxx +36 -34
  607. data/ext/couchbase/core/protocol/cmd_observe_seqno.hxx +89 -89
  608. data/ext/couchbase/core/protocol/cmd_prepend.cxx +22 -22
  609. data/ext/couchbase/core/protocol/cmd_prepend.hxx +63 -63
  610. data/ext/couchbase/core/protocol/cmd_remove.cxx +23 -23
  611. data/ext/couchbase/core/protocol/cmd_remove.hxx +54 -54
  612. data/ext/couchbase/core/protocol/cmd_replace.cxx +28 -28
  613. data/ext/couchbase/core/protocol/cmd_replace.hxx +88 -88
  614. data/ext/couchbase/core/protocol/cmd_sasl_auth.cxx +17 -15
  615. data/ext/couchbase/core/protocol/cmd_sasl_auth.hxx +56 -56
  616. data/ext/couchbase/core/protocol/cmd_sasl_list_mechs.cxx +24 -19
  617. data/ext/couchbase/core/protocol/cmd_sasl_list_mechs.hxx +39 -39
  618. data/ext/couchbase/core/protocol/cmd_sasl_step.cxx +17 -15
  619. data/ext/couchbase/core/protocol/cmd_sasl_step.hxx +56 -56
  620. data/ext/couchbase/core/protocol/cmd_select_bucket.cxx +6 -6
  621. data/ext/couchbase/core/protocol/cmd_select_bucket.hxx +36 -36
  622. data/ext/couchbase/core/protocol/cmd_touch.cxx +8 -8
  623. data/ext/couchbase/core/protocol/cmd_touch.hxx +38 -38
  624. data/ext/couchbase/core/protocol/cmd_unlock.cxx +5 -5
  625. data/ext/couchbase/core/protocol/cmd_unlock.hxx +36 -36
  626. data/ext/couchbase/core/protocol/cmd_upsert.cxx +28 -28
  627. data/ext/couchbase/core/protocol/cmd_upsert.hxx +83 -83
  628. data/ext/couchbase/core/protocol/datatype.hxx +19 -18
  629. data/ext/couchbase/core/protocol/frame_info_id.hxx +108 -103
  630. data/ext/couchbase/core/protocol/frame_info_id_fmt.hxx +45 -45
  631. data/ext/couchbase/core/protocol/frame_info_utils.cxx +24 -21
  632. data/ext/couchbase/core/protocol/frame_info_utils.hxx +3 -1
  633. data/ext/couchbase/core/protocol/hello_feature.hxx +211 -175
  634. data/ext/couchbase/core/protocol/hello_feature_fmt.hxx +93 -90
  635. data/ext/couchbase/core/protocol/magic.hxx +24 -24
  636. data/ext/couchbase/core/protocol/magic_fmt.hxx +30 -30
  637. data/ext/couchbase/core/protocol/server_opcode.hxx +11 -11
  638. data/ext/couchbase/core/protocol/server_opcode_fmt.hxx +18 -18
  639. data/ext/couchbase/core/protocol/server_request.hxx +90 -86
  640. data/ext/couchbase/core/protocol/status.cxx +138 -138
  641. data/ext/couchbase/core/protocol/status.hxx +86 -86
  642. data/ext/couchbase/core/query_context.hxx +44 -43
  643. data/ext/couchbase/core/range_scan_load_balancer.cxx +51 -50
  644. data/ext/couchbase/core/range_scan_load_balancer.hxx +26 -25
  645. data/ext/couchbase/core/range_scan_options.cxx +2 -2
  646. data/ext/couchbase/core/range_scan_options.hxx +62 -59
  647. data/ext/couchbase/core/range_scan_orchestrator.cxx +515 -470
  648. data/ext/couchbase/core/range_scan_orchestrator.hxx +23 -18
  649. data/ext/couchbase/core/range_scan_orchestrator_options.hxx +10 -10
  650. data/ext/couchbase/core/resource_units.hxx +2 -2
  651. data/ext/couchbase/core/response_handler.hxx +8 -8
  652. data/ext/couchbase/core/retry_orchestrator.cxx +27 -19
  653. data/ext/couchbase/core/retry_orchestrator.hxx +3 -2
  654. data/ext/couchbase/core/sasl/client.cc +22 -18
  655. data/ext/couchbase/core/sasl/client.h +66 -62
  656. data/ext/couchbase/core/sasl/context.cc +4 -4
  657. data/ext/couchbase/core/sasl/context.h +19 -19
  658. data/ext/couchbase/core/sasl/error.h +12 -1
  659. data/ext/couchbase/core/sasl/error_fmt.h +42 -42
  660. data/ext/couchbase/core/sasl/mechanism.cc +13 -10
  661. data/ext/couchbase/core/sasl/mechanism.h +8 -3
  662. data/ext/couchbase/core/sasl/plain/plain.cc +8 -8
  663. data/ext/couchbase/core/sasl/plain/plain.h +25 -24
  664. data/ext/couchbase/core/sasl/scram-sha/scram-sha.cc +225 -218
  665. data/ext/couchbase/core/sasl/scram-sha/scram-sha.h +133 -115
  666. data/ext/couchbase/core/sasl/scram-sha/stringutils.cc +20 -20
  667. data/ext/couchbase/core/scan_result.cxx +38 -38
  668. data/ext/couchbase/core/scan_result.hxx +16 -16
  669. data/ext/couchbase/core/search_highlight_style.hxx +4 -1
  670. data/ext/couchbase/core/search_query_options.cxx +21 -21
  671. data/ext/couchbase/core/search_query_options.hxx +19 -18
  672. data/ext/couchbase/core/search_scan_consistency.hxx +3 -1
  673. data/ext/couchbase/core/seed_config.cxx +10 -7
  674. data/ext/couchbase/core/seed_config.hxx +8 -8
  675. data/ext/couchbase/core/service_type.hxx +7 -7
  676. data/ext/couchbase/core/service_type_fmt.hxx +33 -33
  677. data/ext/couchbase/core/stats_options.hxx +13 -13
  678. data/ext/couchbase/core/subdoc_options.hxx +60 -58
  679. data/ext/couchbase/core/tls_verify_mode.hxx +2 -2
  680. data/ext/couchbase/core/topology/capabilities.hxx +83 -83
  681. data/ext/couchbase/core/topology/capabilities_fmt.hxx +111 -111
  682. data/ext/couchbase/core/topology/collections_manifest.hxx +14 -14
  683. data/ext/couchbase/core/topology/collections_manifest_fmt.hxx +23 -21
  684. data/ext/couchbase/core/topology/collections_manifest_json.hxx +26 -25
  685. data/ext/couchbase/core/topology/configuration.cxx +213 -192
  686. data/ext/couchbase/core/topology/configuration.hxx +104 -91
  687. data/ext/couchbase/core/topology/configuration_fmt.hxx +131 -128
  688. data/ext/couchbase/core/topology/configuration_json.hxx +276 -242
  689. data/ext/couchbase/core/topology/error_map.hxx +5 -5
  690. data/ext/couchbase/core/topology/error_map_json.hxx +65 -60
  691. data/ext/couchbase/core/tracing/constants.hxx +153 -153
  692. data/ext/couchbase/core/tracing/noop_tracer.hxx +29 -28
  693. data/ext/couchbase/core/tracing/threshold_logging_options.hxx +30 -30
  694. data/ext/couchbase/core/tracing/threshold_logging_tracer.cxx +354 -344
  695. data/ext/couchbase/core/tracing/threshold_logging_tracer.hxx +12 -12
  696. data/ext/couchbase/core/transactions/active_transaction_record.cxx +153 -33
  697. data/ext/couchbase/core/transactions/active_transaction_record.hxx +30 -118
  698. data/ext/couchbase/core/transactions/async_attempt_context.cxx +8 -2
  699. data/ext/couchbase/core/transactions/async_attempt_context.hxx +163 -127
  700. data/ext/couchbase/core/transactions/atr_cleanup_entry.cxx +358 -334
  701. data/ext/couchbase/core/transactions/atr_ids.cxx +270 -185
  702. data/ext/couchbase/core/transactions/atr_ids.hxx +4 -4
  703. data/ext/couchbase/core/transactions/attempt_context.cxx +9 -5
  704. data/ext/couchbase/core/transactions/attempt_context.hxx +194 -154
  705. data/ext/couchbase/core/transactions/attempt_context_impl.cxx +3278 -2159
  706. data/ext/couchbase/core/transactions/attempt_context_impl.hxx +446 -573
  707. data/ext/couchbase/core/transactions/attempt_context_testing_hooks.cxx +15 -10
  708. data/ext/couchbase/core/transactions/attempt_context_testing_hooks.hxx +58 -49
  709. data/ext/couchbase/core/transactions/attempt_state.hxx +72 -72
  710. data/ext/couchbase/core/transactions/binary.cxx +3 -3
  711. data/ext/couchbase/core/transactions/cleanup_testing_hooks.cxx +2 -2
  712. data/ext/couchbase/core/transactions/cleanup_testing_hooks.hxx +28 -24
  713. data/ext/couchbase/core/transactions/document_metadata.hxx +68 -68
  714. data/ext/couchbase/core/transactions/durability_level.hxx +53 -53
  715. data/ext/couchbase/core/transactions/error_class.hxx +12 -12
  716. data/ext/couchbase/core/transactions/error_list.hxx +22 -22
  717. data/ext/couchbase/core/transactions/exceptions.cxx +167 -114
  718. data/ext/couchbase/core/transactions/exceptions.hxx +170 -139
  719. data/ext/couchbase/core/transactions/exceptions_fmt.hxx +105 -0
  720. data/ext/couchbase/core/transactions/forward_compat.cxx +220 -0
  721. data/ext/couchbase/core/transactions/forward_compat.hxx +63 -207
  722. data/ext/couchbase/core/transactions/internal/atr_cleanup_entry.hxx +110 -102
  723. data/ext/couchbase/core/transactions/internal/atr_entry.hxx +144 -144
  724. data/ext/couchbase/core/transactions/internal/client_record.hxx +53 -50
  725. data/ext/couchbase/core/transactions/internal/doc_record.cxx +5 -5
  726. data/ext/couchbase/core/transactions/internal/doc_record.hxx +38 -35
  727. data/ext/couchbase/core/transactions/internal/doc_record_fmt.hxx +17 -16
  728. data/ext/couchbase/core/transactions/internal/exceptions_internal.hxx +238 -281
  729. data/ext/couchbase/core/transactions/internal/exceptions_internal_fmt.hxx +103 -0
  730. data/ext/couchbase/core/transactions/internal/logging.hxx +52 -29
  731. data/ext/couchbase/core/transactions/internal/transaction_attempt.hxx +3 -3
  732. data/ext/couchbase/core/transactions/internal/transaction_context.hxx +136 -120
  733. data/ext/couchbase/core/transactions/internal/transaction_fields.hxx +2 -1
  734. data/ext/couchbase/core/transactions/internal/transactions_cleanup.hxx +127 -122
  735. data/ext/couchbase/core/transactions/internal/utils.hxx +244 -219
  736. data/ext/couchbase/core/transactions/result.cxx +41 -40
  737. data/ext/couchbase/core/transactions/result.hxx +143 -141
  738. data/ext/couchbase/core/transactions/result_fmt.hxx +21 -20
  739. data/ext/couchbase/core/transactions/staged_mutation.cxx +759 -627
  740. data/ext/couchbase/core/transactions/staged_mutation.hxx +175 -156
  741. data/ext/couchbase/core/transactions/transaction_context.cxx +231 -179
  742. data/ext/couchbase/core/transactions/transaction_get_result.cxx +185 -198
  743. data/ext/couchbase/core/transactions/transaction_get_result.hxx +207 -222
  744. data/ext/couchbase/core/transactions/transaction_keyspace.cxx +15 -11
  745. data/ext/couchbase/core/transactions/transaction_links.cxx +11 -7
  746. data/ext/couchbase/core/transactions/transaction_links.hxx +222 -201
  747. data/ext/couchbase/core/transactions/transaction_options.cxx +44 -41
  748. data/ext/couchbase/core/transactions/transactions.cxx +167 -125
  749. data/ext/couchbase/core/transactions/transactions_cleanup.cxx +491 -424
  750. data/ext/couchbase/core/transactions/transactions_config.cxx +25 -19
  751. data/ext/couchbase/core/transactions/uid_generator.cxx +3 -3
  752. data/ext/couchbase/core/transactions/uid_generator.hxx +2 -2
  753. data/ext/couchbase/core/transactions/utils.cxx +82 -69
  754. data/ext/couchbase/core/transactions/waitable_op_list.hxx +154 -140
  755. data/ext/couchbase/core/transactions.hxx +184 -180
  756. data/ext/couchbase/core/utils/binary.cxx +3 -3
  757. data/ext/couchbase/core/utils/binary.hxx +19 -15
  758. data/ext/couchbase/core/utils/byteswap.hxx +17 -17
  759. data/ext/couchbase/core/utils/connection_string.cxx +395 -328
  760. data/ext/couchbase/core/utils/connection_string.hxx +37 -36
  761. data/ext/couchbase/core/utils/crc32.hxx +42 -34
  762. data/ext/couchbase/core/utils/duration_parser.cxx +142 -133
  763. data/ext/couchbase/core/utils/duration_parser.hxx +9 -9
  764. data/ext/couchbase/core/utils/join_strings.hxx +24 -24
  765. data/ext/couchbase/core/utils/json.cxx +234 -228
  766. data/ext/couchbase/core/utils/json.hxx +12 -12
  767. data/ext/couchbase/core/utils/json_stream_control.hxx +8 -8
  768. data/ext/couchbase/core/utils/json_streaming_lexer.cxx +288 -263
  769. data/ext/couchbase/core/utils/json_streaming_lexer.hxx +20 -17
  770. data/ext/couchbase/core/utils/keyspace.hxx +22 -21
  771. data/ext/couchbase/core/utils/movable_function.hxx +78 -76
  772. data/ext/couchbase/core/utils/mutation_token.cxx +7 -3
  773. data/ext/couchbase/core/utils/mutation_token.hxx +3 -1
  774. data/ext/couchbase/core/utils/name_codec.hxx +13 -13
  775. data/ext/couchbase/core/utils/split_string.cxx +9 -9
  776. data/ext/couchbase/core/utils/split_string.hxx +2 -2
  777. data/ext/couchbase/core/utils/unsigned_leb128.hxx +92 -88
  778. data/ext/couchbase/core/utils/url_codec.cxx +301 -297
  779. data/ext/couchbase/core/utils/url_codec.hxx +35 -35
  780. data/ext/couchbase/core/vector_query_combination.hxx +4 -1
  781. data/ext/couchbase/core/view_on_error.hxx +4 -3
  782. data/ext/couchbase/core/view_query_options.cxx +21 -21
  783. data/ext/couchbase/core/view_query_options.hxx +23 -22
  784. data/ext/couchbase/core/view_scan_consistency.hxx +3 -3
  785. data/ext/couchbase/core/view_sort_order.hxx +4 -1
  786. data/ext/couchbase/core/wait_until_ready_options.hxx +11 -10
  787. data/ext/couchbase/couchbase/allow_querying_search_index_options.hxx +11 -11
  788. data/ext/couchbase/couchbase/analytics_index_manager.hxx +423 -405
  789. data/ext/couchbase/couchbase/analytics_meta_data.hxx +105 -105
  790. data/ext/couchbase/couchbase/analytics_metrics.hxx +120 -118
  791. data/ext/couchbase/couchbase/analytics_options.hxx +318 -292
  792. data/ext/couchbase/couchbase/analytics_result.hxx +56 -55
  793. data/ext/couchbase/couchbase/analytics_scan_consistency.hxx +24 -21
  794. data/ext/couchbase/couchbase/analytics_status.hxx +10 -10
  795. data/ext/couchbase/couchbase/analytics_warning.hxx +44 -43
  796. data/ext/couchbase/couchbase/analyze_document_options.hxx +9 -9
  797. data/ext/couchbase/couchbase/append_options.hxx +51 -47
  798. data/ext/couchbase/couchbase/behavior_options.hxx +75 -69
  799. data/ext/couchbase/couchbase/best_effort_retry_strategy.hxx +12 -10
  800. data/ext/couchbase/couchbase/binary_collection.hxx +213 -183
  801. data/ext/couchbase/couchbase/boolean_field_query.hxx +38 -38
  802. data/ext/couchbase/couchbase/boolean_query.hxx +166 -157
  803. data/ext/couchbase/couchbase/bucket.hxx +69 -68
  804. data/ext/couchbase/couchbase/bucket_manager.hxx +97 -88
  805. data/ext/couchbase/couchbase/build_query_index_options.hxx +22 -21
  806. data/ext/couchbase/couchbase/cas.hxx +74 -73
  807. data/ext/couchbase/couchbase/certificate_authenticator.hxx +10 -10
  808. data/ext/couchbase/couchbase/cluster.hxx +266 -310
  809. data/ext/couchbase/couchbase/cluster_options.hxx +235 -241
  810. data/ext/couchbase/couchbase/codec/binary_noop_serializer.hxx +11 -11
  811. data/ext/couchbase/couchbase/codec/codec_flags.hxx +39 -35
  812. data/ext/couchbase/couchbase/codec/encoded_value.hxx +15 -2
  813. data/ext/couchbase/couchbase/codec/json_transcoder.hxx +17 -15
  814. data/ext/couchbase/couchbase/codec/raw_binary_transcoder.hxx +19 -17
  815. data/ext/couchbase/couchbase/codec/raw_json_transcoder.hxx +31 -24
  816. data/ext/couchbase/couchbase/codec/raw_string_transcoder.hxx +20 -18
  817. data/ext/couchbase/couchbase/codec/tao_json_serializer.hxx +38 -30
  818. data/ext/couchbase/couchbase/collection.hxx +1007 -902
  819. data/ext/couchbase/couchbase/collection_manager.hxx +115 -107
  820. data/ext/couchbase/couchbase/collection_query_index_manager.hxx +200 -188
  821. data/ext/couchbase/couchbase/common_durability_options.hxx +68 -62
  822. data/ext/couchbase/couchbase/common_options.hxx +67 -67
  823. data/ext/couchbase/couchbase/compression_options.hxx +33 -33
  824. data/ext/couchbase/couchbase/configuration_profile.hxx +12 -11
  825. data/ext/couchbase/couchbase/configuration_profiles_registry.hxx +24 -22
  826. data/ext/couchbase/couchbase/conjunction_query.hxx +47 -45
  827. data/ext/couchbase/couchbase/connect_link_analytics_options.hxx +74 -72
  828. data/ext/couchbase/couchbase/counter_result.hxx +32 -32
  829. data/ext/couchbase/couchbase/create_bucket_options.hxx +9 -10
  830. data/ext/couchbase/couchbase/create_collection_options.hxx +35 -34
  831. data/ext/couchbase/couchbase/create_dataset_analytics_options.hxx +76 -76
  832. data/ext/couchbase/couchbase/create_dataverse_analytics_options.hxx +44 -44
  833. data/ext/couchbase/couchbase/create_index_analytics_options.hxx +60 -60
  834. data/ext/couchbase/couchbase/create_link_analytics_options.hxx +25 -25
  835. data/ext/couchbase/couchbase/create_primary_query_index_options.hxx +95 -94
  836. data/ext/couchbase/couchbase/create_query_index_options.hxx +97 -96
  837. data/ext/couchbase/couchbase/create_scope_options.hxx +9 -9
  838. data/ext/couchbase/couchbase/date_range.hxx +29 -27
  839. data/ext/couchbase/couchbase/date_range_facet.hxx +20 -20
  840. data/ext/couchbase/couchbase/date_range_facet_result.hxx +14 -14
  841. data/ext/couchbase/couchbase/date_range_query.hxx +219 -205
  842. data/ext/couchbase/couchbase/decrement_options.hxx +93 -91
  843. data/ext/couchbase/couchbase/diagnostics_options.hxx +42 -41
  844. data/ext/couchbase/couchbase/diagnostics_result.hxx +82 -83
  845. data/ext/couchbase/couchbase/disallow_querying_search_index_options.hxx +11 -10
  846. data/ext/couchbase/couchbase/disconnect_link_analytics_options.hxx +62 -62
  847. data/ext/couchbase/couchbase/disjunction_query.hxx +61 -60
  848. data/ext/couchbase/couchbase/dns_options.hxx +30 -30
  849. data/ext/couchbase/couchbase/doc_id_query.hxx +69 -69
  850. data/ext/couchbase/couchbase/drop_bucket_options.hxx +9 -9
  851. data/ext/couchbase/couchbase/drop_collection_options.hxx +9 -9
  852. data/ext/couchbase/couchbase/drop_dataset_analytics_options.hxx +60 -60
  853. data/ext/couchbase/couchbase/drop_dataverse_analytics_options.hxx +44 -44
  854. data/ext/couchbase/couchbase/drop_index_analytics_options.hxx +60 -60
  855. data/ext/couchbase/couchbase/drop_link_analytics_options.hxx +25 -25
  856. data/ext/couchbase/couchbase/drop_primary_query_index_options.hxx +58 -58
  857. data/ext/couchbase/couchbase/drop_query_index_options.hxx +44 -44
  858. data/ext/couchbase/couchbase/drop_scope_options.hxx +9 -9
  859. data/ext/couchbase/couchbase/drop_search_index_options.hxx +9 -9
  860. data/ext/couchbase/couchbase/durability_level.hxx +32 -29
  861. data/ext/couchbase/couchbase/endpoint_diagnostics.hxx +171 -171
  862. data/ext/couchbase/couchbase/endpoint_ping_report.hxx +166 -169
  863. data/ext/couchbase/couchbase/error.hxx +51 -0
  864. data/ext/couchbase/couchbase/error_codes.hxx +975 -940
  865. data/ext/couchbase/couchbase/error_context.hxx +19 -152
  866. data/ext/couchbase/couchbase/exists_options.hxx +25 -24
  867. data/ext/couchbase/couchbase/exists_result.hxx +32 -32
  868. data/ext/couchbase/couchbase/fail_fast_retry_strategy.hxx +4 -4
  869. data/ext/couchbase/couchbase/flush_bucket_options.hxx +9 -9
  870. data/ext/couchbase/couchbase/fmt/analytics_scan_consistency.hxx +18 -18
  871. data/ext/couchbase/couchbase/fmt/analytics_status.hxx +42 -42
  872. data/ext/couchbase/couchbase/fmt/cas.hxx +10 -10
  873. data/ext/couchbase/couchbase/fmt/durability_level.hxx +24 -24
  874. data/ext/couchbase/couchbase/fmt/error.hxx +53 -0
  875. data/ext/couchbase/couchbase/fmt/error_context.hxx +43 -0
  876. data/ext/couchbase/couchbase/fmt/mutation_token.hxx +15 -11
  877. data/ext/couchbase/couchbase/fmt/query_profile.hxx +21 -21
  878. data/ext/couchbase/couchbase/fmt/query_scan_consistency.hxx +18 -18
  879. data/ext/couchbase/couchbase/fmt/query_status.hxx +42 -42
  880. data/ext/couchbase/couchbase/fmt/retry_reason.hxx +75 -75
  881. data/ext/couchbase/couchbase/fmt/search_scan_consistency.hxx +15 -15
  882. data/ext/couchbase/couchbase/fmt/tls_verify_mode.hxx +18 -18
  883. data/ext/couchbase/couchbase/fmt/transaction_keyspace.hxx +15 -11
  884. data/ext/couchbase/couchbase/fork_event.hxx +12 -12
  885. data/ext/couchbase/couchbase/freeze_plan_search_index_options.hxx +9 -9
  886. data/ext/couchbase/couchbase/geo_bounding_box_query.hxx +71 -64
  887. data/ext/couchbase/couchbase/geo_distance_query.hxx +73 -66
  888. data/ext/couchbase/couchbase/geo_point.hxx +2 -2
  889. data/ext/couchbase/couchbase/geo_polygon_query.hxx +40 -39
  890. data/ext/couchbase/couchbase/get_all_buckets_options.hxx +9 -9
  891. data/ext/couchbase/couchbase/get_all_datasets_analytics_options.hxx +25 -25
  892. data/ext/couchbase/couchbase/get_all_indexes_analytics_options.hxx +26 -25
  893. data/ext/couchbase/couchbase/get_all_query_indexes_options.hxx +27 -25
  894. data/ext/couchbase/couchbase/get_all_replicas_options.hxx +49 -26
  895. data/ext/couchbase/couchbase/get_all_scopes_options.hxx +9 -9
  896. data/ext/couchbase/couchbase/get_all_search_indexes_options.hxx +9 -9
  897. data/ext/couchbase/couchbase/get_and_lock_options.hxx +25 -24
  898. data/ext/couchbase/couchbase/get_and_touch_options.hxx +25 -24
  899. data/ext/couchbase/couchbase/get_any_replica_options.hxx +49 -26
  900. data/ext/couchbase/couchbase/get_bucket_options.hxx +9 -9
  901. data/ext/couchbase/couchbase/get_indexed_search_index_options.hxx +9 -9
  902. data/ext/couchbase/couchbase/get_links_analytics_options.hxx +74 -74
  903. data/ext/couchbase/couchbase/get_options.hxx +63 -60
  904. data/ext/couchbase/couchbase/get_pending_mutations_analytics_options.hxx +30 -28
  905. data/ext/couchbase/couchbase/get_replica_result.hxx +79 -75
  906. data/ext/couchbase/couchbase/get_result.hxx +86 -80
  907. data/ext/couchbase/couchbase/get_search_index_options.hxx +9 -9
  908. data/ext/couchbase/couchbase/highlight_style.hxx +14 -14
  909. data/ext/couchbase/couchbase/increment_options.hxx +94 -91
  910. data/ext/couchbase/couchbase/insert_options.hxx +62 -59
  911. data/ext/couchbase/couchbase/ip_protocol.hxx +3 -3
  912. data/ext/couchbase/couchbase/logger.hxx +51 -0
  913. data/ext/couchbase/couchbase/lookup_in_all_replicas_options.hxx +54 -43
  914. data/ext/couchbase/couchbase/lookup_in_any_replica_options.hxx +54 -44
  915. data/ext/couchbase/couchbase/lookup_in_options.hxx +40 -40
  916. data/ext/couchbase/couchbase/lookup_in_replica_result.hxx +38 -35
  917. data/ext/couchbase/couchbase/lookup_in_result.hxx +222 -216
  918. data/ext/couchbase/couchbase/lookup_in_specs.hxx +101 -101
  919. data/ext/couchbase/couchbase/management/analytics_dataset.hxx +16 -16
  920. data/ext/couchbase/couchbase/management/analytics_index.hxx +16 -16
  921. data/ext/couchbase/couchbase/management/analytics_link.hxx +193 -189
  922. data/ext/couchbase/couchbase/management/bucket_settings.hxx +91 -75
  923. data/ext/couchbase/couchbase/management/collection_spec.hxx +4 -4
  924. data/ext/couchbase/couchbase/management/query_index.hxx +10 -10
  925. data/ext/couchbase/couchbase/management/scope_spec.hxx +2 -2
  926. data/ext/couchbase/couchbase/management/search_index.hxx +9 -9
  927. data/ext/couchbase/couchbase/match_all_query.hxx +10 -9
  928. data/ext/couchbase/couchbase/match_none_query.hxx +10 -9
  929. data/ext/couchbase/couchbase/match_operator.hxx +15 -14
  930. data/ext/couchbase/couchbase/match_phrase_query.hxx +70 -65
  931. data/ext/couchbase/couchbase/match_query.hxx +115 -114
  932. data/ext/couchbase/couchbase/metrics/meter.hxx +33 -30
  933. data/ext/couchbase/couchbase/metrics/otel_meter.hxx +86 -74
  934. data/ext/couchbase/couchbase/metrics_options.hxx +34 -34
  935. data/ext/couchbase/couchbase/mutate_in_options.hxx +160 -149
  936. data/ext/couchbase/couchbase/mutate_in_result.hxx +130 -123
  937. data/ext/couchbase/couchbase/mutate_in_specs.hxx +473 -454
  938. data/ext/couchbase/couchbase/mutation_result.hxx +32 -32
  939. data/ext/couchbase/couchbase/mutation_state.hxx +35 -34
  940. data/ext/couchbase/couchbase/mutation_token.hxx +78 -78
  941. data/ext/couchbase/couchbase/network_options.hxx +101 -72
  942. data/ext/couchbase/couchbase/numeric_range.hxx +26 -26
  943. data/ext/couchbase/couchbase/numeric_range_facet.hxx +20 -20
  944. data/ext/couchbase/couchbase/numeric_range_facet_result.hxx +14 -14
  945. data/ext/couchbase/couchbase/numeric_range_query.hxx +97 -95
  946. data/ext/couchbase/couchbase/password_authenticator.hxx +17 -17
  947. data/ext/couchbase/couchbase/pause_ingest_search_index_options.hxx +11 -10
  948. data/ext/couchbase/couchbase/persist_to.hxx +45 -44
  949. data/ext/couchbase/couchbase/phrase_query.hxx +69 -65
  950. data/ext/couchbase/couchbase/ping_options.hxx +55 -54
  951. data/ext/couchbase/couchbase/ping_result.hxx +79 -77
  952. data/ext/couchbase/couchbase/prefix_query.hxx +43 -40
  953. data/ext/couchbase/couchbase/prepend_options.hxx +51 -47
  954. data/ext/couchbase/couchbase/query_index_manager.hxx +207 -199
  955. data/ext/couchbase/couchbase/query_meta_data.hxx +120 -120
  956. data/ext/couchbase/couchbase/query_metrics.hxx +135 -133
  957. data/ext/couchbase/couchbase/query_options.hxx +518 -493
  958. data/ext/couchbase/couchbase/query_profile.hxx +29 -26
  959. data/ext/couchbase/couchbase/query_result.hxx +56 -55
  960. data/ext/couchbase/couchbase/query_scan_consistency.hxx +24 -21
  961. data/ext/couchbase/couchbase/query_status.hxx +10 -10
  962. data/ext/couchbase/couchbase/query_string_query.hxx +34 -29
  963. data/ext/couchbase/couchbase/query_warning.hxx +75 -71
  964. data/ext/couchbase/couchbase/read_preference.hxx +58 -0
  965. data/ext/couchbase/couchbase/regexp_query.hxx +40 -39
  966. data/ext/couchbase/couchbase/remove_options.hxx +51 -47
  967. data/ext/couchbase/couchbase/replace_link_analytics_options.hxx +25 -25
  968. data/ext/couchbase/couchbase/replace_options.hxx +112 -104
  969. data/ext/couchbase/couchbase/replicate_to.hxx +28 -28
  970. data/ext/couchbase/couchbase/result.hxx +28 -28
  971. data/ext/couchbase/couchbase/resume_ingest_search_index_options.hxx +11 -10
  972. data/ext/couchbase/couchbase/retry_action.hxx +10 -10
  973. data/ext/couchbase/couchbase/retry_reason.hxx +53 -51
  974. data/ext/couchbase/couchbase/retry_request.hxx +7 -7
  975. data/ext/couchbase/couchbase/retry_strategy.hxx +4 -4
  976. data/ext/couchbase/couchbase/scan_options.hxx +114 -108
  977. data/ext/couchbase/couchbase/scan_result.hxx +97 -96
  978. data/ext/couchbase/couchbase/scan_result_item.hxx +120 -118
  979. data/ext/couchbase/couchbase/scan_type.hxx +237 -232
  980. data/ext/couchbase/couchbase/scope.hxx +164 -157
  981. data/ext/couchbase/couchbase/scope_search_index_manager.hxx +263 -238
  982. data/ext/couchbase/couchbase/search_date_range.hxx +32 -29
  983. data/ext/couchbase/couchbase/search_facet.hxx +25 -25
  984. data/ext/couchbase/couchbase/search_facet_result.hxx +11 -11
  985. data/ext/couchbase/couchbase/search_geo_distance_units.hxx +11 -1
  986. data/ext/couchbase/couchbase/search_index_manager.hxx +261 -238
  987. data/ext/couchbase/couchbase/search_meta_data.hxx +37 -37
  988. data/ext/couchbase/couchbase/search_metrics.hxx +84 -83
  989. data/ext/couchbase/couchbase/search_numeric_range.hxx +32 -32
  990. data/ext/couchbase/couchbase/search_options.hxx +449 -435
  991. data/ext/couchbase/couchbase/search_query.hxx +32 -30
  992. data/ext/couchbase/couchbase/search_request.hxx +69 -68
  993. data/ext/couchbase/couchbase/search_result.hxx +29 -26
  994. data/ext/couchbase/couchbase/search_row.hxx +52 -52
  995. data/ext/couchbase/couchbase/search_row_location.hxx +20 -20
  996. data/ext/couchbase/couchbase/search_row_locations.hxx +39 -38
  997. data/ext/couchbase/couchbase/search_scan_consistency.hxx +11 -10
  998. data/ext/couchbase/couchbase/search_sort.hxx +20 -20
  999. data/ext/couchbase/couchbase/search_sort_field.hxx +77 -71
  1000. data/ext/couchbase/couchbase/search_sort_field_missing.hxx +2 -2
  1001. data/ext/couchbase/couchbase/search_sort_field_mode.hxx +3 -3
  1002. data/ext/couchbase/couchbase/search_sort_field_type.hxx +4 -4
  1003. data/ext/couchbase/couchbase/search_sort_geo_distance.hxx +41 -41
  1004. data/ext/couchbase/couchbase/search_sort_id.hxx +23 -23
  1005. data/ext/couchbase/couchbase/search_sort_score.hxx +23 -23
  1006. data/ext/couchbase/couchbase/search_term_range.hxx +17 -17
  1007. data/ext/couchbase/couchbase/security_options.hxx +50 -50
  1008. data/ext/couchbase/couchbase/service_type.hxx +34 -34
  1009. data/ext/couchbase/couchbase/store_semantics.hxx +28 -28
  1010. data/ext/couchbase/couchbase/subdoc/array_add_unique.hxx +54 -54
  1011. data/ext/couchbase/couchbase/subdoc/array_append.hxx +40 -40
  1012. data/ext/couchbase/couchbase/subdoc/array_insert.hxx +41 -41
  1013. data/ext/couchbase/couchbase/subdoc/array_prepend.hxx +41 -41
  1014. data/ext/couchbase/couchbase/subdoc/count.hxx +24 -24
  1015. data/ext/couchbase/couchbase/subdoc/counter.hxx +41 -41
  1016. data/ext/couchbase/couchbase/subdoc/exists.hxx +24 -24
  1017. data/ext/couchbase/couchbase/subdoc/get.hxx +45 -29
  1018. data/ext/couchbase/couchbase/subdoc/insert.hxx +70 -54
  1019. data/ext/couchbase/couchbase/subdoc/lookup_in_macro.hxx +13 -12
  1020. data/ext/couchbase/couchbase/subdoc/mutate_in_macro.hxx +7 -2
  1021. data/ext/couchbase/couchbase/subdoc/remove.hxx +24 -24
  1022. data/ext/couchbase/couchbase/subdoc/replace.hxx +55 -39
  1023. data/ext/couchbase/couchbase/subdoc/upsert.hxx +70 -54
  1024. data/ext/couchbase/couchbase/term_facet.hxx +16 -16
  1025. data/ext/couchbase/couchbase/term_facet_result.hxx +14 -14
  1026. data/ext/couchbase/couchbase/term_query.hxx +107 -104
  1027. data/ext/couchbase/couchbase/term_range_query.hxx +99 -96
  1028. data/ext/couchbase/couchbase/timeout_options.hxx +118 -112
  1029. data/ext/couchbase/couchbase/tls_verify_mode.hxx +2 -2
  1030. data/ext/couchbase/couchbase/touch_options.hxx +25 -24
  1031. data/ext/couchbase/couchbase/tracing/otel_tracer.hxx +45 -44
  1032. data/ext/couchbase/couchbase/tracing/request_span.hxx +34 -34
  1033. data/ext/couchbase/couchbase/tracing/request_tracer.hxx +27 -25
  1034. data/ext/couchbase/couchbase/tracing_options.hxx +147 -142
  1035. data/ext/couchbase/couchbase/transactions/async_attempt_context.hxx +149 -115
  1036. data/ext/couchbase/couchbase/transactions/attempt_context.hxx +146 -95
  1037. data/ext/couchbase/couchbase/transactions/transaction_get_result.hxx +52 -80
  1038. data/ext/couchbase/couchbase/transactions/transaction_keyspace.hxx +33 -29
  1039. data/ext/couchbase/couchbase/transactions/transaction_options.hxx +101 -96
  1040. data/ext/couchbase/couchbase/transactions/transaction_query_options.hxx +228 -223
  1041. data/ext/couchbase/couchbase/transactions/transaction_query_result.hxx +11 -12
  1042. data/ext/couchbase/couchbase/transactions/transaction_result.hxx +2 -3
  1043. data/ext/couchbase/couchbase/transactions/transactions_cleanup_config.hxx +105 -104
  1044. data/ext/couchbase/couchbase/transactions/transactions_config.hxx +191 -187
  1045. data/ext/couchbase/couchbase/transactions/transactions_query_config.hxx +32 -32
  1046. data/ext/couchbase/couchbase/transactions.hxx +56 -37
  1047. data/ext/couchbase/couchbase/unfreeze_plan_search_index_options.hxx +11 -10
  1048. data/ext/couchbase/couchbase/unlock_options.hxx +25 -24
  1049. data/ext/couchbase/couchbase/update_bucket_options.hxx +9 -9
  1050. data/ext/couchbase/couchbase/update_collection_options.hxx +35 -34
  1051. data/ext/couchbase/couchbase/upsert_options.hxx +85 -80
  1052. data/ext/couchbase/couchbase/upsert_search_index_options.hxx +9 -9
  1053. data/ext/couchbase/couchbase/vector_query.hxx +82 -62
  1054. data/ext/couchbase/couchbase/vector_search.hxx +51 -47
  1055. data/ext/couchbase/couchbase/vector_search_options.hxx +45 -41
  1056. data/ext/couchbase/couchbase/wan_development_configuration_profile.hxx +13 -13
  1057. data/ext/couchbase/couchbase/watch_query_indexes_options.hxx +41 -41
  1058. data/ext/couchbase/couchbase/wildcard_query.hxx +42 -41
  1059. data/ext/couchbase/third_party/expected/include/tl/expected.hpp +1746 -1584
  1060. data/ext/couchbase/third_party/jsonsl/jsonsl.c +2664 -2638
  1061. data/ext/couchbase/third_party/jsonsl/jsonsl.h +359 -342
  1062. data/ext/couchbase.cxx +43 -9568
  1063. data/ext/extconf.rb +5 -0
  1064. data/ext/rcb_analytics.cxx +1195 -0
  1065. data/ext/rcb_analytics.hxx +29 -0
  1066. data/ext/rcb_backend.cxx +530 -0
  1067. data/ext/rcb_backend.hxx +46 -0
  1068. data/ext/rcb_buckets.cxx +624 -0
  1069. data/ext/rcb_buckets.hxx +29 -0
  1070. data/ext/rcb_collections.cxx +377 -0
  1071. data/ext/rcb_collections.hxx +29 -0
  1072. data/ext/rcb_crud.cxx +1544 -0
  1073. data/ext/rcb_crud.hxx +29 -0
  1074. data/ext/rcb_diagnostics.cxx +264 -0
  1075. data/ext/rcb_diagnostics.hxx +29 -0
  1076. data/ext/rcb_exceptions.cxx +963 -0
  1077. data/ext/rcb_exceptions.hxx +111 -0
  1078. data/ext/rcb_extras.cxx +394 -0
  1079. data/ext/rcb_extras.hxx +29 -0
  1080. data/ext/rcb_logger.cxx +319 -0
  1081. data/ext/rcb_logger.hxx +36 -0
  1082. data/ext/rcb_multi.cxx +343 -0
  1083. data/ext/rcb_multi.hxx +29 -0
  1084. data/ext/rcb_query.cxx +1316 -0
  1085. data/ext/rcb_query.hxx +29 -0
  1086. data/ext/rcb_range_scan.cxx +358 -0
  1087. data/ext/rcb_range_scan.hxx +29 -0
  1088. data/ext/rcb_search.cxx +1216 -0
  1089. data/ext/rcb_search.hxx +29 -0
  1090. data/ext/rcb_users.cxx +636 -0
  1091. data/ext/rcb_users.hxx +29 -0
  1092. data/ext/rcb_utils.cxx +590 -0
  1093. data/ext/rcb_utils.hxx +564 -0
  1094. data/ext/rcb_version.cxx +137 -0
  1095. data/ext/rcb_version.hxx +34 -0
  1096. data/ext/rcb_views.cxx +485 -0
  1097. data/ext/rcb_views.hxx +29 -0
  1098. data/lib/active_support/cache/couchbase_store.rb +4 -1
  1099. data/lib/couchbase/analytics_options.rb +2 -0
  1100. data/lib/couchbase/authenticator.rb +2 -0
  1101. data/lib/couchbase/binary_collection.rb +2 -0
  1102. data/lib/couchbase/binary_collection_options.rb +2 -0
  1103. data/lib/couchbase/bucket.rb +2 -0
  1104. data/lib/couchbase/cluster.rb +2 -0
  1105. data/lib/couchbase/collection.rb +3 -1
  1106. data/lib/couchbase/collection_options.rb +2 -0
  1107. data/lib/couchbase/config_profiles.rb +2 -0
  1108. data/lib/couchbase/configuration.rb +2 -0
  1109. data/lib/couchbase/datastructures/couchbase_list.rb +4 -4
  1110. data/lib/couchbase/datastructures/couchbase_map.rb +4 -4
  1111. data/lib/couchbase/datastructures/couchbase_queue.rb +4 -4
  1112. data/lib/couchbase/datastructures/couchbase_set.rb +4 -4
  1113. data/lib/couchbase/datastructures.rb +2 -0
  1114. data/lib/couchbase/diagnostics.rb +2 -0
  1115. data/lib/couchbase/errors.rb +46 -8
  1116. data/lib/couchbase/json_transcoder.rb +2 -0
  1117. data/lib/couchbase/key_value_scan.rb +2 -0
  1118. data/lib/couchbase/logger.rb +2 -0
  1119. data/lib/couchbase/management/analytics_index_manager.rb +2 -0
  1120. data/lib/couchbase/management/bucket_manager.rb +2 -0
  1121. data/lib/couchbase/management/collection_manager.rb +2 -0
  1122. data/lib/couchbase/management/collection_query_index_manager.rb +2 -0
  1123. data/lib/couchbase/management/query_index_manager.rb +2 -0
  1124. data/lib/couchbase/management/scope_search_index_manager.rb +2 -0
  1125. data/lib/couchbase/management/search_index_manager.rb +2 -0
  1126. data/lib/couchbase/management/user_manager.rb +2 -0
  1127. data/lib/couchbase/management/view_index_manager.rb +2 -0
  1128. data/lib/couchbase/management.rb +2 -0
  1129. data/lib/couchbase/mutation_state.rb +2 -0
  1130. data/lib/couchbase/options.rb +2 -0
  1131. data/lib/couchbase/protostellar/request_generator/kv.rb +1 -1
  1132. data/lib/couchbase/query_options.rb +2 -0
  1133. data/lib/couchbase/railtie.rb +2 -0
  1134. data/lib/couchbase/raw_binary_transcoder.rb +2 -0
  1135. data/lib/couchbase/raw_json_transcoder.rb +2 -0
  1136. data/lib/couchbase/raw_string_transcoder.rb +2 -0
  1137. data/lib/couchbase/scope.rb +2 -0
  1138. data/lib/couchbase/search_options.rb +91 -63
  1139. data/lib/couchbase/subdoc.rb +5 -3
  1140. data/lib/couchbase/transcoder_flags.rb +2 -0
  1141. data/lib/couchbase/utils/generic_logger_adapter.rb +3 -1
  1142. data/lib/couchbase/utils/stdlib_logger_adapter.rb +2 -0
  1143. data/lib/couchbase/utils/time.rb +3 -1
  1144. data/lib/couchbase/utils.rb +2 -0
  1145. data/lib/couchbase/version.rb +3 -1
  1146. data/lib/couchbase/view_options.rb +2 -0
  1147. data/lib/couchbase.rb +2 -0
  1148. data/lib/rails/generators/couchbase/config/config_generator.rb +2 -0
  1149. metadata +83 -26
  1150. data/ext/couchbase/core/impl/internal_manager_error_context.cxx +0 -113
  1151. data/ext/couchbase/core/impl/internal_manager_error_context.hxx +0 -60
  1152. data/ext/couchbase/core/impl/manager_error_context.cxx +0 -100
  1153. data/ext/couchbase/core/impl/search_error_context.cxx +0 -147
  1154. data/ext/couchbase/couchbase/analytics_error_context.hxx +0 -143
  1155. data/ext/couchbase/couchbase/fmt/key_value_error_map_attribute.hxx +0 -100
  1156. data/ext/couchbase/couchbase/fmt/key_value_status_code.hxx +0 -269
  1157. data/ext/couchbase/couchbase/key_value_error_context.hxx +0 -229
  1158. data/ext/couchbase/couchbase/key_value_error_map_attribute.hxx +0 -136
  1159. data/ext/couchbase/couchbase/key_value_error_map_info.hxx +0 -138
  1160. data/ext/couchbase/couchbase/key_value_extended_error_info.hxx +0 -86
  1161. data/ext/couchbase/couchbase/key_value_status_code.hxx +0 -109
  1162. data/ext/couchbase/couchbase/manager_error_context.hxx +0 -111
  1163. data/ext/couchbase/couchbase/query_error_context.hxx +0 -145
  1164. data/ext/couchbase/couchbase/search_error_context.hxx +0 -138
  1165. data/ext/couchbase/couchbase/subdocument_error_context.hxx +0 -147
  1166. data/ext/couchbase/couchbase/transaction_op_error_context.hxx +0 -76
@@ -68,662 +68,789 @@ class ping_collector_impl
68
68
  , public diag::ping_reporter
69
69
  , public diag::ping_collector
70
70
  {
71
- diag::ping_result res_;
72
- utils::movable_function<void(diag::ping_result)> handler_;
73
- std::atomic_int expected_{ 0 };
74
- std::mutex mutex_{};
75
-
76
- public:
77
- ping_collector_impl(std::string report_id, utils::movable_function<void(diag::ping_result)>&& handler)
78
- : res_{ std::move(report_id), meta::sdk_id() }
79
- , handler_(std::move(handler))
80
- {
81
- }
82
-
83
- ~ping_collector_impl() override
84
- {
85
- invoke_handler();
86
- }
87
-
88
- [[nodiscard]] diag::ping_result& result()
89
- {
90
- return res_;
71
+ diag::ping_result res_;
72
+ utils::movable_function<void(diag::ping_result)> handler_;
73
+ std::atomic_int expected_{ 0 };
74
+ std::mutex mutex_{};
75
+
76
+ public:
77
+ ping_collector_impl(std::string report_id,
78
+ utils::movable_function<void(diag::ping_result)>&& handler)
79
+ : res_{ std::move(report_id), meta::sdk_id() }
80
+ , handler_(std::move(handler))
81
+ {
82
+ }
83
+
84
+ ~ping_collector_impl() override
85
+ {
86
+ invoke_handler();
87
+ }
88
+
89
+ [[nodiscard]] diag::ping_result& result()
90
+ {
91
+ return res_;
92
+ }
93
+
94
+ void report(diag::endpoint_ping_info&& info) override
95
+ {
96
+ const std::scoped_lock lock(mutex_);
97
+ res_.services[info.type].emplace_back(std::move(info));
98
+ if (--expected_ == 0) {
99
+ invoke_handler();
91
100
  }
92
-
93
- void report(diag::endpoint_ping_info&& info) override
94
- {
95
- const std::scoped_lock lock(mutex_);
96
- res_.services[info.type].emplace_back(std::move(info));
97
- if (--expected_ == 0) {
98
- invoke_handler();
99
- }
100
- }
101
-
102
- auto build_reporter() -> std::shared_ptr<diag::ping_reporter> override
103
- {
104
- ++expected_;
105
- return shared_from_this();
106
- }
107
-
108
- void invoke_handler()
109
- {
110
- if (handler_ != nullptr) {
111
- handler_(std::move(res_));
112
- handler_ = nullptr;
113
- }
101
+ }
102
+
103
+ auto build_reporter() -> std::shared_ptr<diag::ping_reporter> override
104
+ {
105
+ ++expected_;
106
+ return shared_from_this();
107
+ }
108
+
109
+ void invoke_handler()
110
+ {
111
+ if (handler_ != nullptr) {
112
+ handler_(std::move(res_));
113
+ handler_ = nullptr;
114
114
  }
115
+ }
115
116
  };
116
117
 
117
118
  template<typename Request>
118
- constexpr bool
119
- is_feature_supported(const Request& /* request */, const configuration_capabilities& /* capabilities */)
119
+ bool
120
+ is_feature_supported(const Request& /* request */,
121
+ const configuration_capabilities& /* capabilities */)
120
122
  {
121
- return true;
123
+ return true;
122
124
  }
123
125
 
124
- constexpr bool
125
- is_feature_supported(const operations::search_request& request, const configuration_capabilities& capabilities)
126
+ bool
127
+ is_feature_supported(const operations::search_request& request,
128
+ const configuration_capabilities& capabilities)
126
129
  {
127
- if (request.scope_name && !capabilities.supports_scoped_search_indexes()) {
128
- return false;
129
- }
130
- if (request.vector_search && !capabilities.supports_vector_search()) {
131
- return false;
132
- }
130
+ if (request.scope_name && !capabilities.supports_scoped_search_indexes()) {
131
+ return false;
132
+ }
133
+ if (request.vector_search && !capabilities.supports_vector_search()) {
134
+ return false;
135
+ }
133
136
 
134
- return true;
137
+ return true;
138
+ }
139
+
140
+ bool
141
+ is_feature_supported(const operations::management::search_index_upsert_request& request,
142
+ const configuration_capabilities& capabilities)
143
+ {
144
+ if (request.index.is_vector_index() && !capabilities.supports_vector_search()) {
145
+ return false;
146
+ }
147
+ return true;
135
148
  }
136
149
 
137
150
  class cluster_impl : public std::enable_shared_from_this<cluster_impl>
138
151
  {
139
- public:
140
- explicit cluster_impl(asio::io_context& ctx)
141
- : ctx_(ctx)
142
- , work_(asio::make_work_guard(ctx_))
143
- , session_manager_(std::make_shared<io::http_session_manager>(id_, ctx_, tls_))
144
- {
152
+ public:
153
+ explicit cluster_impl(asio::io_context& ctx)
154
+ : ctx_(ctx)
155
+ , work_(asio::make_work_guard(ctx_))
156
+ , session_manager_(std::make_shared<io::http_session_manager>(id_, ctx_, tls_))
157
+ {
158
+ }
159
+
160
+ auto io_context() -> asio::io_context&
161
+ {
162
+ return ctx_;
163
+ }
164
+
165
+ void configure_tls_options(bool has_capella_host)
166
+ {
167
+ asio::ssl::context::options tls_options =
168
+ asio::ssl::context::default_workarounds | // various bug workarounds that should be rather
169
+ // harmless
170
+ asio::ssl::context::no_sslv2 | // published: 1995, deprecated: 2011
171
+ asio::ssl::context::no_sslv3; // published: 1996, deprecated: 2015
172
+ if (origin_.options().tls_disable_deprecated_protocols) {
173
+ tls_options |= asio::ssl::context::no_tlsv1 | // published: 1999, deprecated: 2021
174
+ asio::ssl::context::no_tlsv1_1; // published: 2006, deprecated: 2021
145
175
  }
146
-
147
- auto io_context() -> asio::io_context&
148
- {
149
- return ctx_;
176
+ if (origin_.options().tls_disable_v1_2 || has_capella_host) {
177
+ tls_options |= asio::ssl::context::no_tlsv1_2; // published: 2008, still in use
178
+ }
179
+ tls_.set_options(tls_options);
180
+ switch (origin_.options().tls_verify) {
181
+ case tls_verify_mode::none:
182
+ tls_.set_verify_mode(asio::ssl::verify_none);
183
+ break;
184
+
185
+ case tls_verify_mode::peer:
186
+ tls_.set_verify_mode(asio::ssl::verify_peer);
187
+ break;
150
188
  }
151
-
152
- void configure_tls_options(bool has_capella_host)
153
- {
154
- asio::ssl::context::options tls_options =
155
- asio::ssl::context::default_workarounds | // various bug workarounds that should be rather harmless
156
- asio::ssl::context::no_sslv2 | // published: 1995, deprecated: 2011
157
- asio::ssl::context::no_sslv3; // published: 1996, deprecated: 2015
158
- if (origin_.options().tls_disable_deprecated_protocols) {
159
- tls_options |= asio::ssl::context::no_tlsv1 | // published: 1999, deprecated: 2021
160
- asio::ssl::context::no_tlsv1_1; // published: 2006, deprecated: 2021
161
- }
162
- if (origin_.options().tls_disable_v1_2 || has_capella_host) {
163
- tls_options |= asio::ssl::context::no_tlsv1_2; // published: 2008, still in use
164
- }
165
- tls_.set_options(tls_options);
166
- switch (origin_.options().tls_verify) {
167
- case tls_verify_mode::none:
168
- tls_.set_verify_mode(asio::ssl::verify_none);
169
- break;
170
-
171
- case tls_verify_mode::peer:
172
- tls_.set_verify_mode(asio::ssl::verify_peer);
173
- break;
174
- }
175
189
 
176
190
  #ifdef COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE
177
- SSL_CTX_set_keylog_callback(tls_.native_handle(), [](const SSL* /* ssl */, const char* line) {
178
- std::ofstream keylog(COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE, std::ios::out | std::ios::app | std::ios::binary);
179
- keylog << std::string_view(line) << std::endl;
180
- });
181
- CB_LOG_CRITICAL(
182
- "COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE was set to \"{}\" during build, all TLS keys will be logged for network analysis "
183
- "(https://wiki.wireshark.org/TLS). DO NOT USE THIS BUILD IN PRODUCTION",
184
- COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE);
191
+ SSL_CTX_set_keylog_callback(tls_.native_handle(), [](const SSL* /* ssl */, const char* line) {
192
+ std::ofstream keylog(COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE,
193
+ std::ios::out | std::ios::app | std::ios::binary);
194
+ keylog << std::string_view(line) << std::endl;
195
+ });
196
+ CB_LOG_CRITICAL("COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE was set to \"{}\" during build, all TLS "
197
+ "keys will be logged "
198
+ "for network analysis "
199
+ "(https://wiki.wireshark.org/TLS). DO NOT USE THIS BUILD IN PRODUCTION",
200
+ COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE);
185
201
  #endif
186
- }
202
+ }
187
203
 
188
- void open(couchbase::core::origin origin, utils::movable_function<void(std::error_code)>&& handler)
189
- {
190
- if (stopped_) {
191
- return handler(errc::network::cluster_closed);
192
- }
193
- if (origin.get_nodes().empty()) {
194
- stopped_ = true;
195
- work_.reset();
196
- return handler(errc::common::invalid_argument);
197
- }
198
-
199
- origin_ = std::move(origin);
200
- CB_LOG_DEBUG(R"(open cluster, id: "{}", core version: "{}", {})", id_, couchbase::core::meta::sdk_semver(), origin_.to_json());
201
- // ignore the enable_tracing flag if a tracer was passed in
202
- if (nullptr != origin_.options().tracer) {
203
- tracer_ = origin_.options().tracer;
204
- } else {
205
- if (origin_.options().enable_tracing) {
206
- tracer_ = std::make_shared<tracing::threshold_logging_tracer>(ctx_, origin_.options().tracing_options);
207
- } else {
208
- tracer_ = std::make_shared<tracing::noop_tracer>();
209
- }
210
- }
211
- tracer_->start();
212
- // ignore the metrics options if a meter was passed in.
213
- if (nullptr != origin_.options().meter) {
214
- meter_ = origin_.options().meter;
215
- } else {
216
- if (origin_.options().enable_metrics) {
217
- meter_ = std::make_shared<metrics::logging_meter>(ctx_, origin_.options().metrics_options);
218
- } else {
219
- meter_ = std::make_shared<metrics::noop_meter>();
220
- }
221
- }
222
- meter_->start();
223
- session_manager_->set_tracer(tracer_);
224
- if (origin_.options().enable_dns_srv) {
225
- std::string hostname;
226
- std::string port;
227
- std::tie(hostname, port) = origin_.next_address();
228
- dns_srv_tracker_ =
229
- std::make_shared<impl::dns_srv_tracker>(ctx_, hostname, origin_.options().dns_config, origin_.options().enable_tls);
230
- return asio::post(asio::bind_executor(
231
- ctx_, [self = shared_from_this(), hostname = std::move(hostname), handler = std::move(handler)]() mutable {
232
- return self->dns_srv_tracker_->get_srv_nodes([self, hostname = std::move(hostname), handler = std::move(handler)](
233
- origin::node_list nodes, std::error_code ec) mutable {
234
- if (ec) {
235
- return self->close([ec, handler = std::move(handler)]() mutable { handler(ec); });
236
- }
237
- if (!nodes.empty()) {
238
- self->origin_.set_nodes(std::move(nodes));
239
- CB_LOG_INFO("replace list of bootstrap nodes with addresses from DNS SRV of \"{}\": [{}]",
240
- hostname,
241
- utils::join_strings(self->origin_.get_nodes(), ", "));
242
- }
243
- return self->do_open(std::move(handler));
244
- });
245
- }));
246
- }
247
- do_open(std::move(handler));
204
+ void open(couchbase::core::origin origin,
205
+ utils::movable_function<void(std::error_code)>&& handler)
206
+ {
207
+ if (stopped_) {
208
+ return handler(errc::network::cluster_closed);
209
+ }
210
+ if (origin.get_nodes().empty()) {
211
+ stopped_ = true;
212
+ work_.reset();
213
+ return handler(errc::common::invalid_argument);
248
214
  }
249
215
 
250
- void open_bucket(const std::string& bucket_name, utils::movable_function<void(std::error_code)>&& handler)
216
+ origin_ = std::move(origin);
217
+ CB_LOG_DEBUG(R"(open cluster, id: "{}", core version: "{}", {})",
218
+ id_,
219
+ couchbase::core::meta::sdk_semver(),
220
+ origin_.to_json());
221
+ // ignore the enable_tracing flag if a tracer was passed in
222
+ if (nullptr != origin_.options().tracer) {
223
+ tracer_ = origin_.options().tracer;
224
+ } else {
225
+ if (origin_.options().enable_tracing) {
226
+ tracer_ = std::make_shared<tracing::threshold_logging_tracer>(
227
+ ctx_, origin_.options().tracing_options);
228
+ } else {
229
+ tracer_ = std::make_shared<tracing::noop_tracer>();
230
+ }
231
+ }
232
+ tracer_->start();
233
+ // ignore the metrics options if a meter was passed in.
234
+ if (nullptr != origin_.options().meter) {
235
+ meter_ = origin_.options().meter;
236
+ } else {
237
+ if (origin_.options().enable_metrics) {
238
+ meter_ = std::make_shared<metrics::logging_meter>(ctx_, origin_.options().metrics_options);
239
+ } else {
240
+ meter_ = std::make_shared<metrics::noop_meter>();
241
+ }
242
+ }
243
+ meter_->start();
244
+ session_manager_->set_tracer(tracer_);
245
+ if (origin_.options().enable_dns_srv) {
246
+ std::string hostname;
247
+ std::string port;
248
+ std::tie(hostname, port) = origin_.next_address();
249
+ dns_srv_tracker_ = std::make_shared<impl::dns_srv_tracker>(
250
+ ctx_, hostname, origin_.options().dns_config, origin_.options().enable_tls);
251
+ return asio::post(asio::bind_executor(
252
+ ctx_,
253
+ [self = shared_from_this(),
254
+ hostname = std::move(hostname),
255
+ handler = std::move(handler)]() mutable {
256
+ return self->dns_srv_tracker_->get_srv_nodes(
257
+ [self, hostname = std::move(hostname), handler = std::move(handler)](
258
+ origin::node_list nodes, std::error_code ec) mutable {
259
+ if (ec) {
260
+ return self->close([ec, handler = std::move(handler)]() mutable {
261
+ handler(ec);
262
+ });
263
+ }
264
+ if (!nodes.empty()) {
265
+ self->origin_.set_nodes(std::move(nodes));
266
+ CB_LOG_INFO(
267
+ "replace list of bootstrap nodes with addresses from DNS SRV of \"{}\": [{}]",
268
+ hostname,
269
+ utils::join_strings(self->origin_.get_nodes(), ", "));
270
+ }
271
+ return self->do_open(std::move(handler));
272
+ });
273
+ }));
274
+ }
275
+ do_open(std::move(handler));
276
+ }
277
+
278
+ void open_bucket(const std::string& bucket_name,
279
+ utils::movable_function<void(std::error_code)>&& handler)
280
+ {
281
+ if (stopped_) {
282
+ return handler(errc::network::cluster_closed);
283
+ }
284
+ std::shared_ptr<bucket> b{};
251
285
  {
252
- if (stopped_) {
253
- return handler(errc::network::cluster_closed);
286
+ std::scoped_lock lock(buckets_mutex_);
287
+ auto ptr = buckets_.find(bucket_name);
288
+ if (ptr == buckets_.end()) {
289
+ std::vector<protocol::hello_feature> known_features;
290
+
291
+ auto origin = origin_;
292
+ if (session_ && session_->has_config()) {
293
+ known_features = session_->supported_features();
294
+ origin = { origin_, session_->config().value() };
254
295
  }
255
- std::shared_ptr<bucket> b{};
256
- {
257
- std::scoped_lock lock(buckets_mutex_);
258
- auto ptr = buckets_.find(bucket_name);
259
- if (ptr == buckets_.end()) {
260
- std::vector<protocol::hello_feature> known_features;
261
-
262
- auto origin = origin_;
263
- if (session_ && session_->has_config()) {
264
- known_features = session_->supported_features();
265
- origin = { origin_, session_->config().value() };
266
- }
267
296
 
268
- b = std::make_shared<bucket>(id_, ctx_, tls_, tracer_, meter_, bucket_name, origin, known_features, dns_srv_tracker_);
269
- buckets_.try_emplace(bucket_name, b);
270
- }
271
- }
272
- if (b == nullptr) {
273
- return handler({});
274
- }
275
-
276
- b->on_configuration_update(session_manager_);
277
- b->bootstrap([self = shared_from_this(), bucket_name, handler = std::move(handler)](std::error_code ec,
278
- const topology::configuration& config) mutable {
279
- if (ec) {
280
- std::scoped_lock lock(self->buckets_mutex_);
281
- self->buckets_.erase(bucket_name);
282
- } else if (self->session_ && !self->session_->supports_gcccp()) {
283
- self->session_manager_->set_configuration(config, self->origin_.options());
284
- }
285
- handler(ec);
286
- });
297
+ b = std::make_shared<bucket>(
298
+ id_, ctx_, tls_, tracer_, meter_, bucket_name, origin, known_features, dns_srv_tracker_);
299
+ buckets_.try_emplace(bucket_name, b);
300
+ }
301
+ }
302
+ if (b == nullptr) {
303
+ return handler({});
287
304
  }
288
305
 
289
- void close_bucket(const std::string& bucket_name, utils::movable_function<void(std::error_code)>&& handler)
306
+ b->on_configuration_update(session_manager_);
307
+ b->bootstrap([self = shared_from_this(), bucket_name, handler = std::move(handler)](
308
+ std::error_code ec, const topology::configuration& config) mutable {
309
+ if (ec) {
310
+ std::scoped_lock lock(self->buckets_mutex_);
311
+ self->buckets_.erase(bucket_name);
312
+ } else if (self->session_ && !self->session_->supports_gcccp()) {
313
+ self->session_manager_->set_configuration(config, self->origin_.options());
314
+ }
315
+ handler(ec);
316
+ });
317
+ }
318
+
319
+ void close_bucket(const std::string& bucket_name,
320
+ utils::movable_function<void(std::error_code)>&& handler)
321
+ {
322
+ if (stopped_) {
323
+ return handler(errc::network::cluster_closed);
324
+ }
325
+ std::shared_ptr<bucket> b{};
290
326
  {
291
- if (stopped_) {
292
- return handler(errc::network::cluster_closed);
293
- }
294
- std::shared_ptr<bucket> b{};
295
- {
296
- std::scoped_lock lock(buckets_mutex_);
327
+ std::scoped_lock lock(buckets_mutex_);
297
328
 
298
- if (auto ptr = buckets_.find(bucket_name); ptr != buckets_.end()) {
299
- b = std::move(ptr->second);
300
- buckets_.erase(ptr);
301
- }
302
- }
303
- if (b != nullptr) {
304
- b->close();
305
- }
306
- return handler({});
329
+ if (auto ptr = buckets_.find(bucket_name); ptr != buckets_.end()) {
330
+ b = std::move(ptr->second);
331
+ buckets_.erase(ptr);
332
+ }
307
333
  }
308
-
309
- std::pair<std::error_code, couchbase::core::origin> origin() const
310
- {
311
- if (stopped_) {
312
- return { errc::network::cluster_closed, {} };
313
- }
314
- return { {}, origin_ };
334
+ if (b != nullptr) {
335
+ b->close();
315
336
  }
337
+ return handler({});
338
+ }
316
339
 
317
- template<class Request,
318
- class Handler,
319
- typename std::enable_if_t<!std::is_same_v<typename Request::encoded_request_type, io::http_request>, int> = 0>
320
- void execute(Request request, Handler&& handler)
321
- {
322
- using response_type = typename Request::encoded_response_type;
323
- if (stopped_) {
324
- return handler(request.make_response(make_key_value_error_context(errc::network::cluster_closed, request.id), response_type{}));
325
- }
326
- if (auto bucket = find_bucket_by_name(request.id.bucket()); bucket != nullptr) {
327
- return bucket->execute(std::move(request), std::forward<Handler>(handler));
328
- }
329
- if (request.id.bucket().empty()) {
330
- return handler(
331
- request.make_response(make_key_value_error_context(errc::common::bucket_not_found, request.id), response_type{}));
332
- }
333
- auto bucket_name = request.id.bucket();
334
- return open_bucket(
335
- bucket_name,
336
- [self = shared_from_this(), request = std::move(request), handler = std::forward<Handler>(handler)](std::error_code ec) mutable {
337
- if (ec) {
338
- return handler(request.make_response(make_key_value_error_context(ec, request.id), response_type{}));
339
- }
340
- return self->execute(std::move(request), std::forward<Handler>(handler));
341
- });
340
+ std::pair<std::error_code, couchbase::core::origin> origin() const
341
+ {
342
+ if (stopped_) {
343
+ return { errc::network::cluster_closed, {} };
342
344
  }
343
-
344
- template<class Request,
345
- class Handler,
346
- typename std::enable_if_t<std::is_same_v<typename Request::encoded_request_type, io::http_request>, int> = 0>
347
- void execute(Request request, Handler&& handler)
348
- {
349
- using response_type = typename Request::encoded_response_type;
350
- if (stopped_) {
351
- return handler(request.make_response({ errc::network::cluster_closed }, response_type{}));
352
- }
353
- if (!is_feature_supported(request, session_manager_->configuration_capabilities())) {
354
- return handler(request.make_response({ errc::common::feature_not_available }, response_type{}));
355
- }
356
- if constexpr (operations::is_compound_operation_v<Request>) {
357
- return request.execute(shared_from_this(), std::forward<Handler>(handler));
358
- } else {
359
- return session_manager_->execute(std::move(request), std::forward<Handler>(handler), origin_.credentials());
360
- }
345
+ return { {}, origin_ };
346
+ }
347
+
348
+ template<class Request,
349
+ class Handler,
350
+ typename std::enable_if_t<
351
+ !std::is_same_v<typename Request::encoded_request_type, io::http_request>,
352
+ int> = 0>
353
+ void execute(Request request, Handler&& handler)
354
+ {
355
+ using response_type = typename Request::encoded_response_type;
356
+ if (stopped_) {
357
+ return handler(request.make_response(
358
+ make_key_value_error_context(errc::network::cluster_closed, request.id), response_type{}));
361
359
  }
362
-
363
- template<class Request,
364
- class Handler,
365
- typename std::enable_if_t<std::is_same_v<typename Request::encoded_request_type, io::http_request>, int> = 0>
366
- void execute_with_bucket_capability_check(Request request, bucket_capability cap, Handler&& handler)
367
- {
368
- auto bucket_name = request.bucket_name;
369
- return open_bucket(
360
+ if (auto bucket = find_bucket_by_name(request.id.bucket()); bucket != nullptr) {
361
+ return bucket->execute(std::move(request), std::forward<Handler>(handler));
362
+ }
363
+ if (request.id.bucket().empty()) {
364
+ return handler(request.make_response(
365
+ make_key_value_error_context(errc::common::bucket_not_found, request.id), response_type{}));
366
+ }
367
+ auto bucket_name = request.id.bucket();
368
+ return open_bucket(bucket_name,
369
+ [self = shared_from_this(),
370
+ request = std::move(request),
371
+ handler = std::forward<Handler>(handler)](std::error_code ec) mutable {
372
+ if (ec) {
373
+ return handler(request.make_response(
374
+ make_key_value_error_context(ec, request.id), response_type{}));
375
+ }
376
+ return self->execute(std::move(request), std::forward<Handler>(handler));
377
+ });
378
+ }
379
+
380
+ template<class Request,
381
+ class Handler,
382
+ typename std::enable_if_t<
383
+ std::is_same_v<typename Request::encoded_request_type, io::http_request>,
384
+ int> = 0>
385
+ void execute(Request request, Handler&& handler)
386
+ {
387
+ using response_type = typename Request::encoded_response_type;
388
+ if (stopped_) {
389
+ return handler(request.make_response({ errc::network::cluster_closed }, response_type{}));
390
+ }
391
+ if (!is_feature_supported(request, session_manager_->configuration_capabilities())) {
392
+ return handler(
393
+ request.make_response({ errc::common::feature_not_available }, response_type{}));
394
+ }
395
+ if constexpr (operations::is_compound_operation_v<Request>) {
396
+ return request.execute(shared_from_this(), std::forward<Handler>(handler));
397
+ } else {
398
+ return session_manager_->execute(
399
+ std::move(request), std::forward<Handler>(handler), origin_.credentials());
400
+ }
401
+ }
402
+
403
+ template<class Request,
404
+ class Handler,
405
+ typename std::enable_if_t<
406
+ std::is_same_v<typename Request::encoded_request_type, io::http_request>,
407
+ int> = 0>
408
+ void execute_with_bucket_capability_check(Request request,
409
+ bucket_capability cap,
410
+ Handler&& handler)
411
+ {
412
+ auto bucket_name = request.bucket_name;
413
+ return open_bucket(
414
+ bucket_name,
415
+ [self = shared_from_this(),
416
+ bucket_name,
417
+ cap,
418
+ request = std::move(request),
419
+ handler = std::forward<Handler>(handler)](std::error_code ec) mutable {
420
+ if (ec) {
421
+ handler(request.make_response({ ec }, {}));
422
+ return;
423
+ }
424
+ return self->with_bucket_configuration(
370
425
  bucket_name,
371
- [self = shared_from_this(), bucket_name, cap, request = std::move(request), handler = std::forward<Handler>(handler)](
372
- std::error_code ec) mutable {
373
- if (ec) {
374
- handler(request.make_response({ ec }, {}));
375
- return;
376
- }
377
- return self->with_bucket_configuration(
378
- bucket_name,
379
- [self = std::move(self), cap, request = std::move(request), handler = std::forward<Handler>(handler)](
380
- std::error_code ec, topology::configuration config) mutable {
381
- if (ec) {
382
- handler(request.make_response({ ec }, {}));
383
- return;
384
- }
385
- if (!config.capabilities.has_bucket_capability(cap)) {
386
- handler(request.make_response({ errc::common::feature_not_available }, {}));
387
- return;
388
- }
389
- return self->execute(std::move(request), std::forward<Handler>(handler));
390
- });
426
+ [self = std::move(self),
427
+ cap,
428
+ request = std::move(request),
429
+ handler = std::forward<Handler>(handler)](std::error_code ec,
430
+ topology::configuration config) mutable {
431
+ if (ec) {
432
+ handler(request.make_response({ ec }, {}));
433
+ return;
434
+ }
435
+ if (!config.capabilities.has_bucket_capability(cap)) {
436
+ handler(request.make_response({ errc::common::feature_not_available }, {}));
437
+ return;
438
+ }
439
+ return self->execute(std::move(request), std::forward<Handler>(handler));
391
440
  });
392
- }
441
+ });
442
+ }
393
443
 
394
- std::shared_ptr<bucket> find_bucket_by_name(const std::string& name)
395
- {
396
- std::scoped_lock lock(buckets_mutex_);
444
+ std::shared_ptr<bucket> find_bucket_by_name(const std::string& name)
445
+ {
446
+ std::scoped_lock lock(buckets_mutex_);
397
447
 
398
- auto bucket = buckets_.find(name);
399
- if (bucket == buckets_.end()) {
400
- return {};
401
- }
402
- return bucket->second;
448
+ auto bucket = buckets_.find(name);
449
+ if (bucket == buckets_.end()) {
450
+ return {};
403
451
  }
452
+ return bucket->second;
453
+ }
404
454
 
405
- void for_each_bucket(utils::movable_function<void(std::shared_ptr<bucket>)> handler)
455
+ void for_each_bucket(utils::movable_function<void(std::shared_ptr<bucket>)> handler)
456
+ {
457
+ std::vector<std::shared_ptr<bucket>> buckets{};
406
458
  {
407
- std::vector<std::shared_ptr<bucket>> buckets{};
408
- {
409
- std::scoped_lock lock(buckets_mutex_);
410
- buckets.reserve(buckets_.size());
411
- for (const auto& [name, bucket] : buckets_) {
412
- buckets.push_back(bucket);
413
- }
414
- }
415
- for (auto bucket : buckets) {
416
- handler(bucket);
417
- }
459
+ std::scoped_lock lock(buckets_mutex_);
460
+ buckets.reserve(buckets_.size());
461
+ for (const auto& [name, bucket] : buckets_) {
462
+ buckets.push_back(bucket);
463
+ }
464
+ }
465
+ for (auto bucket : buckets) {
466
+ handler(bucket);
467
+ }
468
+ }
469
+
470
+ void do_open(utils::movable_function<void(std::error_code)> handler)
471
+ {
472
+ // Warn users if idle_http_connection_timeout is too close to server idle timeouts
473
+ if (origin_.options().idle_http_connection_timeout > std::chrono::milliseconds(4'500)) {
474
+ CB_LOG_INFO("[{}]: The SDK may produce trivial warnings due to the idle HTTP connection "
475
+ "timeout being set above the idle"
476
+ "timeout of various services",
477
+ id_);
418
478
  }
419
479
 
420
- void do_open(utils::movable_function<void(std::error_code)> handler)
480
+ // Warn users if they attempt to use Capella without TLS being enabled.
481
+ bool has_capella_host = false;
421
482
  {
422
- // Warn users if idle_http_connection_timeout is too close to server idle timeouts
423
- if (origin_.options().idle_http_connection_timeout > std::chrono::milliseconds(4'500)) {
424
- CB_LOG_INFO("[{}]: The SDK may produce trivial warnings due to the idle HTTP connection timeout being set above the idle"
425
- "timeout of various services",
426
- id_);
483
+ bool has_non_capella_host = false;
484
+ static std::string suffix = "cloud.couchbase.com";
485
+ for (const auto& node : origin_.get_hostnames()) {
486
+ if (auto pos = node.find(suffix);
487
+ pos != std::string::npos && pos + suffix.size() == node.size()) {
488
+ has_capella_host = true;
489
+ } else {
490
+ has_non_capella_host = true;
427
491
  }
492
+ }
493
+
494
+ if (has_capella_host && !origin_.options().enable_tls) {
495
+ CB_LOG_WARNING("[{}]: TLS is required when connecting to Couchbase Capella. Please enable "
496
+ "TLS by prefixing "
497
+ "the connection string with \"couchbases://\" (note the final 's').",
498
+ id_);
499
+ }
500
+
501
+ if (origin_.options().enable_tls /* TLS is enabled */
502
+ && origin_.options()
503
+ .trust_certificate.empty() /* No CA certificate (or other SDK-specific trust source) is specified */
504
+ && origin_.options().trust_certificate_value.empty() /* and certificate value has not been specified */
505
+ && origin_.options().tls_verify != tls_verify_mode::none /* The user did not disable all TLS verification */
506
+ &&
507
+ has_non_capella_host /* The connection string has a hostname that does NOT end in ".cloud.couchbase.com" */) {
508
+ CB_LOG_WARNING("[{}] When TLS is enabled, the cluster options must specify certificate(s) "
509
+ "to trust or ensure that they are "
510
+ "available in system CA store. (Unless connecting to cloud.couchbase.com.)",
511
+ id_);
512
+ }
513
+ }
428
514
 
429
- // Warn users if they attempt to use Capella without TLS being enabled.
430
- bool has_capella_host = false;
431
- {
432
- bool has_non_capella_host = false;
433
- static std::string suffix = "cloud.couchbase.com";
434
- for (const auto& node : origin_.get_hostnames()) {
435
- if (auto pos = node.find(suffix); pos != std::string::npos && pos + suffix.size() == node.size()) {
436
- has_capella_host = true;
437
- } else {
438
- has_non_capella_host = true;
439
- }
440
- }
515
+ if (origin_.options().enable_tls) {
516
+ configure_tls_options(has_capella_host);
441
517
 
442
- if (has_capella_host && !origin_.options().enable_tls) {
443
- CB_LOG_WARNING("[{}]: TLS is required when connecting to Couchbase Capella. Please enable TLS by prefixing "
444
- "the connection string with \"couchbases://\" (note the final 's').",
445
- id_);
446
- }
518
+ if (origin_.options().trust_certificate.empty() &&
519
+ origin_.options()
520
+ .trust_certificate_value.empty()) { // trust certificate is not explicitly specified
521
+ CB_LOG_DEBUG(R"([{}]: use default CA for TLS verify)", id_);
522
+ std::error_code ec{};
447
523
 
448
- if (origin_.options().enable_tls /* TLS is enabled */
449
- && origin_.options().trust_certificate.empty() /* No CA certificate (or other SDK-specific trust source) is specified */
450
- && origin_.options().trust_certificate_value.empty() /* and certificate value has not been specified */
451
- && origin_.options().tls_verify != tls_verify_mode::none /* The user did not disable all TLS verification */
452
- && has_non_capella_host /* The connection string has a hostname that does NOT end in ".cloud.couchbase.com" */) {
453
- CB_LOG_WARNING("[{}] When TLS is enabled, the cluster options must specify certificate(s) to trust or ensure that they are "
454
- "available in system CA store. (Unless connecting to cloud.couchbase.com.)",
455
- id_);
456
- }
524
+ // load system certificates
525
+ tls_.set_default_verify_paths(ec);
526
+ if (ec) {
527
+ CB_LOG_WARNING(R"([{}]: failed to load system CAs: {})", id_, ec.message());
457
528
  }
458
529
 
459
- if (origin_.options().enable_tls) {
460
- configure_tls_options(has_capella_host);
461
-
462
- if (origin_.options().trust_certificate.empty() &&
463
- origin_.options().trust_certificate_value.empty()) { // trust certificate is not explicitly specified
464
- CB_LOG_DEBUG(R"([{}]: use default CA for TLS verify)", id_);
465
- std::error_code ec{};
466
-
467
- // load system certificates
468
- tls_.set_default_verify_paths(ec);
469
- if (ec) {
470
- CB_LOG_WARNING(R"([{}]: failed to load system CAs: {})", id_, ec.message());
471
- }
472
-
473
- // add the Capella Root CA in addition to system CAs
474
- tls_.add_certificate_authority(
475
- asio::const_buffer(couchbase::core::default_ca::capellaCaCert, strlen(couchbase::core::default_ca::capellaCaCert)), ec);
476
- if (ec) {
477
- CB_LOG_WARNING("[{}]: unable to load default CAs: {}", id_, ec.message());
478
- // we don't consider this fatal and try to continue without it
479
- }
480
-
481
- if (const auto certificates = default_ca::mozilla_ca_certs();
482
- !origin_.options().disable_mozilla_ca_certificates && !certificates.empty()) {
483
- CB_LOG_DEBUG("[{}]: loading {} CA certificates from Mozilla bundle. Update date: \"{}\", SHA256: \"{}\"",
484
- id_,
485
- certificates.size(),
486
- default_ca::mozilla_ca_certs_date(),
487
- default_ca::mozilla_ca_certs_sha256());
488
- for (const auto& cert : certificates) {
489
- tls_.add_certificate_authority(asio::const_buffer(cert.body.data(), cert.body.size()), ec);
490
- if (ec) {
491
- CB_LOG_WARNING("[{}]: unable to load CA \"{}\" from Mozilla bundle: {}", id_, cert.authority, ec.message());
492
- }
493
- }
494
- }
495
- } else { // trust certificate is explicitly specified
496
- std::error_code ec{};
497
- // load only the explicit certificate
498
- // system and default capella certificates are not loaded
499
- if (!origin_.options().trust_certificate_value.empty()) {
500
- CB_LOG_DEBUG(R"([{}]: use TLS certificate passed through via options object)", id_);
501
- tls_.add_certificate_authority(asio::const_buffer(origin_.options().trust_certificate_value.data(),
502
- origin_.options().trust_certificate_value.size()),
503
- ec);
504
- if (ec) {
505
- CB_LOG_WARNING("[{}]: unable to load CA passed via options object: {}", id_, ec.message());
506
- }
507
- }
508
- if (!origin_.options().trust_certificate.empty()) {
509
- CB_LOG_DEBUG(R"([{}]: use TLS verify file: "{}")", id_, origin_.options().trust_certificate);
510
- tls_.load_verify_file(origin_.options().trust_certificate, ec);
511
- if (ec) {
512
- CB_LOG_ERROR("[{}]: unable to load verify file \"{}\": {}", id_, origin_.options().trust_certificate, ec.message());
513
- return close([ec, handler = std::move(handler)]() mutable { return handler(ec); });
514
- }
515
- }
516
- }
517
- if (origin_.credentials().uses_certificate()) {
518
- std::error_code ec{};
519
- CB_LOG_DEBUG(R"([{}]: use TLS certificate chain: "{}")", id_, origin_.certificate_path());
520
- tls_.use_certificate_chain_file(origin_.certificate_path(), ec);
521
- if (ec) {
522
- CB_LOG_ERROR("[{}]: unable to load certificate chain \"{}\": {}", id_, origin_.certificate_path(), ec.message());
523
- return close([ec, handler = std::move(handler)]() mutable { return handler(ec); });
524
- }
525
- CB_LOG_DEBUG(R"([{}]: use TLS private key: "{}")", id_, origin_.key_path());
526
- tls_.use_private_key_file(origin_.key_path(), asio::ssl::context::file_format::pem, ec);
527
- if (ec) {
528
- CB_LOG_ERROR("[{}]: unable to load private key \"{}\": {}", id_, origin_.key_path(), ec.message());
529
- return close([ec, handler = std::move(handler)]() mutable { return handler(ec); });
530
- }
531
- }
532
- session_ = io::mcbp_session(id_, ctx_, tls_, origin_, dns_srv_tracker_);
533
- } else {
534
- session_ = io::mcbp_session(id_, ctx_, origin_, dns_srv_tracker_);
530
+ // add the Capella Root CA in addition to system CAs
531
+ tls_.add_certificate_authority(
532
+ asio::const_buffer(couchbase::core::default_ca::capellaCaCert,
533
+ strlen(couchbase::core::default_ca::capellaCaCert)),
534
+ ec);
535
+ if (ec) {
536
+ CB_LOG_WARNING("[{}]: unable to load default CAs: {}", id_, ec.message());
537
+ // we don't consider this fatal and try to continue without it
535
538
  }
536
- session_->bootstrap(
537
- [self = shared_from_this(), handler = std::move(handler)](std::error_code ec, const topology::configuration& config) mutable {
538
- if (!ec) {
539
- if (self->origin_.options().network == "auto") {
540
- self->origin_.options().network = config.select_network(self->session_->bootstrap_hostname());
541
- if (self->origin_.options().network == "default") {
542
- CB_LOG_DEBUG(R"({} detected network is "{}")", self->session_->log_prefix(), self->origin_.options().network);
543
- } else {
544
- CB_LOG_INFO(R"({} detected network is "{}")", self->session_->log_prefix(), self->origin_.options().network);
545
- }
546
- }
547
- if (self->origin_.options().network != "default") {
548
- self->origin_.set_nodes_from_config(config);
549
- CB_LOG_INFO("replace list of bootstrap nodes with addresses of alternative network \"{}\": [{}]",
550
- self->origin_.options().network,
551
- utils::join_strings(self->origin_.get_nodes(), ","));
552
- }
553
- self->session_manager_->set_configuration(config, self->origin_.options());
554
- self->session_->on_configuration_update(self->session_manager_);
555
- self->session_->on_stop([self]() {
556
- if (self->session_) {
557
- self->session_.reset();
558
- }
559
- });
560
- }
561
- if (ec) {
562
- return self->close([ec, handler = std::move(handler)]() mutable { handler(ec); });
563
- }
564
- handler(ec);
565
- });
566
- }
567
539
 
568
- void with_bucket_configuration(const std::string& bucket_name,
569
- utils::movable_function<void(std::error_code, topology::configuration)>&& handler)
570
- {
571
- if (stopped_) {
572
- return handler(errc::network::cluster_closed, {});
540
+ if (const auto certificates = default_ca::mozilla_ca_certs();
541
+ !origin_.options().disable_mozilla_ca_certificates && !certificates.empty()) {
542
+ CB_LOG_DEBUG("[{}]: loading {} CA certificates from Mozilla bundle. Update date: \"{}\", "
543
+ "SHA256: \"{}\"",
544
+ id_,
545
+ certificates.size(),
546
+ default_ca::mozilla_ca_certs_date(),
547
+ default_ca::mozilla_ca_certs_sha256());
548
+ for (const auto& cert : certificates) {
549
+ tls_.add_certificate_authority(asio::const_buffer(cert.body.data(), cert.body.size()),
550
+ ec);
551
+ if (ec) {
552
+ CB_LOG_WARNING("[{}]: unable to load CA \"{}\" from Mozilla bundle: {}",
553
+ id_,
554
+ cert.authority,
555
+ ec.message());
556
+ }
557
+ }
573
558
  }
574
- if (auto bucket = find_bucket_by_name(bucket_name); bucket != nullptr) {
575
- return bucket->with_configuration(std::move(handler));
559
+ } else { // trust certificate is explicitly specified
560
+ std::error_code ec{};
561
+ // load only the explicit certificate
562
+ // system and default capella certificates are not loaded
563
+ if (!origin_.options().trust_certificate_value.empty()) {
564
+ CB_LOG_DEBUG(R"([{}]: use TLS certificate passed through via options object)", id_);
565
+ tls_.add_certificate_authority(
566
+ asio::const_buffer(origin_.options().trust_certificate_value.data(),
567
+ origin_.options().trust_certificate_value.size()),
568
+ ec);
569
+ if (ec) {
570
+ CB_LOG_WARNING(
571
+ "[{}]: unable to load CA passed via options object: {}", id_, ec.message());
572
+ }
576
573
  }
577
- return handler(errc::common::bucket_not_found, {});
578
- }
579
-
580
- void ping(std::optional<std::string> report_id,
581
- std::optional<std::string> bucket_name,
582
- std::set<service_type> services,
583
- std::optional<std::chrono::milliseconds> timeout,
584
- utils::movable_function<void(diag::ping_result)> handler)
585
- {
586
- if (!report_id) {
587
- report_id = std::make_optional(uuid::to_string(uuid::random()));
574
+ if (!origin_.options().trust_certificate.empty()) {
575
+ CB_LOG_DEBUG(
576
+ R"([{}]: use TLS verify file: "{}")", id_, origin_.options().trust_certificate);
577
+ tls_.load_verify_file(origin_.options().trust_certificate, ec);
578
+ if (ec) {
579
+ CB_LOG_ERROR("[{}]: unable to load verify file \"{}\": {}",
580
+ id_,
581
+ origin_.options().trust_certificate,
582
+ ec.message());
583
+ return close([ec, handler = std::move(handler)]() mutable {
584
+ return handler(ec);
585
+ });
586
+ }
588
587
  }
589
- if (stopped_) {
590
- return handler({ report_id.value(), meta::sdk_id() });
588
+ }
589
+ if (origin_.credentials().uses_certificate()) {
590
+ std::error_code ec{};
591
+ CB_LOG_DEBUG(R"([{}]: use TLS certificate chain: "{}")", id_, origin_.certificate_path());
592
+ tls_.use_certificate_chain_file(origin_.certificate_path(), ec);
593
+ if (ec) {
594
+ CB_LOG_ERROR("[{}]: unable to load certificate chain \"{}\": {}",
595
+ id_,
596
+ origin_.certificate_path(),
597
+ ec.message());
598
+ return close([ec, handler = std::move(handler)]() mutable {
599
+ return handler(ec);
600
+ });
591
601
  }
592
- if (services.empty()) {
593
- services = {
594
- service_type::key_value, service_type::view, service_type::query, service_type::search,
595
- service_type::analytics, service_type::management, service_type::eventing,
596
- };
602
+ CB_LOG_DEBUG(R"([{}]: use TLS private key: "{}")", id_, origin_.key_path());
603
+ tls_.use_private_key_file(origin_.key_path(), asio::ssl::context::file_format::pem, ec);
604
+ if (ec) {
605
+ CB_LOG_ERROR(
606
+ "[{}]: unable to load private key \"{}\": {}", id_, origin_.key_path(), ec.message());
607
+ return close([ec, handler = std::move(handler)]() mutable {
608
+ return handler(ec);
609
+ });
597
610
  }
598
- asio::post(asio::bind_executor(
599
- ctx_, [cluster = shared_from_this(), report_id, bucket_name, services, timeout, handler = std::move(handler)]() mutable {
600
- auto collector = std::make_shared<ping_collector_impl>(report_id.value(), std::move(handler));
601
- if (bucket_name) {
602
- if (services.find(service_type::key_value) != services.end()) {
603
- if (auto bucket = cluster->find_bucket_by_name(bucket_name.value()); bucket) {
604
- return bucket->ping(collector, timeout);
605
- }
606
- cluster->open_bucket(bucket_name.value(), [collector, cluster, bucket_name, timeout](std::error_code ec) {
607
- if (!ec) {
608
- if (auto bucket = cluster->find_bucket_by_name(bucket_name.value()); bucket) {
609
- return bucket->ping(collector, timeout);
610
- }
611
- }
612
- });
613
- }
614
- } else {
615
- if (services.find(service_type::key_value) != services.end()) {
616
- if (cluster->session_) {
617
- cluster->session_->ping(collector->build_reporter(), timeout);
618
- }
619
- cluster->for_each_bucket([&collector, &timeout](auto bucket) { bucket->ping(collector, timeout); });
620
- }
621
- cluster->session_manager_->ping(services, timeout, collector, cluster->origin_.credentials());
622
- }
623
- }));
611
+ }
612
+ session_ = io::mcbp_session(id_, ctx_, tls_, origin_, dns_srv_tracker_);
613
+ } else {
614
+ session_ = io::mcbp_session(id_, ctx_, origin_, dns_srv_tracker_);
624
615
  }
625
-
626
- void diagnostics(std::optional<std::string> report_id, utils::movable_function<void(diag::diagnostics_result)>&& handler)
627
- {
628
- if (!report_id) {
629
- report_id = std::make_optional(uuid::to_string(uuid::random()));
616
+ session_->bootstrap([self = shared_from_this(), handler = std::move(handler)](
617
+ std::error_code ec, const topology::configuration& config) mutable {
618
+ if (!ec) {
619
+ if (self->origin_.options().network == "auto") {
620
+ self->origin_.options().network =
621
+ config.select_network(self->session_->bootstrap_hostname());
622
+ if (self->origin_.options().network == "default") {
623
+ CB_LOG_DEBUG(R"({} detected network is "{}")",
624
+ self->session_->log_prefix(),
625
+ self->origin_.options().network);
626
+ } else {
627
+ CB_LOG_INFO(R"({} detected network is "{}")",
628
+ self->session_->log_prefix(),
629
+ self->origin_.options().network);
630
+ }
630
631
  }
631
- if (stopped_) {
632
- return handler({ report_id.value(), couchbase::core::meta::sdk_id() });
632
+ if (self->origin_.options().network != "default") {
633
+ self->origin_.set_nodes_from_config(config);
634
+ CB_LOG_INFO(
635
+ "replace list of bootstrap nodes with addresses of alternative network \"{}\": [{}]",
636
+ self->origin_.options().network,
637
+ utils::join_strings(self->origin_.get_nodes(), ","));
633
638
  }
634
- asio::post(asio::bind_executor(ctx_, [self = shared_from_this(), report_id, handler = std::move(handler)]() mutable {
635
- diag::diagnostics_result res{ report_id.value(), couchbase::core::meta::sdk_id() };
636
- if (self->session_) {
637
- res.services[service_type::key_value].emplace_back(self->session_->diag_info());
638
- }
639
- self->for_each_bucket([&res](const auto& bucket) { bucket->export_diag_info(res); });
640
- self->session_manager_->export_diag_info(res);
641
- handler(std::move(res));
642
- }));
639
+ self->session_manager_->set_configuration(config, self->origin_.options());
640
+ self->session_->on_configuration_update(self->session_manager_);
641
+ self->session_->on_stop([self]() {
642
+ if (self->session_) {
643
+ self->session_.reset();
644
+ }
645
+ });
646
+ }
647
+ if (ec) {
648
+ return self->close([ec, handler = std::move(handler)]() mutable {
649
+ handler(ec);
650
+ });
651
+ }
652
+ handler(ec);
653
+ });
654
+ }
655
+
656
+ void with_bucket_configuration(
657
+ const std::string& bucket_name,
658
+ utils::movable_function<void(std::error_code, topology::configuration)>&& handler)
659
+ {
660
+ if (stopped_) {
661
+ return handler(errc::network::cluster_closed, {});
662
+ }
663
+ if (auto bucket = find_bucket_by_name(bucket_name); bucket != nullptr) {
664
+ return bucket->with_configuration(std::move(handler));
643
665
  }
666
+ return open_bucket(
667
+ bucket_name,
668
+ [self = shared_from_this(), bucket_name, handler = std::move(handler)](auto ec) mutable {
669
+ if (ec) {
670
+ return handler(ec, {});
671
+ }
644
672
 
645
- void close(utils::movable_function<void()>&& handler)
646
- {
647
- if (stopped_) {
648
- return handler();
673
+ if (auto bucket = self->find_bucket_by_name(bucket_name); bucket != nullptr) {
674
+ return bucket->with_configuration(std::move(handler));
675
+ } else {
676
+ return handler(errc::common::bucket_not_found, {});
649
677
  }
650
- stopped_ = true;
651
- asio::post(asio::bind_executor(ctx_, [self = shared_from_this(), handler = std::move(handler)]() mutable {
652
- if (self->session_) {
653
- self->session_->stop(retry_reason::do_not_retry);
654
- self->session_.reset();
655
- }
656
- self->for_each_bucket([](auto bucket) { bucket->close(); });
657
- self->session_manager_->close();
658
- handler();
659
- self->work_.reset();
660
- if (self->tracer_) {
661
- self->tracer_->stop();
678
+ });
679
+ }
680
+
681
+ void ping(std::optional<std::string> report_id,
682
+ std::optional<std::string> bucket_name,
683
+ std::set<service_type> services,
684
+ std::optional<std::chrono::milliseconds> timeout,
685
+ utils::movable_function<void(diag::ping_result)> handler)
686
+ {
687
+ if (!report_id) {
688
+ report_id = std::make_optional(uuid::to_string(uuid::random()));
689
+ }
690
+ if (stopped_) {
691
+ return handler({ report_id.value(), meta::sdk_id() });
692
+ }
693
+ if (services.empty()) {
694
+ services = {
695
+ service_type::key_value, service_type::view, service_type::query,
696
+ service_type::search, service_type::analytics, service_type::management,
697
+ service_type::eventing,
698
+ };
699
+ }
700
+ asio::post(asio::bind_executor(
701
+ ctx_,
702
+ [cluster = shared_from_this(),
703
+ report_id,
704
+ bucket_name,
705
+ services,
706
+ timeout,
707
+ handler = std::move(handler)]() mutable {
708
+ auto collector =
709
+ std::make_shared<ping_collector_impl>(report_id.value(), std::move(handler));
710
+ if (bucket_name) {
711
+ if (services.find(service_type::key_value) != services.end()) {
712
+ if (auto bucket = cluster->find_bucket_by_name(bucket_name.value()); bucket) {
713
+ return bucket->ping(collector, timeout);
662
714
  }
663
- self->tracer_.reset();
664
- if (self->meter_) {
665
- self->meter_->stop();
715
+ cluster->open_bucket(
716
+ bucket_name.value(), [collector, cluster, bucket_name, timeout](std::error_code ec) {
717
+ if (!ec) {
718
+ if (auto bucket = cluster->find_bucket_by_name(bucket_name.value()); bucket) {
719
+ return bucket->ping(collector, timeout);
720
+ }
721
+ }
722
+ });
723
+ }
724
+ } else {
725
+ if (services.find(service_type::key_value) != services.end()) {
726
+ if (cluster->session_) {
727
+ cluster->session_->ping(collector->build_reporter(), timeout);
666
728
  }
667
- self->meter_.reset();
668
- }));
669
- }
670
-
671
- auto direct_dispatch(const std::string& bucket_name, std::shared_ptr<couchbase::core::mcbp::queue_request> req) -> std::error_code
672
- {
673
- if (stopped_) {
674
- return errc::network::cluster_closed;
675
- }
676
- if (bucket_name.empty()) {
677
- return errc::common::invalid_argument;
729
+ cluster->for_each_bucket([&collector, &timeout](auto bucket) {
730
+ bucket->ping(collector, timeout);
731
+ });
732
+ }
733
+ cluster->session_manager_->ping(
734
+ services, timeout, collector, cluster->origin_.credentials());
678
735
  }
679
- if (auto bucket = find_bucket_by_name(bucket_name); bucket != nullptr) {
680
- return bucket->direct_dispatch(std::move(req));
736
+ }));
737
+ }
738
+
739
+ void diagnostics(std::optional<std::string> report_id,
740
+ utils::movable_function<void(diag::diagnostics_result)>&& handler)
741
+ {
742
+ if (!report_id) {
743
+ report_id = std::make_optional(uuid::to_string(uuid::random()));
744
+ }
745
+ if (stopped_) {
746
+ return handler({ report_id.value(), couchbase::core::meta::sdk_id() });
747
+ }
748
+ asio::post(asio::bind_executor(
749
+ ctx_, [self = shared_from_this(), report_id, handler = std::move(handler)]() mutable {
750
+ diag::diagnostics_result res{ report_id.value(), couchbase::core::meta::sdk_id() };
751
+ if (self->session_) {
752
+ res.services[service_type::key_value].emplace_back(self->session_->diag_info());
681
753
  }
682
-
683
- open_bucket(bucket_name, [self = shared_from_this(), req = std::move(req), bucket_name](std::error_code ec) mutable {
684
- if (ec) {
685
- return req->cancel(ec);
686
- }
687
- self->direct_dispatch(bucket_name, std::move(req));
754
+ self->for_each_bucket([&res](const auto& bucket) {
755
+ bucket->export_diag_info(res);
688
756
  });
689
- return {};
757
+ self->session_manager_->export_diag_info(res);
758
+ handler(std::move(res));
759
+ }));
760
+ }
761
+
762
+ void close(utils::movable_function<void()>&& handler)
763
+ {
764
+ if (stopped_) {
765
+ return handler();
690
766
  }
691
-
692
- auto direct_re_queue(const std::string& bucket_name, std::shared_ptr<mcbp::queue_request> req, bool is_retry) -> std::error_code
693
- {
694
- if (stopped_) {
695
- return errc::network::cluster_closed;
767
+ stopped_ = true;
768
+ asio::post(asio::bind_executor(
769
+ ctx_, [self = shared_from_this(), handler = std::move(handler)]() mutable {
770
+ if (self->session_) {
771
+ self->session_->stop(retry_reason::do_not_retry);
772
+ self->session_.reset();
696
773
  }
697
- if (bucket_name.empty()) {
698
- return errc::common::invalid_argument;
774
+ self->for_each_bucket([](auto bucket) {
775
+ bucket->close();
776
+ });
777
+ self->session_manager_->close();
778
+ self->work_.reset();
779
+ if (self->tracer_) {
780
+ self->tracer_->stop();
699
781
  }
700
- if (auto bucket = find_bucket_by_name(bucket_name); bucket != nullptr) {
701
- return bucket->direct_re_queue(std::move(req), is_retry);
782
+ self->tracer_.reset();
783
+ if (self->meter_) {
784
+ self->meter_->stop();
702
785
  }
786
+ self->meter_.reset();
787
+ handler();
788
+ }));
789
+ }
790
+
791
+ auto direct_dispatch(const std::string& bucket_name,
792
+ std::shared_ptr<couchbase::core::mcbp::queue_request> req) -> std::error_code
793
+ {
794
+ if (stopped_) {
795
+ return errc::network::cluster_closed;
796
+ }
797
+ if (bucket_name.empty()) {
798
+ return errc::common::invalid_argument;
799
+ }
800
+ if (auto bucket = find_bucket_by_name(bucket_name); bucket != nullptr) {
801
+ return bucket->direct_dispatch(std::move(req));
802
+ }
703
803
 
704
- open_bucket(bucket_name, [self = shared_from_this(), bucket_name, req = std::move(req), is_retry](std::error_code ec) mutable {
705
- if (ec) {
706
- return req->cancel(ec);
707
- }
708
- self->direct_re_queue(bucket_name, std::move(req), is_retry);
709
- });
710
- return {};
804
+ open_bucket(
805
+ bucket_name,
806
+ [self = shared_from_this(), req = std::move(req), bucket_name](std::error_code ec) mutable {
807
+ if (ec) {
808
+ return req->cancel(ec);
809
+ }
810
+ self->direct_dispatch(bucket_name, std::move(req));
811
+ });
812
+ return {};
813
+ }
814
+
815
+ auto direct_re_queue(const std::string& bucket_name,
816
+ std::shared_ptr<mcbp::queue_request> req,
817
+ bool is_retry) -> std::error_code
818
+ {
819
+ if (stopped_) {
820
+ return errc::network::cluster_closed;
821
+ }
822
+ if (bucket_name.empty()) {
823
+ return errc::common::invalid_argument;
824
+ }
825
+ if (auto bucket = find_bucket_by_name(bucket_name); bucket != nullptr) {
826
+ return bucket->direct_re_queue(std::move(req), is_retry);
711
827
  }
712
828
 
713
- private:
714
- std::string id_{ uuid::to_string(uuid::random()) };
715
- asio::io_context& ctx_;
716
- asio::executor_work_guard<asio::io_context::executor_type> work_;
717
- asio::ssl::context tls_{ asio::ssl::context::tls_client };
718
- std::shared_ptr<io::http_session_manager> session_manager_;
719
- std::optional<io::mcbp_session> session_{};
720
- std::shared_ptr<impl::dns_srv_tracker> dns_srv_tracker_{};
721
- std::mutex buckets_mutex_{};
722
- std::map<std::string, std::shared_ptr<bucket>> buckets_{};
723
- couchbase::core::origin origin_{};
724
- std::shared_ptr<couchbase::tracing::request_tracer> tracer_{ nullptr };
725
- std::shared_ptr<couchbase::metrics::meter> meter_{ nullptr };
726
- std::atomic_bool stopped_{ false };
829
+ open_bucket(bucket_name,
830
+ [self = shared_from_this(), bucket_name, req = std::move(req), is_retry](
831
+ std::error_code ec) mutable {
832
+ if (ec) {
833
+ return req->cancel(ec);
834
+ }
835
+ self->direct_re_queue(bucket_name, std::move(req), is_retry);
836
+ });
837
+ return {};
838
+ }
839
+
840
+ private:
841
+ std::string id_{ uuid::to_string(uuid::random()) };
842
+ asio::io_context& ctx_;
843
+ asio::executor_work_guard<asio::io_context::executor_type> work_;
844
+ asio::ssl::context tls_{ asio::ssl::context::tls_client };
845
+ std::shared_ptr<io::http_session_manager> session_manager_;
846
+ std::optional<io::mcbp_session> session_{};
847
+ std::shared_ptr<impl::dns_srv_tracker> dns_srv_tracker_{};
848
+ std::mutex buckets_mutex_{};
849
+ std::map<std::string, std::shared_ptr<bucket>> buckets_{};
850
+ couchbase::core::origin origin_{};
851
+ std::shared_ptr<couchbase::tracing::request_tracer> tracer_{ nullptr };
852
+ std::shared_ptr<couchbase::metrics::meter> meter_{ nullptr };
853
+ std::atomic_bool stopped_{ false };
727
854
  };
728
855
 
729
856
  cluster::cluster(asio::io_context& ctx)
@@ -732,53 +859,60 @@ cluster::cluster(asio::io_context& ctx)
732
859
  }
733
860
 
734
861
  auto
735
- cluster::direct_dispatch(const std::string& bucket_name, std::shared_ptr<couchbase::core::mcbp::queue_request> req) const -> std::error_code
862
+ cluster::direct_dispatch(const std::string& bucket_name,
863
+ std::shared_ptr<couchbase::core::mcbp::queue_request> req) const
864
+ -> std::error_code
736
865
  {
737
- if (impl_) {
738
- return impl_->direct_dispatch(bucket_name, std::move(req));
739
- }
740
- return errc::network::cluster_closed;
866
+ if (impl_) {
867
+ return impl_->direct_dispatch(bucket_name, std::move(req));
868
+ }
869
+ return errc::network::cluster_closed;
741
870
  }
742
871
 
743
872
  auto
744
- cluster::direct_re_queue(const std::string& bucket_name, std::shared_ptr<mcbp::queue_request> req, bool is_retry) const -> std::error_code
873
+ cluster::direct_re_queue(const std::string& bucket_name,
874
+ std::shared_ptr<mcbp::queue_request> req,
875
+ bool is_retry) const -> std::error_code
745
876
  {
746
- if (impl_) {
747
- return impl_->direct_re_queue(bucket_name, std::move(req), is_retry);
748
- }
749
- return errc::network::cluster_closed;
877
+ if (impl_) {
878
+ return impl_->direct_re_queue(bucket_name, std::move(req), is_retry);
879
+ }
880
+ return errc::network::cluster_closed;
750
881
  }
751
882
 
752
883
  void
753
884
  cluster::close(utils::movable_function<void()>&& handler) const
754
885
  {
755
- if (impl_) {
756
- impl_->close(std::move(handler));
757
- }
886
+ if (impl_) {
887
+ impl_->close(std::move(handler));
888
+ }
758
889
  }
759
890
 
760
891
  void
761
- cluster::open_bucket(const std::string& bucket_name, utils::movable_function<void(std::error_code)>&& handler) const
892
+ cluster::open_bucket(const std::string& bucket_name,
893
+ utils::movable_function<void(std::error_code)>&& handler) const
762
894
  {
763
- if (impl_) {
764
- impl_->open_bucket(bucket_name, std::move(handler));
765
- }
895
+ if (impl_) {
896
+ impl_->open_bucket(bucket_name, std::move(handler));
897
+ }
766
898
  }
767
899
 
768
900
  void
769
- cluster::open(couchbase::core::origin origin, utils::movable_function<void(std::error_code)>&& handler) const
901
+ cluster::open(couchbase::core::origin origin,
902
+ utils::movable_function<void(std::error_code)>&& handler) const
770
903
  {
771
- if (impl_) {
772
- impl_->open(std::move(origin), std::move(handler));
773
- }
904
+ if (impl_) {
905
+ impl_->open(std::move(origin), std::move(handler));
906
+ }
774
907
  }
775
908
 
776
909
  void
777
- cluster::diagnostics(std::optional<std::string> report_id, utils::movable_function<void(diag::diagnostics_result)>&& handler) const
910
+ cluster::diagnostics(std::optional<std::string> report_id,
911
+ utils::movable_function<void(diag::diagnostics_result)>&& handler) const
778
912
  {
779
- if (impl_) {
780
- impl_->diagnostics(std::move(report_id), std::move(handler));
781
- }
913
+ if (impl_) {
914
+ impl_->diagnostics(std::move(report_id), std::move(handler));
915
+ }
782
916
  }
783
917
 
784
918
  void
@@ -788,829 +922,1008 @@ cluster::ping(std::optional<std::string> report_id,
788
922
  std::optional<std::chrono::milliseconds> timeout,
789
923
  utils::movable_function<void(diag::ping_result)>&& handler) const
790
924
  {
791
- if (impl_) {
792
- impl_->ping(std::move(report_id), std::move(bucket_name), std::move(services), std::move(timeout), std::move(handler));
793
- }
925
+ if (impl_) {
926
+ impl_->ping(std::move(report_id),
927
+ std::move(bucket_name),
928
+ std::move(services),
929
+ std::move(timeout),
930
+ std::move(handler));
931
+ }
794
932
  }
795
933
 
796
934
  void
797
- cluster::with_bucket_configuration(const std::string& bucket_name,
798
- utils::movable_function<void(std::error_code, topology::configuration)>&& handler) const
935
+ cluster::with_bucket_configuration(
936
+ const std::string& bucket_name,
937
+ utils::movable_function<void(std::error_code, topology::configuration)>&& handler) const
799
938
  {
800
- if (impl_) {
801
- impl_->with_bucket_configuration(bucket_name, std::move(handler));
802
- }
939
+ if (impl_) {
940
+ impl_->with_bucket_configuration(bucket_name, std::move(handler));
941
+ }
803
942
  }
804
943
 
805
944
  void
806
- cluster::close_bucket(const std::string& bucket_name, utils::movable_function<void(std::error_code)>&& handler) const
945
+ cluster::close_bucket(const std::string& bucket_name,
946
+ utils::movable_function<void(std::error_code)>&& handler) const
807
947
  {
808
- if (impl_) {
809
- impl_->close_bucket(bucket_name, std::move(handler));
810
- }
948
+ if (impl_) {
949
+ impl_->close_bucket(bucket_name, std::move(handler));
950
+ }
811
951
  }
812
952
 
813
953
  std::pair<std::error_code, couchbase::core::origin>
814
954
  cluster::origin() const
815
955
  {
816
- if (impl_) {
817
- return impl_->origin();
818
- }
819
- return { errc::network::cluster_closed, {} };
956
+ if (impl_) {
957
+ return impl_->origin();
958
+ }
959
+ return { errc::network::cluster_closed, {} };
820
960
  }
821
961
 
822
962
  auto
823
963
  cluster::io_context() const -> asio::io_context&
824
964
  {
825
- return impl_->io_context();
965
+ return impl_->io_context();
826
966
  }
827
967
 
828
968
  void
829
- cluster::execute(operations::append_request request, utils::movable_function<void(operations::append_response)>&& handler) const
969
+ cluster::execute(operations::append_request request,
970
+ utils::movable_function<void(operations::append_response)>&& handler) const
830
971
  {
831
- return impl_->execute(std::move(request), std::move(handler));
972
+ return impl_->execute(std::move(request), std::move(handler));
832
973
  }
833
974
 
834
975
  void
835
- cluster::execute(operations::decrement_request request, utils::movable_function<void(operations::decrement_response)>&& handler) const
976
+ cluster::execute(operations::decrement_request request,
977
+ utils::movable_function<void(operations::decrement_response)>&& handler) const
836
978
  {
837
- return impl_->execute(std::move(request), std::move(handler));
979
+ return impl_->execute(std::move(request), std::move(handler));
838
980
  }
839
981
 
840
982
  void
841
- cluster::execute(operations::exists_request request, utils::movable_function<void(operations::exists_response)>&& handler) const
983
+ cluster::execute(operations::exists_request request,
984
+ utils::movable_function<void(operations::exists_response)>&& handler) const
842
985
  {
843
- return impl_->execute(std::move(request), std::move(handler));
986
+ return impl_->execute(std::move(request), std::move(handler));
844
987
  }
845
988
 
846
989
  void
847
- cluster::execute(operations::get_request request, utils::movable_function<void(operations::get_response)>&& handler) const
990
+ cluster::execute(operations::get_request request,
991
+ utils::movable_function<void(operations::get_response)>&& handler) const
848
992
  {
849
- return impl_->execute(std::move(request), std::move(handler));
993
+ return impl_->execute(std::move(request), std::move(handler));
850
994
  }
851
995
 
852
996
  void
853
- cluster::execute(operations::get_all_replicas_request request,
854
- utils::movable_function<void(operations::get_all_replicas_response)>&& handler) const
997
+ cluster::execute(
998
+ operations::get_all_replicas_request request,
999
+ utils::movable_function<void(operations::get_all_replicas_response)>&& handler) const
855
1000
  {
856
- return request.execute(impl_, std::move(handler));
1001
+ auto bucket_name = request.id.bucket();
1002
+ return open_bucket(
1003
+ bucket_name,
1004
+ [impl = impl_, request = std::move(request), handler = std::move(handler)](auto ec) mutable {
1005
+ if (ec) {
1006
+ return handler(
1007
+ operations::get_all_replicas_response{ make_key_value_error_context(ec, request.id) });
1008
+ }
1009
+ return request.execute(impl, std::move(handler));
1010
+ });
857
1011
  }
858
1012
 
859
1013
  void
860
- cluster::execute(operations::get_and_lock_request request, utils::movable_function<void(operations::get_and_lock_response)>&& handler) const
1014
+ cluster::execute(operations::get_and_lock_request request,
1015
+ utils::movable_function<void(operations::get_and_lock_response)>&& handler) const
861
1016
  {
862
- return impl_->execute(std::move(request), std::move(handler));
1017
+ return impl_->execute(std::move(request), std::move(handler));
863
1018
  }
864
1019
 
865
1020
  void
866
1021
  cluster::execute(operations::get_and_touch_request request,
867
1022
  utils::movable_function<void(operations::get_and_touch_response)>&& handler) const
868
1023
  {
869
- return impl_->execute(std::move(request), std::move(handler));
1024
+ return impl_->execute(std::move(request), std::move(handler));
870
1025
  }
871
1026
 
872
1027
  void
873
- cluster::execute(operations::get_any_replica_request request,
874
- utils::movable_function<void(operations::get_any_replica_response)>&& handler) const
1028
+ cluster::execute(
1029
+ operations::get_any_replica_request request,
1030
+ utils::movable_function<void(operations::get_any_replica_response)>&& handler) const
875
1031
  {
876
- return request.execute(impl_, std::move(handler));
1032
+ auto bucket_name = request.id.bucket();
1033
+ return open_bucket(
1034
+ bucket_name,
1035
+ [impl = impl_, request = std::move(request), handler = std::move(handler)](auto ec) mutable {
1036
+ if (ec) {
1037
+ return handler(
1038
+ operations::get_any_replica_response{ make_key_value_error_context(ec, request.id) });
1039
+ }
1040
+ return request.execute(impl, std::move(handler));
1041
+ });
877
1042
  }
878
1043
 
879
1044
  void
880
1045
  cluster::execute(operations::get_projected_request request,
881
1046
  utils::movable_function<void(operations::get_projected_response)>&& handler) const
882
1047
  {
883
- return impl_->execute(std::move(request), std::move(handler));
1048
+ return impl_->execute(std::move(request), std::move(handler));
884
1049
  }
885
1050
 
886
1051
  void
887
- cluster::execute(operations::increment_request request, utils::movable_function<void(operations::increment_response)>&& handler) const
1052
+ cluster::execute(operations::increment_request request,
1053
+ utils::movable_function<void(operations::increment_response)>&& handler) const
888
1054
  {
889
- return impl_->execute(std::move(request), std::move(handler));
1055
+ return impl_->execute(std::move(request), std::move(handler));
890
1056
  }
891
1057
 
892
1058
  void
893
- cluster::execute(operations::insert_request request, utils::movable_function<void(operations::insert_response)>&& handler) const
1059
+ cluster::execute(operations::insert_request request,
1060
+ utils::movable_function<void(operations::insert_response)>&& handler) const
894
1061
  {
895
- return impl_->execute(std::move(request), std::move(handler));
1062
+ return impl_->execute(std::move(request), std::move(handler));
896
1063
  }
897
1064
 
898
1065
  void
899
- cluster::execute(operations::lookup_in_request request, utils::movable_function<void(operations::lookup_in_response)>&& handler) const
1066
+ cluster::execute(operations::lookup_in_request request,
1067
+ utils::movable_function<void(operations::lookup_in_response)>&& handler) const
900
1068
  {
901
- return impl_->execute(std::move(request), std::move(handler));
1069
+ return impl_->execute(std::move(request), std::move(handler));
902
1070
  }
903
1071
 
904
1072
  void
905
- cluster::execute(operations::lookup_in_any_replica_request request,
906
- utils::movable_function<void(operations::lookup_in_any_replica_response)>&& handler) const
1073
+ cluster::execute(
1074
+ operations::lookup_in_any_replica_request request,
1075
+ utils::movable_function<void(operations::lookup_in_any_replica_response)>&& handler) const
907
1076
  {
908
- return request.execute(impl_, std::move(handler));
1077
+ return request.execute(impl_, std::move(handler));
909
1078
  }
910
1079
 
911
1080
  void
912
- cluster::execute(operations::lookup_in_all_replicas_request request,
913
- utils::movable_function<void(operations::lookup_in_all_replicas_response)>&& handler) const
1081
+ cluster::execute(
1082
+ operations::lookup_in_all_replicas_request request,
1083
+ utils::movable_function<void(operations::lookup_in_all_replicas_response)>&& handler) const
914
1084
  {
915
- return request.execute(impl_, std::move(handler));
1085
+ return request.execute(impl_, std::move(handler));
916
1086
  }
917
1087
 
918
1088
  void
919
- cluster::execute(operations::mutate_in_request request, utils::movable_function<void(operations::mutate_in_response)>&& handler) const
1089
+ cluster::execute(operations::mutate_in_request request,
1090
+ utils::movable_function<void(operations::mutate_in_response)>&& handler) const
920
1091
  {
921
- return impl_->execute(std::move(request), std::move(handler));
1092
+ return impl_->execute(std::move(request), std::move(handler));
922
1093
  }
923
1094
 
924
1095
  void
925
- cluster::execute(operations::prepend_request request, utils::movable_function<void(operations::prepend_response)>&& handler) const
1096
+ cluster::execute(operations::prepend_request request,
1097
+ utils::movable_function<void(operations::prepend_response)>&& handler) const
926
1098
  {
927
- return impl_->execute(std::move(request), std::move(handler));
1099
+ return impl_->execute(std::move(request), std::move(handler));
928
1100
  }
929
1101
 
930
1102
  void
931
- cluster::execute(operations::query_request request, utils::movable_function<void(operations::query_response)>&& handler) const
1103
+ cluster::execute(operations::query_request request,
1104
+ utils::movable_function<void(operations::query_response)>&& handler) const
932
1105
  {
933
- return impl_->execute(std::move(request), std::move(handler));
1106
+ return impl_->execute(std::move(request), std::move(handler));
934
1107
  }
935
1108
 
936
1109
  void
937
- cluster::execute(operations::remove_request request, utils::movable_function<void(operations::remove_response)>&& handler) const
1110
+ cluster::execute(operations::remove_request request,
1111
+ utils::movable_function<void(operations::remove_response)>&& handler) const
938
1112
  {
939
- return impl_->execute(std::move(request), std::move(handler));
1113
+ return impl_->execute(std::move(request), std::move(handler));
940
1114
  }
941
1115
 
942
1116
  void
943
- cluster::execute(operations::replace_request request, utils::movable_function<void(operations::replace_response)>&& handler) const
1117
+ cluster::execute(operations::replace_request request,
1118
+ utils::movable_function<void(operations::replace_response)>&& handler) const
944
1119
  {
945
- return impl_->execute(std::move(request), std::move(handler));
1120
+ return impl_->execute(std::move(request), std::move(handler));
946
1121
  }
947
1122
 
948
1123
  void
949
- cluster::execute(operations::search_request request, utils::movable_function<void(operations::search_response)>&& handler) const
1124
+ cluster::execute(operations::search_request request,
1125
+ utils::movable_function<void(operations::search_response)>&& handler) const
950
1126
  {
951
- return impl_->execute(std::move(request), std::move(handler));
1127
+ return impl_->execute(std::move(request), std::move(handler));
952
1128
  }
953
1129
 
954
1130
  void
955
- cluster::execute(operations::touch_request request, utils::movable_function<void(operations::touch_response)>&& handler) const
1131
+ cluster::execute(operations::touch_request request,
1132
+ utils::movable_function<void(operations::touch_response)>&& handler) const
956
1133
  {
957
- return impl_->execute(std::move(request), std::move(handler));
1134
+ return impl_->execute(std::move(request), std::move(handler));
958
1135
  }
959
1136
 
960
1137
  void
961
- cluster::execute(operations::unlock_request request, utils::movable_function<void(operations::unlock_response)>&& handler) const
1138
+ cluster::execute(operations::unlock_request request,
1139
+ utils::movable_function<void(operations::unlock_response)>&& handler) const
962
1140
  {
963
- return impl_->execute(std::move(request), std::move(handler));
1141
+ return impl_->execute(std::move(request), std::move(handler));
964
1142
  }
965
1143
 
966
1144
  void
967
- cluster::execute(operations::upsert_request request, utils::movable_function<void(operations::upsert_response)>&& handler) const
1145
+ cluster::execute(operations::upsert_request request,
1146
+ utils::movable_function<void(operations::upsert_response)>&& handler) const
968
1147
  {
969
- return impl_->execute(std::move(request), std::move(handler));
1148
+ return impl_->execute(std::move(request), std::move(handler));
970
1149
  }
971
1150
 
972
1151
  void
973
1152
  cluster::execute(operations::document_view_request request,
974
1153
  utils::movable_function<void(operations::document_view_response)>&& handler) const
975
1154
  {
976
- return impl_->execute(std::move(request), std::move(handler));
1155
+ return impl_->execute(std::move(request), std::move(handler));
977
1156
  }
978
1157
 
979
1158
  void
980
- cluster::execute(operations::http_noop_request request, utils::movable_function<void(operations::http_noop_response)>&& handler) const
1159
+ cluster::execute(operations::http_noop_request request,
1160
+ utils::movable_function<void(operations::http_noop_response)>&& handler) const
981
1161
  {
982
- return impl_->execute(std::move(request), std::move(handler));
1162
+ return impl_->execute(std::move(request), std::move(handler));
983
1163
  }
984
1164
 
985
1165
  void
986
- cluster::execute(operations::management::analytics_dataset_create_request request,
987
- utils::movable_function<void(operations::management::analytics_dataset_create_response)>&& handler) const
1166
+ cluster::execute(
1167
+ operations::management::analytics_dataset_create_request request,
1168
+ utils::movable_function<void(operations::management::analytics_dataset_create_response)>&&
1169
+ handler) const
988
1170
  {
989
- return impl_->execute(std::move(request), std::move(handler));
1171
+ return impl_->execute(std::move(request), std::move(handler));
990
1172
  }
991
1173
 
992
1174
  void
993
- cluster::execute(operations::management::analytics_dataset_drop_request request,
994
- utils::movable_function<void(operations::management::analytics_dataset_drop_response)>&& handler) const
1175
+ cluster::execute(
1176
+ operations::management::analytics_dataset_drop_request request,
1177
+ utils::movable_function<void(operations::management::analytics_dataset_drop_response)>&& handler)
1178
+ const
995
1179
  {
996
- return impl_->execute(std::move(request), std::move(handler));
1180
+ return impl_->execute(std::move(request), std::move(handler));
997
1181
  }
998
1182
 
999
1183
  void
1000
- cluster::execute(operations::management::analytics_dataset_get_all_request request,
1001
- utils::movable_function<void(operations::management::analytics_dataset_get_all_response)>&& handler) const
1184
+ cluster::execute(
1185
+ operations::management::analytics_dataset_get_all_request request,
1186
+ utils::movable_function<void(operations::management::analytics_dataset_get_all_response)>&&
1187
+ handler) const
1002
1188
  {
1003
- return impl_->execute(std::move(request), std::move(handler));
1189
+ return impl_->execute(std::move(request), std::move(handler));
1004
1190
  }
1005
1191
 
1006
1192
  void
1007
- cluster::execute(operations::management::analytics_dataverse_create_request request,
1008
- utils::movable_function<void(operations::management::analytics_dataverse_create_response)>&& handler) const
1193
+ cluster::execute(
1194
+ operations::management::analytics_dataverse_create_request request,
1195
+ utils::movable_function<void(operations::management::analytics_dataverse_create_response)>&&
1196
+ handler) const
1009
1197
  {
1010
- return impl_->execute(std::move(request), std::move(handler));
1198
+ return impl_->execute(std::move(request), std::move(handler));
1011
1199
  }
1012
1200
 
1013
1201
  void
1014
- cluster::execute(operations::management::analytics_dataverse_drop_request request,
1015
- utils::movable_function<void(operations::management::analytics_dataverse_drop_response)>&& handler) const
1202
+ cluster::execute(
1203
+ operations::management::analytics_dataverse_drop_request request,
1204
+ utils::movable_function<void(operations::management::analytics_dataverse_drop_response)>&&
1205
+ handler) const
1016
1206
  {
1017
- return impl_->execute(std::move(request), std::move(handler));
1207
+ return impl_->execute(std::move(request), std::move(handler));
1018
1208
  }
1019
1209
 
1020
1210
  void
1021
- cluster::execute(operations::management::analytics_get_pending_mutations_request request,
1022
- utils::movable_function<void(operations::management::analytics_get_pending_mutations_response)>&& handler) const
1211
+ cluster::execute(
1212
+ operations::management::analytics_get_pending_mutations_request request,
1213
+ utils::movable_function<void(operations::management::analytics_get_pending_mutations_response)>&&
1214
+ handler) const
1023
1215
  {
1024
- return impl_->execute(std::move(request), std::move(handler));
1216
+ return impl_->execute(std::move(request), std::move(handler));
1025
1217
  }
1026
1218
 
1027
1219
  void
1028
- cluster::execute(operations::management::analytics_index_create_request request,
1029
- utils::movable_function<void(operations::management::analytics_index_create_response)>&& handler) const
1220
+ cluster::execute(
1221
+ operations::management::analytics_index_create_request request,
1222
+ utils::movable_function<void(operations::management::analytics_index_create_response)>&& handler)
1223
+ const
1030
1224
  {
1031
- return impl_->execute(std::move(request), std::move(handler));
1225
+ return impl_->execute(std::move(request), std::move(handler));
1032
1226
  }
1033
1227
 
1034
1228
  void
1035
- cluster::execute(operations::management::analytics_index_drop_request request,
1036
- utils::movable_function<void(operations::management::analytics_index_drop_response)>&& handler) const
1229
+ cluster::execute(
1230
+ operations::management::analytics_index_drop_request request,
1231
+ utils::movable_function<void(operations::management::analytics_index_drop_response)>&& handler)
1232
+ const
1037
1233
  {
1038
- return impl_->execute(std::move(request), std::move(handler));
1234
+ return impl_->execute(std::move(request), std::move(handler));
1039
1235
  }
1040
1236
 
1041
1237
  void
1042
- cluster::execute(operations::management::analytics_index_get_all_request request,
1043
- utils::movable_function<void(operations::management::analytics_index_get_all_response)>&& handler) const
1238
+ cluster::execute(
1239
+ operations::management::analytics_index_get_all_request request,
1240
+ utils::movable_function<void(operations::management::analytics_index_get_all_response)>&& handler)
1241
+ const
1044
1242
  {
1045
- return impl_->execute(std::move(request), std::move(handler));
1243
+ return impl_->execute(std::move(request), std::move(handler));
1046
1244
  }
1047
1245
 
1048
1246
  void
1049
- cluster::execute(operations::management::analytics_link_connect_request request,
1050
- utils::movable_function<void(operations::management::analytics_link_connect_response)>&& handler) const
1247
+ cluster::execute(
1248
+ operations::management::analytics_link_connect_request request,
1249
+ utils::movable_function<void(operations::management::analytics_link_connect_response)>&& handler)
1250
+ const
1051
1251
  {
1052
- return impl_->execute(std::move(request), std::move(handler));
1252
+ return impl_->execute(std::move(request), std::move(handler));
1053
1253
  }
1054
1254
 
1055
1255
  void
1056
- cluster::execute(operations::management::analytics_link_disconnect_request request,
1057
- utils::movable_function<void(operations::management::analytics_link_disconnect_response)>&& handler) const
1256
+ cluster::execute(
1257
+ operations::management::analytics_link_disconnect_request request,
1258
+ utils::movable_function<void(operations::management::analytics_link_disconnect_response)>&&
1259
+ handler) const
1058
1260
  {
1059
- return impl_->execute(std::move(request), std::move(handler));
1261
+ return impl_->execute(std::move(request), std::move(handler));
1060
1262
  }
1061
1263
 
1062
1264
  void
1063
- cluster::execute(operations::management::analytics_link_drop_request request,
1064
- utils::movable_function<void(operations::management::analytics_link_drop_response)>&& handler) const
1265
+ cluster::execute(
1266
+ operations::management::analytics_link_drop_request request,
1267
+ utils::movable_function<void(operations::management::analytics_link_drop_response)>&& handler)
1268
+ const
1065
1269
  {
1066
- return impl_->execute(std::move(request), std::move(handler));
1270
+ return impl_->execute(std::move(request), std::move(handler));
1067
1271
  }
1068
1272
 
1069
1273
  void
1070
- cluster::execute(operations::management::analytics_link_get_all_request request,
1071
- utils::movable_function<void(operations::management::analytics_link_get_all_response)>&& handler) const
1274
+ cluster::execute(
1275
+ operations::management::analytics_link_get_all_request request,
1276
+ utils::movable_function<void(operations::management::analytics_link_get_all_response)>&& handler)
1277
+ const
1072
1278
  {
1073
- return impl_->execute(std::move(request), std::move(handler));
1279
+ return impl_->execute(std::move(request), std::move(handler));
1074
1280
  }
1075
1281
 
1076
1282
  void
1077
- cluster::execute(operations::management::bucket_create_request request,
1078
- utils::movable_function<void(operations::management::bucket_create_response)>&& handler) const
1283
+ cluster::execute(
1284
+ operations::management::bucket_create_request request,
1285
+ utils::movable_function<void(operations::management::bucket_create_response)>&& handler) const
1079
1286
  {
1080
- return impl_->execute(std::move(request), std::move(handler));
1287
+ return impl_->execute(std::move(request), std::move(handler));
1081
1288
  }
1082
1289
 
1083
1290
  void
1084
- cluster::execute(operations::management::bucket_drop_request request,
1085
- utils::movable_function<void(operations::management::bucket_drop_response)>&& handler) const
1291
+ cluster::execute(
1292
+ operations::management::bucket_drop_request request,
1293
+ utils::movable_function<void(operations::management::bucket_drop_response)>&& handler) const
1086
1294
  {
1087
- return impl_->execute(std::move(request), std::move(handler));
1295
+ return impl_->execute(std::move(request), std::move(handler));
1088
1296
  }
1089
1297
 
1090
1298
  void
1091
- cluster::execute(operations::management::bucket_flush_request request,
1092
- utils::movable_function<void(operations::management::bucket_flush_response)>&& handler) const
1299
+ cluster::execute(
1300
+ operations::management::bucket_flush_request request,
1301
+ utils::movable_function<void(operations::management::bucket_flush_response)>&& handler) const
1093
1302
  {
1094
- return impl_->execute(std::move(request), std::move(handler));
1303
+ return impl_->execute(std::move(request), std::move(handler));
1095
1304
  }
1096
1305
 
1097
1306
  void
1098
- cluster::execute(operations::management::bucket_get_request request,
1099
- utils::movable_function<void(operations::management::bucket_get_response)>&& handler) const
1307
+ cluster::execute(
1308
+ operations::management::bucket_get_request request,
1309
+ utils::movable_function<void(operations::management::bucket_get_response)>&& handler) const
1100
1310
  {
1101
- return impl_->execute(std::move(request), std::move(handler));
1311
+ return impl_->execute(std::move(request), std::move(handler));
1102
1312
  }
1103
1313
 
1104
1314
  void
1105
- cluster::execute(operations::management::bucket_get_all_request request,
1106
- utils::movable_function<void(operations::management::bucket_get_all_response)>&& handler) const
1315
+ cluster::execute(
1316
+ operations::management::bucket_get_all_request request,
1317
+ utils::movable_function<void(operations::management::bucket_get_all_response)>&& handler) const
1107
1318
  {
1108
- return impl_->execute(std::move(request), std::move(handler));
1319
+ return impl_->execute(std::move(request), std::move(handler));
1109
1320
  }
1110
1321
 
1111
1322
  void
1112
- cluster::execute(operations::management::bucket_update_request request,
1113
- utils::movable_function<void(operations::management::bucket_update_response)>&& handler) const
1323
+ cluster::execute(
1324
+ operations::management::bucket_update_request request,
1325
+ utils::movable_function<void(operations::management::bucket_update_response)>&& handler) const
1114
1326
  {
1115
- return impl_->execute(std::move(request), std::move(handler));
1327
+ return impl_->execute(std::move(request), std::move(handler));
1116
1328
  }
1117
1329
 
1118
1330
  void
1119
- cluster::execute(operations::management::collection_create_request request,
1120
- utils::movable_function<void(operations::management::collection_create_response)>&& handler) const
1331
+ cluster::execute(
1332
+ operations::management::collection_create_request request,
1333
+ utils::movable_function<void(operations::management::collection_create_response)>&& handler) const
1121
1334
  {
1122
- if (request.history.has_value()) {
1123
- return impl_->execute_with_bucket_capability_check(std::move(request), bucket_capability::non_deduped_history, std::move(handler));
1124
- }
1125
- return impl_->execute(std::move(request), std::move(handler));
1335
+ if (request.history.has_value()) {
1336
+ return impl_->execute_with_bucket_capability_check(
1337
+ std::move(request), bucket_capability::non_deduped_history, std::move(handler));
1338
+ }
1339
+ return impl_->execute(std::move(request), std::move(handler));
1126
1340
  }
1127
1341
 
1128
1342
  void
1129
- cluster::execute(operations::management::collection_update_request request,
1130
- utils::movable_function<void(operations::management::collection_update_response)>&& handler) const
1343
+ cluster::execute(
1344
+ operations::management::collection_update_request request,
1345
+ utils::movable_function<void(operations::management::collection_update_response)>&& handler) const
1131
1346
  {
1132
- if (request.history.has_value()) {
1133
- return impl_->execute_with_bucket_capability_check(std::move(request), bucket_capability::non_deduped_history, std::move(handler));
1134
- }
1135
- return impl_->execute(std::move(request), std::move(handler));
1347
+ if (request.history.has_value()) {
1348
+ return impl_->execute_with_bucket_capability_check(
1349
+ std::move(request), bucket_capability::non_deduped_history, std::move(handler));
1350
+ }
1351
+ return impl_->execute(std::move(request), std::move(handler));
1136
1352
  }
1137
1353
 
1138
1354
  void
1139
- cluster::execute(operations::management::collection_drop_request request,
1140
- utils::movable_function<void(operations::management::collection_drop_response)>&& handler) const
1355
+ cluster::execute(
1356
+ operations::management::collection_drop_request request,
1357
+ utils::movable_function<void(operations::management::collection_drop_response)>&& handler) const
1141
1358
  {
1142
- return impl_->execute(std::move(request), std::move(handler));
1359
+ return impl_->execute(std::move(request), std::move(handler));
1143
1360
  }
1144
1361
 
1145
1362
  void
1146
- cluster::execute(operations::management::collections_manifest_get_request request,
1147
- utils::movable_function<void(operations::management::collections_manifest_get_response)>&& handler) const
1363
+ cluster::execute(
1364
+ operations::management::collections_manifest_get_request request,
1365
+ utils::movable_function<void(operations::management::collections_manifest_get_response)>&&
1366
+ handler) const
1148
1367
  {
1149
- return impl_->execute(std::move(request), std::move(handler));
1368
+ return impl_->execute(std::move(request), std::move(handler));
1150
1369
  }
1151
1370
 
1152
1371
  void
1153
- cluster::execute(operations::management::scope_create_request request,
1154
- utils::movable_function<void(operations::management::scope_create_response)>&& handler) const
1372
+ cluster::execute(
1373
+ operations::management::scope_create_request request,
1374
+ utils::movable_function<void(operations::management::scope_create_response)>&& handler) const
1155
1375
  {
1156
- return impl_->execute(std::move(request), std::move(handler));
1376
+ return impl_->execute(std::move(request), std::move(handler));
1157
1377
  }
1158
1378
 
1159
1379
  void
1160
- cluster::execute(operations::management::scope_drop_request request,
1161
- utils::movable_function<void(operations::management::scope_drop_response)>&& handler) const
1380
+ cluster::execute(
1381
+ operations::management::scope_drop_request request,
1382
+ utils::movable_function<void(operations::management::scope_drop_response)>&& handler) const
1162
1383
  {
1163
- return impl_->execute(std::move(request), std::move(handler));
1384
+ return impl_->execute(std::move(request), std::move(handler));
1164
1385
  }
1165
1386
 
1166
1387
  void
1167
- cluster::execute(operations::management::scope_get_all_request request,
1168
- utils::movable_function<void(operations::management::scope_get_all_response)>&& handler) const
1388
+ cluster::execute(
1389
+ operations::management::scope_get_all_request request,
1390
+ utils::movable_function<void(operations::management::scope_get_all_response)>&& handler) const
1169
1391
  {
1170
- return impl_->execute(std::move(request), std::move(handler));
1392
+ return impl_->execute(std::move(request), std::move(handler));
1171
1393
  }
1172
1394
 
1173
1395
  void
1174
- cluster::execute(operations::management::eventing_deploy_function_request request,
1175
- utils::movable_function<void(operations::management::eventing_deploy_function_response)>&& handler) const
1396
+ cluster::execute(
1397
+ operations::management::eventing_deploy_function_request request,
1398
+ utils::movable_function<void(operations::management::eventing_deploy_function_response)>&&
1399
+ handler) const
1176
1400
  {
1177
- return impl_->execute(std::move(request), std::move(handler));
1401
+ return impl_->execute(std::move(request), std::move(handler));
1178
1402
  }
1179
1403
 
1180
1404
  void
1181
- cluster::execute(operations::management::eventing_drop_function_request request,
1182
- utils::movable_function<void(operations::management::eventing_drop_function_response)>&& handler) const
1405
+ cluster::execute(
1406
+ operations::management::eventing_drop_function_request request,
1407
+ utils::movable_function<void(operations::management::eventing_drop_function_response)>&& handler)
1408
+ const
1183
1409
  {
1184
- return impl_->execute(std::move(request), std::move(handler));
1410
+ return impl_->execute(std::move(request), std::move(handler));
1185
1411
  }
1186
1412
 
1187
1413
  void
1188
- cluster::execute(operations::management::eventing_get_all_functions_request request,
1189
- utils::movable_function<void(operations::management::eventing_get_all_functions_response)>&& handler) const
1414
+ cluster::execute(
1415
+ operations::management::eventing_get_all_functions_request request,
1416
+ utils::movable_function<void(operations::management::eventing_get_all_functions_response)>&&
1417
+ handler) const
1190
1418
  {
1191
- return impl_->execute(std::move(request), std::move(handler));
1419
+ return impl_->execute(std::move(request), std::move(handler));
1192
1420
  }
1193
1421
 
1194
1422
  void
1195
- cluster::execute(operations::management::eventing_get_function_request request,
1196
- utils::movable_function<void(operations::management::eventing_get_function_response)>&& handler) const
1423
+ cluster::execute(
1424
+ operations::management::eventing_get_function_request request,
1425
+ utils::movable_function<void(operations::management::eventing_get_function_response)>&& handler)
1426
+ const
1197
1427
  {
1198
- return impl_->execute(std::move(request), std::move(handler));
1428
+ return impl_->execute(std::move(request), std::move(handler));
1199
1429
  }
1200
1430
 
1201
1431
  void
1202
- cluster::execute(operations::management::eventing_get_status_request request,
1203
- utils::movable_function<void(operations::management::eventing_get_status_response)>&& handler) const
1432
+ cluster::execute(
1433
+ operations::management::eventing_get_status_request request,
1434
+ utils::movable_function<void(operations::management::eventing_get_status_response)>&& handler)
1435
+ const
1204
1436
  {
1205
- return impl_->execute(std::move(request), std::move(handler));
1437
+ return impl_->execute(std::move(request), std::move(handler));
1206
1438
  }
1207
1439
 
1208
1440
  void
1209
- cluster::execute(operations::management::eventing_pause_function_request request,
1210
- utils::movable_function<void(operations::management::eventing_pause_function_response)>&& handler) const
1441
+ cluster::execute(
1442
+ operations::management::eventing_pause_function_request request,
1443
+ utils::movable_function<void(operations::management::eventing_pause_function_response)>&& handler)
1444
+ const
1211
1445
  {
1212
- return impl_->execute(std::move(request), std::move(handler));
1446
+ return impl_->execute(std::move(request), std::move(handler));
1213
1447
  }
1214
1448
 
1215
1449
  void
1216
- cluster::execute(operations::management::eventing_resume_function_request request,
1217
- utils::movable_function<void(operations::management::eventing_resume_function_response)>&& handler) const
1450
+ cluster::execute(
1451
+ operations::management::eventing_resume_function_request request,
1452
+ utils::movable_function<void(operations::management::eventing_resume_function_response)>&&
1453
+ handler) const
1218
1454
  {
1219
- return impl_->execute(std::move(request), std::move(handler));
1455
+ return impl_->execute(std::move(request), std::move(handler));
1220
1456
  }
1221
1457
 
1222
1458
  void
1223
- cluster::execute(operations::management::eventing_undeploy_function_request request,
1224
- utils::movable_function<void(operations::management::eventing_undeploy_function_response)>&& handler) const
1459
+ cluster::execute(
1460
+ operations::management::eventing_undeploy_function_request request,
1461
+ utils::movable_function<void(operations::management::eventing_undeploy_function_response)>&&
1462
+ handler) const
1225
1463
  {
1226
- return impl_->execute(std::move(request), std::move(handler));
1464
+ return impl_->execute(std::move(request), std::move(handler));
1227
1465
  }
1228
1466
 
1229
1467
  void
1230
- cluster::execute(operations::management::eventing_upsert_function_request request,
1231
- utils::movable_function<void(operations::management::eventing_upsert_function_response)>&& handler) const
1468
+ cluster::execute(
1469
+ operations::management::eventing_upsert_function_request request,
1470
+ utils::movable_function<void(operations::management::eventing_upsert_function_response)>&&
1471
+ handler) const
1232
1472
  {
1233
- return impl_->execute(std::move(request), std::move(handler));
1473
+ return impl_->execute(std::move(request), std::move(handler));
1234
1474
  }
1235
1475
 
1236
1476
  void
1237
- cluster::execute(operations::management::view_index_drop_request request,
1238
- utils::movable_function<void(operations::management::view_index_drop_response)>&& handler) const
1477
+ cluster::execute(
1478
+ operations::management::view_index_drop_request request,
1479
+ utils::movable_function<void(operations::management::view_index_drop_response)>&& handler) const
1239
1480
  {
1240
- return impl_->execute(std::move(request), std::move(handler));
1481
+ return impl_->execute(std::move(request), std::move(handler));
1241
1482
  }
1242
1483
 
1243
1484
  void
1244
- cluster::execute(operations::management::view_index_get_request request,
1245
- utils::movable_function<void(operations::management::view_index_get_response)>&& handler) const
1485
+ cluster::execute(
1486
+ operations::management::view_index_get_request request,
1487
+ utils::movable_function<void(operations::management::view_index_get_response)>&& handler) const
1246
1488
  {
1247
- return impl_->execute(std::move(request), std::move(handler));
1489
+ return impl_->execute(std::move(request), std::move(handler));
1248
1490
  }
1249
1491
 
1250
1492
  void
1251
- cluster::execute(operations::management::view_index_get_all_request request,
1252
- utils::movable_function<void(operations::management::view_index_get_all_response)>&& handler) const
1493
+ cluster::execute(
1494
+ operations::management::view_index_get_all_request request,
1495
+ utils::movable_function<void(operations::management::view_index_get_all_response)>&& handler)
1496
+ const
1253
1497
  {
1254
- return impl_->execute(std::move(request), std::move(handler));
1498
+ return impl_->execute(std::move(request), std::move(handler));
1255
1499
  }
1256
1500
 
1257
1501
  void
1258
- cluster::execute(operations::management::view_index_upsert_request request,
1259
- utils::movable_function<void(operations::management::view_index_upsert_response)>&& handler) const
1502
+ cluster::execute(
1503
+ operations::management::view_index_upsert_request request,
1504
+ utils::movable_function<void(operations::management::view_index_upsert_response)>&& handler) const
1260
1505
  {
1261
- return impl_->execute(std::move(request), std::move(handler));
1506
+ return impl_->execute(std::move(request), std::move(handler));
1262
1507
  }
1263
1508
 
1264
1509
  void
1265
- cluster::execute(operations::management::change_password_request request,
1266
- utils::movable_function<void(operations::management::change_password_response)>&& handler) const
1510
+ cluster::execute(
1511
+ operations::management::change_password_request request,
1512
+ utils::movable_function<void(operations::management::change_password_response)>&& handler) const
1267
1513
  {
1268
- return impl_->execute(std::move(request), std::move(handler));
1514
+ return impl_->execute(std::move(request), std::move(handler));
1269
1515
  }
1270
1516
 
1271
1517
  void
1272
- cluster::execute(operations::management::group_drop_request request,
1273
- utils::movable_function<void(operations::management::group_drop_response)>&& handler) const
1518
+ cluster::execute(
1519
+ operations::management::group_drop_request request,
1520
+ utils::movable_function<void(operations::management::group_drop_response)>&& handler) const
1274
1521
  {
1275
- return impl_->execute(std::move(request), std::move(handler));
1522
+ return impl_->execute(std::move(request), std::move(handler));
1276
1523
  }
1277
1524
 
1278
1525
  void
1279
- cluster::execute(operations::management::group_get_request request,
1280
- utils::movable_function<void(operations::management::group_get_response)>&& handler) const
1526
+ cluster::execute(
1527
+ operations::management::group_get_request request,
1528
+ utils::movable_function<void(operations::management::group_get_response)>&& handler) const
1281
1529
  {
1282
- return impl_->execute(std::move(request), std::move(handler));
1530
+ return impl_->execute(std::move(request), std::move(handler));
1283
1531
  }
1284
1532
 
1285
1533
  void
1286
- cluster::execute(operations::management::group_get_all_request request,
1287
- utils::movable_function<void(operations::management::group_get_all_response)>&& handler) const
1534
+ cluster::execute(
1535
+ operations::management::group_get_all_request request,
1536
+ utils::movable_function<void(operations::management::group_get_all_response)>&& handler) const
1288
1537
  {
1289
- return impl_->execute(std::move(request), std::move(handler));
1538
+ return impl_->execute(std::move(request), std::move(handler));
1290
1539
  }
1291
1540
 
1292
1541
  void
1293
- cluster::execute(operations::management::group_upsert_request request,
1294
- utils::movable_function<void(operations::management::group_upsert_response)>&& handler) const
1542
+ cluster::execute(
1543
+ operations::management::group_upsert_request request,
1544
+ utils::movable_function<void(operations::management::group_upsert_response)>&& handler) const
1295
1545
  {
1296
- return impl_->execute(std::move(request), std::move(handler));
1546
+ return impl_->execute(std::move(request), std::move(handler));
1297
1547
  }
1298
1548
 
1299
1549
  void
1300
- cluster::execute(operations::management::role_get_all_request request,
1301
- utils::movable_function<void(operations::management::role_get_all_response)>&& handler) const
1550
+ cluster::execute(
1551
+ operations::management::role_get_all_request request,
1552
+ utils::movable_function<void(operations::management::role_get_all_response)>&& handler) const
1302
1553
  {
1303
- return impl_->execute(std::move(request), std::move(handler));
1554
+ return impl_->execute(std::move(request), std::move(handler));
1304
1555
  }
1305
1556
 
1306
1557
  void
1307
- cluster::execute(operations::management::user_drop_request request,
1308
- utils::movable_function<void(operations::management::user_drop_response)>&& handler) const
1558
+ cluster::execute(
1559
+ operations::management::user_drop_request request,
1560
+ utils::movable_function<void(operations::management::user_drop_response)>&& handler) const
1309
1561
  {
1310
- return impl_->execute(std::move(request), std::move(handler));
1562
+ return impl_->execute(std::move(request), std::move(handler));
1311
1563
  }
1312
1564
 
1313
1565
  void
1314
- cluster::execute(operations::management::user_get_request request,
1315
- utils::movable_function<void(operations::management::user_get_response)>&& handler) const
1566
+ cluster::execute(
1567
+ operations::management::user_get_request request,
1568
+ utils::movable_function<void(operations::management::user_get_response)>&& handler) const
1316
1569
  {
1317
- return impl_->execute(std::move(request), std::move(handler));
1570
+ return impl_->execute(std::move(request), std::move(handler));
1318
1571
  }
1319
1572
 
1320
1573
  void
1321
- cluster::execute(operations::management::user_get_all_request request,
1322
- utils::movable_function<void(operations::management::user_get_all_response)>&& handler) const
1574
+ cluster::execute(
1575
+ operations::management::user_get_all_request request,
1576
+ utils::movable_function<void(operations::management::user_get_all_response)>&& handler) const
1323
1577
  {
1324
- return impl_->execute(std::move(request), std::move(handler));
1578
+ return impl_->execute(std::move(request), std::move(handler));
1325
1579
  }
1326
1580
 
1327
1581
  void
1328
- cluster::execute(operations::management::user_upsert_request request,
1329
- utils::movable_function<void(operations::management::user_upsert_response)>&& handler) const
1582
+ cluster::execute(
1583
+ operations::management::user_upsert_request request,
1584
+ utils::movable_function<void(operations::management::user_upsert_response)>&& handler) const
1330
1585
  {
1331
- return impl_->execute(std::move(request), std::move(handler));
1586
+ return impl_->execute(std::move(request), std::move(handler));
1332
1587
  }
1333
1588
 
1334
1589
  void
1335
- cluster::execute(operations::management::search_get_stats_request request,
1336
- utils::movable_function<void(operations::management::search_get_stats_response)>&& handler) const
1590
+ cluster::execute(
1591
+ operations::management::search_get_stats_request request,
1592
+ utils::movable_function<void(operations::management::search_get_stats_response)>&& handler) const
1337
1593
  {
1338
- return impl_->execute(std::move(request), std::move(handler));
1594
+ return impl_->execute(std::move(request), std::move(handler));
1339
1595
  }
1340
1596
 
1341
1597
  void
1342
- cluster::execute(operations::management::search_index_analyze_document_request request,
1343
- utils::movable_function<void(operations::management::search_index_analyze_document_response)>&& handler) const
1598
+ cluster::execute(
1599
+ operations::management::search_index_analyze_document_request request,
1600
+ utils::movable_function<void(operations::management::search_index_analyze_document_response)>&&
1601
+ handler) const
1344
1602
  {
1345
- return impl_->execute(std::move(request), std::move(handler));
1603
+ return impl_->execute(std::move(request), std::move(handler));
1346
1604
  }
1347
1605
 
1348
1606
  void
1349
- cluster::execute(operations::management::search_index_control_ingest_request request,
1350
- utils::movable_function<void(operations::management::search_index_control_ingest_response)>&& handler) const
1607
+ cluster::execute(
1608
+ operations::management::search_index_control_ingest_request request,
1609
+ utils::movable_function<void(operations::management::search_index_control_ingest_response)>&&
1610
+ handler) const
1351
1611
  {
1352
- return impl_->execute(std::move(request), std::move(handler));
1612
+ return impl_->execute(std::move(request), std::move(handler));
1353
1613
  }
1354
1614
 
1355
1615
  void
1356
- cluster::execute(operations::management::search_index_control_plan_freeze_request request,
1357
- utils::movable_function<void(operations::management::search_index_control_plan_freeze_response)>&& handler) const
1616
+ cluster::execute(
1617
+ operations::management::search_index_control_plan_freeze_request request,
1618
+ utils::movable_function<void(operations::management::search_index_control_plan_freeze_response)>&&
1619
+ handler) const
1358
1620
  {
1359
- return impl_->execute(std::move(request), std::move(handler));
1621
+ return impl_->execute(std::move(request), std::move(handler));
1360
1622
  }
1361
1623
 
1362
1624
  void
1363
- cluster::execute(operations::management::search_index_control_query_request request,
1364
- utils::movable_function<void(operations::management::search_index_control_query_response)>&& handler) const
1625
+ cluster::execute(
1626
+ operations::management::search_index_control_query_request request,
1627
+ utils::movable_function<void(operations::management::search_index_control_query_response)>&&
1628
+ handler) const
1365
1629
  {
1366
- return impl_->execute(std::move(request), std::move(handler));
1630
+ return impl_->execute(std::move(request), std::move(handler));
1367
1631
  }
1368
1632
 
1369
1633
  void
1370
- cluster::execute(operations::management::search_index_drop_request request,
1371
- utils::movable_function<void(operations::management::search_index_drop_response)>&& handler) const
1634
+ cluster::execute(
1635
+ operations::management::search_index_drop_request request,
1636
+ utils::movable_function<void(operations::management::search_index_drop_response)>&& handler) const
1372
1637
  {
1373
- return impl_->execute(std::move(request), std::move(handler));
1638
+ return impl_->execute(std::move(request), std::move(handler));
1374
1639
  }
1375
1640
 
1376
1641
  void
1377
- cluster::execute(operations::management::search_index_get_request request,
1378
- utils::movable_function<void(operations::management::search_index_get_response)>&& handler) const
1642
+ cluster::execute(
1643
+ operations::management::search_index_get_request request,
1644
+ utils::movable_function<void(operations::management::search_index_get_response)>&& handler) const
1379
1645
  {
1380
- return impl_->execute(std::move(request), std::move(handler));
1646
+ return impl_->execute(std::move(request), std::move(handler));
1381
1647
  }
1382
1648
 
1383
1649
  void
1384
- cluster::execute(operations::management::search_index_get_all_request request,
1385
- utils::movable_function<void(operations::management::search_index_get_all_response)>&& handler) const
1650
+ cluster::execute(
1651
+ operations::management::search_index_get_all_request request,
1652
+ utils::movable_function<void(operations::management::search_index_get_all_response)>&& handler)
1653
+ const
1386
1654
  {
1387
- return impl_->execute(std::move(request), std::move(handler));
1655
+ return impl_->execute(std::move(request), std::move(handler));
1388
1656
  }
1389
1657
 
1390
1658
  void
1391
- cluster::execute(operations::management::search_index_get_documents_count_request request,
1392
- utils::movable_function<void(operations::management::search_index_get_documents_count_response)>&& handler) const
1659
+ cluster::execute(
1660
+ operations::management::search_index_get_documents_count_request request,
1661
+ utils::movable_function<void(operations::management::search_index_get_documents_count_response)>&&
1662
+ handler) const
1393
1663
  {
1394
- return impl_->execute(std::move(request), std::move(handler));
1664
+ return impl_->execute(std::move(request), std::move(handler));
1395
1665
  }
1396
1666
 
1397
1667
  void
1398
- cluster::execute(operations::management::search_index_get_stats_request request,
1399
- utils::movable_function<void(operations::management::search_index_get_stats_response)>&& handler) const
1668
+ cluster::execute(
1669
+ operations::management::search_index_get_stats_request request,
1670
+ utils::movable_function<void(operations::management::search_index_get_stats_response)>&& handler)
1671
+ const
1400
1672
  {
1401
- return impl_->execute(std::move(request), std::move(handler));
1673
+ return impl_->execute(std::move(request), std::move(handler));
1402
1674
  }
1403
1675
 
1404
1676
  void
1405
- cluster::execute(operations::management::search_index_upsert_request request,
1406
- utils::movable_function<void(operations::management::search_index_upsert_response)>&& handler) const
1677
+ cluster::execute(
1678
+ operations::management::search_index_upsert_request request,
1679
+ utils::movable_function<void(operations::management::search_index_upsert_response)>&& handler)
1680
+ const
1407
1681
  {
1408
- return impl_->execute(std::move(request), std::move(handler));
1682
+ return impl_->execute(std::move(request), std::move(handler));
1409
1683
  }
1410
1684
 
1411
1685
  void
1412
- cluster::execute(operations::management::query_index_build_request request,
1413
- utils::movable_function<void(operations::management::query_index_build_response)>&& handler) const
1686
+ cluster::execute(
1687
+ operations::management::query_index_build_request request,
1688
+ utils::movable_function<void(operations::management::query_index_build_response)>&& handler) const
1414
1689
  {
1415
- return impl_->execute(std::move(request), std::move(handler));
1690
+ return impl_->execute(std::move(request), std::move(handler));
1416
1691
  }
1417
1692
 
1418
1693
  void
1419
- cluster::execute(operations::management::query_index_build_deferred_request request,
1420
- utils::movable_function<void(operations::management::query_index_build_deferred_response)>&& handler) const
1694
+ cluster::execute(
1695
+ operations::management::query_index_build_deferred_request request,
1696
+ utils::movable_function<void(operations::management::query_index_build_deferred_response)>&&
1697
+ handler) const
1421
1698
  {
1422
- return impl_->execute(std::move(request), std::move(handler));
1699
+ return impl_->execute(std::move(request), std::move(handler));
1423
1700
  }
1424
1701
 
1425
1702
  void
1426
- cluster::execute(operations::management::query_index_create_request request,
1427
- utils::movable_function<void(operations::management::query_index_create_response)>&& handler) const
1703
+ cluster::execute(
1704
+ operations::management::query_index_create_request request,
1705
+ utils::movable_function<void(operations::management::query_index_create_response)>&& handler)
1706
+ const
1428
1707
  {
1429
- return impl_->execute(std::move(request), std::move(handler));
1708
+ return impl_->execute(std::move(request), std::move(handler));
1430
1709
  }
1431
1710
 
1432
1711
  void
1433
- cluster::execute(operations::management::query_index_drop_request request,
1434
- utils::movable_function<void(operations::management::query_index_drop_response)>&& handler) const
1712
+ cluster::execute(
1713
+ operations::management::query_index_drop_request request,
1714
+ utils::movable_function<void(operations::management::query_index_drop_response)>&& handler) const
1435
1715
  {
1436
- return impl_->execute(std::move(request), std::move(handler));
1716
+ return impl_->execute(std::move(request), std::move(handler));
1437
1717
  }
1438
1718
 
1439
1719
  void
1440
- cluster::execute(operations::management::query_index_get_all_request request,
1441
- utils::movable_function<void(operations::management::query_index_get_all_response)>&& handler) const
1720
+ cluster::execute(
1721
+ operations::management::query_index_get_all_request request,
1722
+ utils::movable_function<void(operations::management::query_index_get_all_response)>&& handler)
1723
+ const
1442
1724
  {
1443
- return impl_->execute(std::move(request), std::move(handler));
1725
+ return impl_->execute(std::move(request), std::move(handler));
1444
1726
  }
1445
1727
 
1446
1728
  void
1447
- cluster::execute(operations::management::query_index_get_all_deferred_request request,
1448
- utils::movable_function<void(operations::management::query_index_get_all_deferred_response)>&& handler) const
1729
+ cluster::execute(
1730
+ operations::management::query_index_get_all_deferred_request request,
1731
+ utils::movable_function<void(operations::management::query_index_get_all_deferred_response)>&&
1732
+ handler) const
1449
1733
  {
1450
- return impl_->execute(std::move(request), std::move(handler));
1734
+ return impl_->execute(std::move(request), std::move(handler));
1451
1735
  }
1452
1736
 
1453
1737
  void
1454
- cluster::execute(operations::management::bucket_describe_request request,
1455
- utils::movable_function<void(operations::management::bucket_describe_response)>&& handler) const
1738
+ cluster::execute(
1739
+ operations::management::bucket_describe_request request,
1740
+ utils::movable_function<void(operations::management::bucket_describe_response)>&& handler) const
1456
1741
  {
1457
- return impl_->execute(std::move(request), std::move(handler));
1742
+ return impl_->execute(std::move(request), std::move(handler));
1458
1743
  }
1459
1744
 
1460
1745
  void
1461
- cluster::execute(operations::management::cluster_describe_request request,
1462
- utils::movable_function<void(operations::management::cluster_describe_response)>&& handler) const
1746
+ cluster::execute(
1747
+ operations::management::cluster_describe_request request,
1748
+ utils::movable_function<void(operations::management::cluster_describe_response)>&& handler) const
1463
1749
  {
1464
- return impl_->execute(std::move(request), std::move(handler));
1750
+ return impl_->execute(std::move(request), std::move(handler));
1465
1751
  }
1466
1752
 
1467
1753
  void
1468
- cluster::execute(operations::management::cluster_developer_preview_enable_request request,
1469
- utils::movable_function<void(operations::management::cluster_developer_preview_enable_response)>&& handler) const
1754
+ cluster::execute(
1755
+ operations::management::cluster_developer_preview_enable_request request,
1756
+ utils::movable_function<void(operations::management::cluster_developer_preview_enable_response)>&&
1757
+ handler) const
1470
1758
  {
1471
- return impl_->execute(std::move(request), std::move(handler));
1759
+ return impl_->execute(std::move(request), std::move(handler));
1472
1760
  }
1473
1761
 
1474
1762
  void
1475
- cluster::execute(operations::management::freeform_request request,
1476
- utils::movable_function<void(operations::management::freeform_response)>&& handler) const
1763
+ cluster::execute(
1764
+ operations::management::freeform_request request,
1765
+ utils::movable_function<void(operations::management::freeform_response)>&& handler) const
1477
1766
  {
1478
- return impl_->execute(std::move(request), std::move(handler));
1767
+ return impl_->execute(std::move(request), std::move(handler));
1479
1768
  }
1480
1769
 
1481
1770
  void
1482
- cluster::execute(impl::get_replica_request request, utils::movable_function<void(impl::get_replica_response)>&& handler) const
1771
+ cluster::execute(impl::get_replica_request request,
1772
+ utils::movable_function<void(impl::get_replica_response)>&& handler) const
1483
1773
  {
1484
- return impl_->execute(std::move(request), std::move(handler));
1774
+ return impl_->execute(std::move(request), std::move(handler));
1485
1775
  }
1486
1776
 
1487
1777
  void
1488
- cluster::execute(impl::observe_seqno_request request, utils::movable_function<void(impl::observe_seqno_response)>&& handler) const
1778
+ cluster::execute(impl::observe_seqno_request request,
1779
+ utils::movable_function<void(impl::observe_seqno_response)>&& handler) const
1489
1780
  {
1490
- return impl_->execute(std::move(request), std::move(handler));
1781
+ return impl_->execute(std::move(request), std::move(handler));
1491
1782
  }
1492
1783
 
1493
1784
  void
1494
- cluster::execute(operations::management::analytics_link_replace_request<management::analytics::azure_blob_external_link> request,
1495
- utils::movable_function<void(operations::management::analytics_link_replace_response)>&& handler) const
1785
+ cluster::execute(
1786
+ operations::management::analytics_link_replace_request<
1787
+ management::analytics::azure_blob_external_link> request,
1788
+ utils::movable_function<void(operations::management::analytics_link_replace_response)>&& handler)
1789
+ const
1496
1790
  {
1497
- return impl_->execute(std::move(request), std::move(handler));
1791
+ return impl_->execute(std::move(request), std::move(handler));
1498
1792
  }
1499
1793
 
1500
1794
  void
1501
- cluster::execute(operations::management::analytics_link_replace_request<management::analytics::couchbase_remote_link> request,
1502
- utils::movable_function<void(operations::management::analytics_link_replace_response)>&& handler) const
1795
+ cluster::execute(
1796
+ operations::management::analytics_link_replace_request<
1797
+ management::analytics::couchbase_remote_link> request,
1798
+ utils::movable_function<void(operations::management::analytics_link_replace_response)>&& handler)
1799
+ const
1503
1800
  {
1504
- return impl_->execute(std::move(request), std::move(handler));
1801
+ return impl_->execute(std::move(request), std::move(handler));
1505
1802
  }
1506
1803
 
1507
1804
  void
1508
- cluster::execute(operations::management::analytics_link_replace_request<management::analytics::s3_external_link> request,
1509
- utils::movable_function<void(operations::management::analytics_link_replace_response)>&& handler) const
1805
+ cluster::execute(
1806
+ operations::management::analytics_link_replace_request<management::analytics::s3_external_link>
1807
+ request,
1808
+ utils::movable_function<void(operations::management::analytics_link_replace_response)>&& handler)
1809
+ const
1510
1810
  {
1511
- return impl_->execute(std::move(request), std::move(handler));
1811
+ return impl_->execute(std::move(request), std::move(handler));
1512
1812
  }
1513
1813
 
1514
1814
  void
1515
- cluster::execute(operations::management::analytics_link_create_request<management::analytics::azure_blob_external_link> request,
1516
- utils::movable_function<void(operations::management::analytics_link_create_response)>&& handler) const
1815
+ cluster::execute(
1816
+ operations::management::analytics_link_create_request<
1817
+ management::analytics::azure_blob_external_link> request,
1818
+ utils::movable_function<void(operations::management::analytics_link_create_response)>&& handler)
1819
+ const
1517
1820
  {
1518
- return impl_->execute(std::move(request), std::move(handler));
1821
+ return impl_->execute(std::move(request), std::move(handler));
1519
1822
  }
1520
1823
 
1521
1824
  void
1522
- cluster::execute(operations::management::analytics_link_create_request<management::analytics::couchbase_remote_link> request,
1523
- utils::movable_function<void(operations::management::analytics_link_create_response)>&& handler) const
1825
+ cluster::execute(
1826
+ operations::management::analytics_link_create_request<
1827
+ management::analytics::couchbase_remote_link> request,
1828
+ utils::movable_function<void(operations::management::analytics_link_create_response)>&& handler)
1829
+ const
1524
1830
  {
1525
- return impl_->execute(std::move(request), std::move(handler));
1831
+ return impl_->execute(std::move(request), std::move(handler));
1526
1832
  }
1527
1833
 
1528
1834
  void
1529
- cluster::execute(operations::management::analytics_link_create_request<management::analytics::s3_external_link> request,
1530
- utils::movable_function<void(operations::management::analytics_link_create_response)>&& handler) const
1835
+ cluster::execute(
1836
+ operations::management::analytics_link_create_request<management::analytics::s3_external_link>
1837
+ request,
1838
+ utils::movable_function<void(operations::management::analytics_link_create_response)>&& handler)
1839
+ const
1531
1840
  {
1532
- return impl_->execute(std::move(request), std::move(handler));
1841
+ return impl_->execute(std::move(request), std::move(handler));
1533
1842
  }
1534
1843
 
1535
1844
  void
1536
- cluster::execute(operations::analytics_request request, utils::movable_function<void(operations::analytics_response)>&& handler) const
1845
+ cluster::execute(operations::analytics_request request,
1846
+ utils::movable_function<void(operations::analytics_response)>&& handler) const
1537
1847
  {
1538
- return impl_->execute(std::move(request), std::move(handler));
1848
+ return impl_->execute(std::move(request), std::move(handler));
1539
1849
  }
1540
1850
 
1541
1851
  void
1542
1852
  cluster::execute(operations::upsert_request_with_legacy_durability request,
1543
1853
  utils::movable_function<void(operations::upsert_response)>&& handler) const
1544
1854
  {
1545
- return request.execute(*this, std::move(handler));
1855
+ return request.execute(*this, std::move(handler));
1546
1856
  }
1547
1857
 
1548
1858
  void
1549
1859
  cluster::execute(operations::insert_request_with_legacy_durability request,
1550
1860
  utils::movable_function<void(operations::insert_response)>&& handler) const
1551
1861
  {
1552
- return request.execute(*this, std::move(handler));
1862
+ return request.execute(*this, std::move(handler));
1553
1863
  }
1554
1864
 
1555
1865
  void
1556
1866
  cluster::execute(operations::append_request_with_legacy_durability request,
1557
1867
  utils::movable_function<void(operations::append_response)>&& handler) const
1558
1868
  {
1559
- return request.execute(*this, std::move(handler));
1869
+ return request.execute(*this, std::move(handler));
1560
1870
  }
1561
1871
 
1562
1872
  void
1563
1873
  cluster::execute(operations::prepend_request_with_legacy_durability request,
1564
1874
  utils::movable_function<void(operations::prepend_response)>&& handler) const
1565
1875
  {
1566
- return request.execute(*this, std::move(handler));
1876
+ return request.execute(*this, std::move(handler));
1567
1877
  }
1568
1878
 
1569
1879
  void
1570
1880
  cluster::execute(operations::replace_request_with_legacy_durability request,
1571
1881
  utils::movable_function<void(operations::replace_response)>&& handler) const
1572
1882
  {
1573
- return request.execute(*this, std::move(handler));
1883
+ return request.execute(*this, std::move(handler));
1574
1884
  }
1575
1885
 
1576
1886
  void
1577
1887
  cluster::execute(operations::mutate_in_request_with_legacy_durability request,
1578
1888
  utils::movable_function<void(operations::mutate_in_response)>&& handler) const
1579
1889
  {
1580
- return request.execute(*this, std::move(handler));
1890
+ return request.execute(*this, std::move(handler));
1581
1891
  }
1582
1892
 
1583
1893
  void
1584
1894
  cluster::execute(operations::remove_request_with_legacy_durability request,
1585
1895
  utils::movable_function<void(operations::remove_response)>&& handler) const
1586
1896
  {
1587
- return request.execute(*this, std::move(handler));
1897
+ return request.execute(*this, std::move(handler));
1588
1898
  }
1589
1899
 
1590
1900
  void
1591
1901
  cluster::execute(operations::increment_request_with_legacy_durability request,
1592
1902
  utils::movable_function<void(operations::increment_response)>&& handler) const
1593
1903
  {
1594
- return request.execute(*this, std::move(handler));
1904
+ return request.execute(*this, std::move(handler));
1595
1905
  }
1596
1906
 
1597
1907
  void
1598
1908
  cluster::execute(operations::decrement_request_with_legacy_durability request,
1599
1909
  utils::movable_function<void(operations::decrement_response)>&& handler) const
1600
1910
  {
1601
- return request.execute(*this, std::move(handler));
1911
+ return request.execute(*this, std::move(handler));
1602
1912
  }
1603
1913
 
1604
1914
  void
1605
- cluster::execute(impl::lookup_in_replica_request request, utils::movable_function<void(impl::lookup_in_replica_response)>&& handler) const
1915
+ cluster::execute(impl::lookup_in_replica_request request,
1916
+ utils::movable_function<void(impl::lookup_in_replica_response)>&& handler) const
1606
1917
  {
1607
- return impl_->execute(std::move(request), std::move(handler));
1918
+ return impl_->execute(std::move(request), std::move(handler));
1608
1919
  }
1609
1920
 
1610
1921
  auto
1611
1922
  cluster::to_string() const -> std::string
1612
1923
  {
1613
- return fmt::format(
1614
- R"(#<cluster:{} impl={}>)", static_cast<const void*>(this), impl_ ? static_cast<const void*>(impl_.get()) : "(none)");
1924
+ return fmt::format(R"(#<cluster:{} impl={}, use_count={}>)",
1925
+ static_cast<const void*>(this),
1926
+ impl_ ? static_cast<const void*>(impl_.get()) : "(none)",
1927
+ impl_ ? std::to_string(impl_.use_count()) : "(none)");
1615
1928
  }
1616
1929
  } // namespace couchbase::core