couchbase 4.2.8 → 4.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (370) hide show
  1. package/CMakeLists.txt +1 -1
  2. package/deps/couchbase-cxx-cache/mozilla-ca-bundle.crt +139 -56
  3. package/deps/couchbase-cxx-cache/mozilla-ca-bundle.sha256 +1 -1
  4. package/deps/couchbase-cxx-client/CMakeLists.txt +401 -424
  5. package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +7 -3
  6. package/deps/couchbase-cxx-client/cmake/OpenSSL.cmake +1 -0
  7. package/deps/couchbase-cxx-client/core/agent_config.hxx +1 -1
  8. package/deps/couchbase-cxx-client/core/agent_group.cxx +0 -1
  9. package/deps/couchbase-cxx-client/core/agent_group.hxx +9 -0
  10. package/deps/couchbase-cxx-client/core/agent_group_config.hxx +1 -1
  11. package/deps/couchbase-cxx-client/core/bucket.cxx +74 -10
  12. package/deps/couchbase-cxx-client/core/bucket.hxx +4 -2
  13. package/deps/couchbase-cxx-client/core/cluster.cxx +1491 -108
  14. package/deps/couchbase-cxx-client/core/cluster.hxx +183 -473
  15. package/deps/couchbase-cxx-client/core/cluster_agent_config.hxx +1 -1
  16. package/deps/couchbase-cxx-client/core/cluster_options.cxx +12 -2
  17. package/deps/couchbase-cxx-client/core/cluster_options.hxx +9 -8
  18. package/deps/couchbase-cxx-client/core/config_profiles.cxx +2 -2
  19. package/deps/couchbase-cxx-client/core/config_profiles.hxx +1 -1
  20. package/deps/couchbase-cxx-client/core/core_sdk_shim.cxx +1 -2
  21. package/deps/couchbase-cxx-client/core/core_sdk_shim.hxx +3 -2
  22. package/deps/couchbase-cxx-client/core/diagnostics.hxx +0 -1
  23. package/deps/couchbase-cxx-client/core/dispatcher.cxx +2 -2
  24. package/deps/couchbase-cxx-client/core/impl/analytics.cxx +38 -76
  25. package/deps/couchbase-cxx-client/core/impl/analytics.hxx +40 -0
  26. package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +820 -0
  27. package/deps/couchbase-cxx-client/core/impl/binary_collection.cxx +403 -0
  28. package/deps/couchbase-cxx-client/core/impl/bucket.cxx +102 -0
  29. package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +433 -0
  30. package/deps/couchbase-cxx-client/core/impl/cluster.cxx +299 -44
  31. package/deps/couchbase-cxx-client/core/impl/collection.cxx +1384 -0
  32. package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +306 -0
  33. package/deps/couchbase-cxx-client/core/impl/configuration_profiles_registry.cxx +3 -1
  34. package/deps/couchbase-cxx-client/core/impl/diagnostics.cxx +294 -0
  35. package/deps/couchbase-cxx-client/core/impl/diagnostics.hxx +39 -0
  36. package/deps/couchbase-cxx-client/core/impl/dns_srv_tracker.cxx +2 -0
  37. package/deps/couchbase-cxx-client/core/{operations/mcbp_noop.cxx → impl/doc_id_query.cxx} +19 -15
  38. package/deps/couchbase-cxx-client/core/impl/key_value_error_category.cxx +4 -2
  39. package/deps/couchbase-cxx-client/core/impl/lookup_in_all_replicas.hxx +0 -10
  40. package/deps/couchbase-cxx-client/core/impl/lookup_in_any_replica.hxx +0 -10
  41. package/deps/couchbase-cxx-client/core/impl/observe_poll.cxx +24 -17
  42. package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -1
  43. package/deps/couchbase-cxx-client/core/impl/query.cxx +45 -68
  44. package/deps/couchbase-cxx-client/core/impl/query.hxx +34 -0
  45. package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +628 -0
  46. package/deps/couchbase-cxx-client/core/impl/scope.cxx +187 -0
  47. package/deps/couchbase-cxx-client/core/impl/search.cxx +81 -57
  48. package/deps/couchbase-cxx-client/core/impl/search.hxx +45 -0
  49. package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +712 -0
  50. package/deps/couchbase-cxx-client/core/impl/search_request.cxx +139 -0
  51. package/deps/couchbase-cxx-client/core/impl/search_row_location.cxx +12 -0
  52. package/deps/couchbase-cxx-client/core/impl/search_sort_geo_distance.cxx +87 -0
  53. package/deps/couchbase-cxx-client/core/impl/vector_query.cxx +42 -0
  54. package/deps/couchbase-cxx-client/core/impl/vector_search.cxx +40 -0
  55. package/deps/couchbase-cxx-client/core/impl/with_legacy_durability.hxx +23 -25
  56. package/deps/couchbase-cxx-client/core/io/dns_config.cxx +28 -0
  57. package/deps/couchbase-cxx-client/core/io/dns_config.hxx +6 -25
  58. package/deps/couchbase-cxx-client/core/io/http_session.hxx +6 -3
  59. package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +9 -1
  60. package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +1 -1
  61. package/deps/couchbase-cxx-client/core/io/mcbp_message.hxx +3 -2
  62. package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +75 -53
  63. package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +3 -1
  64. package/deps/couchbase-cxx-client/core/logger/logger.cxx +1 -1
  65. package/deps/couchbase-cxx-client/core/logger/logger.hxx +4 -4
  66. package/deps/couchbase-cxx-client/core/management/bucket_settings.hxx +1 -1
  67. package/deps/couchbase-cxx-client/core/mcbp/packet.cxx +1 -1
  68. package/deps/couchbase-cxx-client/core/mcbp/queue_callback.hxx +1 -1
  69. package/deps/couchbase-cxx-client/core/meta/features.hxx +38 -0
  70. package/deps/couchbase-cxx-client/core/operations/document_query.cxx +23 -2
  71. package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -1
  72. package/deps/couchbase-cxx-client/core/operations/document_search.cxx +37 -1
  73. package/deps/couchbase-cxx-client/core/operations/document_search.hxx +11 -0
  74. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.cxx +2 -0
  75. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.cxx +2 -0
  76. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.cxx +2 -0
  77. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.cxx +2 -0
  78. package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.cxx +2 -0
  79. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.cxx +2 -0
  80. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.cxx +2 -0
  81. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.cxx +2 -0
  82. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.cxx +2 -0
  83. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +2 -0
  84. package/deps/couchbase-cxx-client/core/operations/management/bucket_create.cxx +1 -1
  85. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.cxx +2 -0
  86. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +2 -0
  87. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +2 -0
  88. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +2 -0
  89. package/deps/couchbase-cxx-client/core/operations/management/change_password.cxx +3 -1
  90. package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +9 -6
  91. package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +1 -1
  92. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +2 -0
  93. package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +9 -8
  94. package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +1 -1
  95. package/deps/couchbase-cxx-client/core/operations/management/error_utils.cxx +9 -5
  96. package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.cxx +2 -0
  97. package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.cxx +2 -0
  98. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.cxx +2 -0
  99. package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.cxx +2 -0
  100. package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.cxx +2 -0
  101. package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.cxx +2 -0
  102. package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.cxx +2 -0
  103. package/deps/couchbase-cxx-client/core/operations/management/group_drop.cxx +2 -0
  104. package/deps/couchbase-cxx-client/core/operations/management/group_get.cxx +2 -0
  105. package/deps/couchbase-cxx-client/core/operations/management/group_get_all.cxx +1 -1
  106. package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +2 -2
  107. package/deps/couchbase-cxx-client/core/operations/management/query_index_create.cxx +4 -1
  108. package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.cxx +4 -1
  109. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.cxx +1 -1
  110. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +1 -1
  111. package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +2 -0
  112. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +2 -0
  113. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +2 -0
  114. package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.cxx +4 -4
  115. package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +4 -4
  116. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +19 -1
  117. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +3 -0
  118. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +23 -1
  119. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +3 -0
  120. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +23 -1
  121. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +3 -0
  122. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +23 -1
  123. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +3 -0
  124. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +19 -1
  125. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +3 -0
  126. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +19 -1
  127. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +2 -0
  128. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +39 -22
  129. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +3 -0
  130. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +20 -1
  131. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +3 -0
  132. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.cxx +2 -0
  133. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +19 -1
  134. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +3 -0
  135. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.cxx +2 -0
  136. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.cxx +2 -0
  137. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.cxx +2 -0
  138. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.cxx +2 -0
  139. package/deps/couchbase-cxx-client/core/operations.hxx +0 -1
  140. package/deps/couchbase-cxx-client/core/operations_fwd.hxx +260 -0
  141. package/deps/couchbase-cxx-client/core/origin.cxx +146 -5
  142. package/deps/couchbase-cxx-client/core/origin.hxx +30 -140
  143. package/deps/couchbase-cxx-client/core/protocol/cmd_cluster_map_change_notification.hxx +3 -3
  144. package/deps/couchbase-cxx-client/core/protocol/cmd_hello.hxx +5 -0
  145. package/deps/couchbase-cxx-client/core/protocol/cmd_observe_seqno.hxx +4 -4
  146. package/deps/couchbase-cxx-client/core/protocol/hello_feature.hxx +6 -0
  147. package/deps/couchbase-cxx-client/core/protocol/hello_feature_fmt.hxx +3 -0
  148. package/deps/couchbase-cxx-client/core/protocol/status.cxx +6 -0
  149. package/deps/couchbase-cxx-client/core/protocol/status.hxx +1 -0
  150. package/deps/couchbase-cxx-client/core/query_context.hxx +11 -7
  151. package/deps/couchbase-cxx-client/core/range_scan_orchestrator.cxx +1 -1
  152. package/deps/couchbase-cxx-client/core/topology/collections_manifest.hxx +1 -1
  153. package/deps/couchbase-cxx-client/core/topology/collections_manifest_json.hxx +1 -1
  154. package/deps/couchbase-cxx-client/core/topology/configuration.cxx +23 -0
  155. package/deps/couchbase-cxx-client/core/topology/configuration.hxx +8 -12
  156. package/deps/couchbase-cxx-client/core/topology/configuration_fmt.hxx +3 -3
  157. package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +2 -0
  158. package/deps/couchbase-cxx-client/core/topology/error_map.hxx +2 -2
  159. package/deps/couchbase-cxx-client/core/topology/error_map_json.hxx +4 -0
  160. package/deps/couchbase-cxx-client/core/transactions/active_transaction_record.cxx +58 -0
  161. package/deps/couchbase-cxx-client/core/transactions/active_transaction_record.hxx +5 -40
  162. package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.cxx +30 -0
  163. package/deps/couchbase-cxx-client/core/transactions/atr_cleanup_entry.cxx +18 -18
  164. package/deps/couchbase-cxx-client/core/transactions/attempt_context.cxx +36 -0
  165. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +39 -41
  166. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +2 -2
  167. package/deps/couchbase-cxx-client/core/transactions/internal/atr_cleanup_entry.hxx +3 -1
  168. package/deps/couchbase-cxx-client/core/transactions/internal/atr_entry.hxx +2 -0
  169. package/deps/couchbase-cxx-client/core/transactions/internal/doc_record.cxx +32 -0
  170. package/deps/couchbase-cxx-client/core/transactions/internal/doc_record.hxx +4 -30
  171. package/deps/couchbase-cxx-client/core/transactions/internal/doc_record_fmt.hxx +41 -0
  172. package/deps/couchbase-cxx-client/core/transactions/internal/logging.hxx +17 -15
  173. package/deps/couchbase-cxx-client/core/transactions/internal/transaction_context.hxx +1 -1
  174. package/deps/couchbase-cxx-client/core/transactions/internal/transactions_cleanup.hxx +4 -4
  175. package/deps/couchbase-cxx-client/core/transactions/internal/utils.hxx +5 -13
  176. package/deps/couchbase-cxx-client/core/transactions/result.hxx +0 -26
  177. package/deps/couchbase-cxx-client/core/transactions/result_fmt.hxx +46 -0
  178. package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +16 -14
  179. package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +6 -6
  180. package/deps/couchbase-cxx-client/core/transactions/transaction_keyspace.cxx +48 -0
  181. package/deps/couchbase-cxx-client/core/transactions/transaction_links.hxx +1 -0
  182. package/deps/couchbase-cxx-client/core/transactions/transaction_options.cxx +61 -4
  183. package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +9 -8
  184. package/deps/couchbase-cxx-client/core/transactions/transactions_cleanup.cxx +9 -16
  185. package/deps/couchbase-cxx-client/core/transactions/transactions_config.cxx +7 -6
  186. package/deps/couchbase-cxx-client/core/transactions.hxx +6 -5
  187. package/deps/couchbase-cxx-client/core/utils/join_strings.hxx +4 -3
  188. package/deps/couchbase-cxx-client/core/utils/keyspace.hxx +4 -4
  189. package/deps/couchbase-cxx-client/core/vector_query_combination.hxx +23 -0
  190. package/deps/couchbase-cxx-client/couchbase/allow_querying_search_index_options.hxx +44 -0
  191. package/deps/couchbase-cxx-client/couchbase/analytics_index_manager.hxx +463 -0
  192. package/deps/couchbase-cxx-client/couchbase/analyze_document_options.hxx +44 -0
  193. package/deps/couchbase-cxx-client/couchbase/append_options.hxx +0 -24
  194. package/deps/couchbase-cxx-client/couchbase/behavior_options.hxx +1 -1
  195. package/deps/couchbase-cxx-client/couchbase/binary_collection.hxx +19 -115
  196. package/deps/couchbase-cxx-client/couchbase/bucket.hxx +42 -30
  197. package/deps/couchbase-cxx-client/couchbase/bucket_manager.hxx +8 -7
  198. package/deps/couchbase-cxx-client/couchbase/build_query_index_options.hxx +0 -1
  199. package/deps/couchbase-cxx-client/couchbase/cluster.hxx +151 -73
  200. package/deps/couchbase-cxx-client/couchbase/cluster_options.hxx +1 -27
  201. package/deps/couchbase-cxx-client/couchbase/codec/json_transcoder.hxx +1 -1
  202. package/deps/couchbase-cxx-client/couchbase/codec/raw_binary_transcoder.hxx +2 -1
  203. package/deps/couchbase-cxx-client/couchbase/codec/raw_json_transcoder.hxx +78 -0
  204. package/deps/couchbase-cxx-client/couchbase/codec/raw_string_transcoder.hxx +72 -0
  205. package/deps/couchbase-cxx-client/couchbase/collection.hxx +176 -386
  206. package/deps/couchbase-cxx-client/couchbase/collection_manager.hxx +8 -9
  207. package/deps/couchbase-cxx-client/couchbase/collection_query_index_manager.hxx +21 -24
  208. package/deps/couchbase-cxx-client/couchbase/connect_link_analytics_options.hxx +116 -0
  209. package/deps/couchbase-cxx-client/couchbase/create_bucket_options.hxx +3 -3
  210. package/deps/couchbase-cxx-client/couchbase/create_collection_options.hxx +32 -3
  211. package/deps/couchbase-cxx-client/couchbase/create_dataset_analytics_options.hxx +120 -0
  212. package/deps/couchbase-cxx-client/couchbase/create_dataverse_analytics_options.hxx +85 -0
  213. package/deps/couchbase-cxx-client/couchbase/create_index_analytics_options.hxx +103 -0
  214. package/deps/couchbase-cxx-client/couchbase/create_link_analytics_options.hxx +63 -0
  215. package/deps/couchbase-cxx-client/couchbase/decrement_options.hxx +0 -23
  216. package/deps/couchbase-cxx-client/couchbase/diagnostics_options.hxx +75 -0
  217. package/deps/couchbase-cxx-client/couchbase/diagnostics_result.hxx +124 -0
  218. package/deps/couchbase-cxx-client/couchbase/disallow_querying_search_index_options.hxx +43 -0
  219. package/deps/couchbase-cxx-client/couchbase/disconnect_link_analytics_options.hxx +105 -0
  220. package/deps/couchbase-cxx-client/couchbase/drop_dataset_analytics_options.hxx +103 -0
  221. package/deps/couchbase-cxx-client/couchbase/drop_dataverse_analytics_options.hxx +84 -0
  222. package/deps/couchbase-cxx-client/couchbase/drop_index_analytics_options.hxx +103 -0
  223. package/deps/couchbase-cxx-client/couchbase/drop_link_analytics_options.hxx +63 -0
  224. package/deps/couchbase-cxx-client/couchbase/drop_search_index_options.hxx +43 -0
  225. package/deps/couchbase-cxx-client/couchbase/endpoint_diagnostics.hxx +206 -0
  226. package/deps/couchbase-cxx-client/couchbase/endpoint_ping_report.hxx +205 -0
  227. package/deps/couchbase-cxx-client/couchbase/error_codes.hxx +22 -1
  228. package/deps/couchbase-cxx-client/couchbase/exists_options.hxx +0 -23
  229. package/deps/couchbase-cxx-client/couchbase/fmt/key_value_error_map_attribute.hxx +6 -0
  230. package/deps/couchbase-cxx-client/couchbase/fmt/key_value_status_code.hxx +3 -0
  231. package/deps/couchbase-cxx-client/couchbase/fmt/transaction_keyspace.hxx +37 -0
  232. package/deps/couchbase-cxx-client/couchbase/freeze_plan_search_index_options.hxx +43 -0
  233. package/deps/couchbase-cxx-client/couchbase/get_all_datasets_analytics_options.hxx +66 -0
  234. package/deps/couchbase-cxx-client/couchbase/get_all_indexes_analytics_options.hxx +65 -0
  235. package/deps/couchbase-cxx-client/couchbase/get_all_query_indexes_options.hxx +1 -4
  236. package/deps/couchbase-cxx-client/couchbase/get_all_replicas_options.hxx +0 -23
  237. package/deps/couchbase-cxx-client/couchbase/get_all_search_indexes_options.hxx +45 -0
  238. package/deps/couchbase-cxx-client/couchbase/get_and_lock_options.hxx +0 -24
  239. package/deps/couchbase-cxx-client/couchbase/get_and_touch_options.hxx +0 -24
  240. package/deps/couchbase-cxx-client/couchbase/get_any_replica_options.hxx +0 -23
  241. package/deps/couchbase-cxx-client/couchbase/get_indexed_search_index_options.hxx +43 -0
  242. package/deps/couchbase-cxx-client/couchbase/get_links_analytics_options.hxx +121 -0
  243. package/deps/couchbase-cxx-client/couchbase/get_options.hxx +1 -29
  244. package/deps/couchbase-cxx-client/couchbase/get_pending_mutations_analytics_options.hxx +67 -0
  245. package/deps/couchbase-cxx-client/couchbase/get_search_index_options.hxx +44 -0
  246. package/deps/couchbase-cxx-client/couchbase/increment_options.hxx +0 -23
  247. package/deps/couchbase-cxx-client/couchbase/insert_options.hxx +0 -24
  248. package/deps/couchbase-cxx-client/couchbase/key_value_error_map_attribute.hxx +12 -0
  249. package/deps/couchbase-cxx-client/couchbase/key_value_status_code.hxx +1 -0
  250. package/deps/couchbase-cxx-client/couchbase/lookup_in_options.hxx +0 -24
  251. package/deps/couchbase-cxx-client/couchbase/management/analytics_dataset.hxx +48 -0
  252. package/deps/couchbase-cxx-client/couchbase/management/analytics_index.hxx +48 -0
  253. package/deps/couchbase-cxx-client/couchbase/management/analytics_link.hxx +239 -0
  254. package/deps/couchbase-cxx-client/couchbase/management/collection_spec.hxx +1 -1
  255. package/deps/couchbase-cxx-client/couchbase/management/query_index.hxx +3 -3
  256. package/deps/couchbase-cxx-client/couchbase/management/search_index.hxx +40 -0
  257. package/deps/couchbase-cxx-client/couchbase/manager_error_context.hxx +0 -1
  258. package/deps/couchbase-cxx-client/couchbase/mutate_in_options.hxx +0 -24
  259. package/deps/couchbase-cxx-client/couchbase/network_options.hxx +1 -1
  260. package/deps/couchbase-cxx-client/couchbase/pause_ingest_search_index_options.hxx +43 -0
  261. package/deps/couchbase-cxx-client/couchbase/phrase_query.hxx +19 -0
  262. package/deps/couchbase-cxx-client/couchbase/ping_options.hxx +93 -0
  263. package/deps/couchbase-cxx-client/couchbase/ping_result.hxx +118 -0
  264. package/deps/couchbase-cxx-client/couchbase/prepend_options.hxx +0 -24
  265. package/deps/couchbase-cxx-client/couchbase/query_index_manager.hxx +99 -20
  266. package/deps/couchbase-cxx-client/couchbase/query_options.hxx +0 -21
  267. package/deps/couchbase-cxx-client/couchbase/remove_options.hxx +0 -23
  268. package/deps/couchbase-cxx-client/couchbase/replace_link_analytics_options.hxx +63 -0
  269. package/deps/couchbase-cxx-client/couchbase/replace_options.hxx +0 -24
  270. package/deps/couchbase-cxx-client/couchbase/resume_ingest_search_index_options.hxx +43 -0
  271. package/deps/couchbase-cxx-client/couchbase/scope.hxx +37 -53
  272. package/deps/couchbase-cxx-client/couchbase/scope_search_index_manager.hxx +291 -0
  273. package/deps/couchbase-cxx-client/couchbase/search_facet_result.hxx +1 -7
  274. package/deps/couchbase-cxx-client/couchbase/search_geo_distance_units.hxx +26 -0
  275. package/deps/couchbase-cxx-client/couchbase/search_index_manager.hxx +292 -0
  276. package/deps/couchbase-cxx-client/couchbase/search_request.hxx +120 -0
  277. package/deps/couchbase-cxx-client/couchbase/search_row_location.hxx +10 -0
  278. package/deps/couchbase-cxx-client/couchbase/search_sort_geo_distance.hxx +84 -0
  279. package/deps/couchbase-cxx-client/couchbase/security_options.hxx +1 -1
  280. package/deps/couchbase-cxx-client/couchbase/service_type.hxx +58 -0
  281. package/deps/couchbase-cxx-client/couchbase/touch_options.hxx +0 -24
  282. package/deps/couchbase-cxx-client/couchbase/tracing/request_tracer.hxx +1 -1
  283. package/deps/couchbase-cxx-client/couchbase/transactions/async_attempt_context.hxx +10 -7
  284. package/deps/couchbase-cxx-client/couchbase/transactions/attempt_context.hxx +10 -10
  285. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_keyspace.hxx +8 -58
  286. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_options.hxx +28 -70
  287. package/deps/couchbase-cxx-client/couchbase/transactions/transaction_query_options.hxx +7 -2
  288. package/deps/couchbase-cxx-client/couchbase/transactions/transactions_cleanup_config.hxx +2 -1
  289. package/deps/couchbase-cxx-client/couchbase/transactions/transactions_config.hxx +11 -38
  290. package/deps/couchbase-cxx-client/couchbase/unfreeze_plan_search_index_options.hxx +43 -0
  291. package/deps/couchbase-cxx-client/couchbase/unlock_options.hxx +0 -24
  292. package/deps/couchbase-cxx-client/couchbase/update_collection_options.hxx +32 -3
  293. package/deps/couchbase-cxx-client/couchbase/upsert_options.hxx +0 -24
  294. package/deps/couchbase-cxx-client/couchbase/upsert_search_index_options.hxx +41 -0
  295. package/deps/couchbase-cxx-client/couchbase/vector_query.hxx +99 -0
  296. package/deps/couchbase-cxx-client/couchbase/vector_search.hxx +85 -0
  297. package/deps/couchbase-cxx-client/couchbase/vector_search_options.hxx +76 -0
  298. package/dist/binding.d.ts +16 -9
  299. package/dist/binding.js +4 -1
  300. package/dist/bindingutilities.d.ts +6 -1
  301. package/dist/bindingutilities.js +17 -1
  302. package/dist/cluster.d.ts +12 -1
  303. package/dist/cluster.js +22 -0
  304. package/dist/collection.js +3 -3
  305. package/dist/couchbase.d.ts +1 -0
  306. package/dist/couchbase.js +1 -0
  307. package/dist/errors.d.ts +9 -0
  308. package/dist/errors.js +14 -2
  309. package/dist/searchexecutor.d.ts +2 -2
  310. package/dist/searchexecutor.js +19 -3
  311. package/dist/searchtypes.d.ts +46 -0
  312. package/dist/searchtypes.js +81 -1
  313. package/dist/transactions.d.ts +2 -0
  314. package/dist/transactions.js +2 -3
  315. package/dist/usermanager.js +1 -1
  316. package/dist/vectorsearch.d.ts +99 -0
  317. package/dist/vectorsearch.js +132 -0
  318. package/package.json +7 -7
  319. package/src/binding.cpp +1 -0
  320. package/src/connection.cpp +12 -9
  321. package/src/connection.hpp +3 -3
  322. package/src/connection_autogen.cpp +7 -5
  323. package/src/constants.cpp +14 -0
  324. package/src/instance.cpp +2 -2
  325. package/src/instance.hpp +1 -1
  326. package/src/jstocbpp_autogen.hpp +45 -45
  327. package/src/jstocbpp_basic.hpp +2 -0
  328. package/src/jstocbpp_errors.hpp +1 -0
  329. package/src/jstocbpp_transactions.hpp +6 -22
  330. package/src/mutationtoken.hpp +1 -0
  331. package/tools/gen-bindings-json.py +41 -16
  332. package/deps/couchbase-cxx-client/core/impl/append.cxx +0 -87
  333. package/deps/couchbase-cxx-client/core/impl/build_deferred_query_indexes.cxx +0 -157
  334. package/deps/couchbase-cxx-client/core/impl/create_bucket.cxx +0 -158
  335. package/deps/couchbase-cxx-client/core/impl/create_collection.cxx +0 -83
  336. package/deps/couchbase-cxx-client/core/impl/create_query_index.cxx +0 -232
  337. package/deps/couchbase-cxx-client/core/impl/create_scope.cxx +0 -69
  338. package/deps/couchbase-cxx-client/core/impl/decrement.cxx +0 -96
  339. package/deps/couchbase-cxx-client/core/impl/drop_bucket.cxx +0 -66
  340. package/deps/couchbase-cxx-client/core/impl/drop_collection.cxx +0 -76
  341. package/deps/couchbase-cxx-client/core/impl/drop_query_index.cxx +0 -187
  342. package/deps/couchbase-cxx-client/core/impl/drop_scope.cxx +0 -68
  343. package/deps/couchbase-cxx-client/core/impl/exists.cxx +0 -47
  344. package/deps/couchbase-cxx-client/core/impl/flush_bucket.cxx +0 -66
  345. package/deps/couchbase-cxx-client/core/impl/get.cxx +0 -68
  346. package/deps/couchbase-cxx-client/core/impl/get_all_buckets.cxx +0 -178
  347. package/deps/couchbase-cxx-client/core/impl/get_all_query_indexes.cxx +0 -106
  348. package/deps/couchbase-cxx-client/core/impl/get_all_replicas.cxx +0 -145
  349. package/deps/couchbase-cxx-client/core/impl/get_all_scopes.cxx +0 -94
  350. package/deps/couchbase-cxx-client/core/impl/get_and_lock.cxx +0 -49
  351. package/deps/couchbase-cxx-client/core/impl/get_and_touch.cxx +0 -49
  352. package/deps/couchbase-cxx-client/core/impl/get_any_replica.cxx +0 -134
  353. package/deps/couchbase-cxx-client/core/impl/get_bucket.cxx +0 -168
  354. package/deps/couchbase-cxx-client/core/impl/increment.cxx +0 -96
  355. package/deps/couchbase-cxx-client/core/impl/insert.cxx +0 -90
  356. package/deps/couchbase-cxx-client/core/impl/lookup_in.cxx +0 -69
  357. package/deps/couchbase-cxx-client/core/impl/lookup_in_all_replicas.cxx +0 -178
  358. package/deps/couchbase-cxx-client/core/impl/lookup_in_any_replica.cxx +0 -169
  359. package/deps/couchbase-cxx-client/core/impl/mutate_in.cxx +0 -125
  360. package/deps/couchbase-cxx-client/core/impl/prepend.cxx +0 -87
  361. package/deps/couchbase-cxx-client/core/impl/remove.cxx +0 -86
  362. package/deps/couchbase-cxx-client/core/impl/replace.cxx +0 -102
  363. package/deps/couchbase-cxx-client/core/impl/touch.cxx +0 -49
  364. package/deps/couchbase-cxx-client/core/impl/unlock.cxx +0 -47
  365. package/deps/couchbase-cxx-client/core/impl/update_bucket.cxx +0 -133
  366. package/deps/couchbase-cxx-client/core/impl/update_collection.cxx +0 -83
  367. package/deps/couchbase-cxx-client/core/impl/upsert.cxx +0 -100
  368. package/deps/couchbase-cxx-client/core/impl/watch_query_indexes.cxx +0 -196
  369. package/deps/couchbase-cxx-client/core/operations/mcbp_noop.hxx +0 -49
  370. /package/deps/couchbase-cxx-client/core/impl/{streaming_json_lexter_error_category.cxx → streaming_json_lexer_error_category.cxx} +0 -0
@@ -15,18 +15,54 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- #include "cluster.hxx"
19
-
20
18
  #include "couchbase/build_config.hxx"
21
19
 
20
+ #include "cluster.hxx"
21
+
22
+ #include "bucket.hxx"
23
+ #include "capella_ca.hxx"
24
+ #include "core/impl/get_replica.hxx"
25
+ #include "core/impl/lookup_in_replica.hxx"
26
+ #include "core/impl/observe_seqno.hxx"
27
+ #include "core/io/http_command.hxx"
28
+ #include "core/io/http_session_manager.hxx"
29
+ #include "core/io/mcbp_command.hxx"
30
+ #include "core/io/mcbp_session.hxx"
31
+ #include "core/management/analytics_link.hxx"
22
32
  #include "core/mcbp/completion_token.hxx"
23
33
  #include "core/mcbp/queue_request.hxx"
34
+ #include "core/metrics/logging_meter.hxx"
35
+ #include "core/metrics/noop_meter.hxx"
36
+ #include "core/operations.hxx"
37
+ #include "core/operations/management/analytics.hxx"
38
+ #include "core/operations/management/bucket.hxx"
39
+ #include "core/operations/management/bucket_describe.hxx"
40
+ #include "core/operations/management/cluster_describe.hxx"
41
+ #include "core/operations/management/cluster_developer_preview_enable.hxx"
42
+ #include "core/operations/management/collections.hxx"
43
+ #include "core/operations/management/eventing.hxx"
44
+ #include "core/operations/management/freeform.hxx"
45
+ #include "core/operations/management/query.hxx"
46
+ #include "core/operations/management/search.hxx"
47
+ #include "core/operations/management/user.hxx"
48
+ #include "core/operations/management/view.hxx"
49
+ #include "core/tracing/noop_tracer.hxx"
50
+ #include "core/tracing/threshold_logging_tracer.hxx"
51
+ #include "core/utils/join_strings.hxx"
52
+ #include "crud_component.hxx"
53
+ #include "dispatcher.hxx"
54
+ #include "impl/dns_srv_tracker.hxx"
55
+ #include "mozilla_ca_bundle.hxx"
24
56
  #include "ping_collector.hxx"
25
57
  #include "ping_reporter.hxx"
26
58
 
59
+ #include <asio/ssl.hpp>
60
+ #include <fstream>
61
+ #include <memory>
62
+ #include <thread>
63
+
27
64
  namespace couchbase::core
28
65
  {
29
-
30
66
  class ping_collector_impl
31
67
  : public std::enable_shared_from_this<ping_collector_impl>
32
68
  , public diag::ping_reporter
@@ -44,7 +80,7 @@ class ping_collector_impl
44
80
  {
45
81
  }
46
82
 
47
- ~ping_collector_impl()
83
+ ~ping_collector_impl() override
48
84
  {
49
85
  invoke_handler();
50
86
  }
@@ -56,7 +92,7 @@ class ping_collector_impl
56
92
 
57
93
  void report(diag::endpoint_ping_info&& info) override
58
94
  {
59
- std::scoped_lock lock(mutex_);
95
+ const std::scoped_lock lock(mutex_);
60
96
  res_.services[info.type].emplace_back(std::move(info));
61
97
  if (--expected_ == 0) {
62
98
  invoke_handler();
@@ -78,143 +114,1490 @@ class ping_collector_impl
78
114
  }
79
115
  };
80
116
 
81
- void
82
- cluster::configure_tls_options(bool has_capella_host)
117
+ class cluster_impl : public std::enable_shared_from_this<cluster_impl>
83
118
  {
84
- asio::ssl::context::options tls_options =
85
- asio::ssl::context::default_workarounds | // various bug workarounds that should be rather harmless
86
- asio::ssl::context::no_sslv2 | // published: 1995, deprecated: 2011
87
- asio::ssl::context::no_sslv3; // published: 1996, deprecated: 2015
88
- if (origin_.options().tls_disable_deprecated_protocols) {
89
- tls_options |= asio::ssl::context::no_tlsv1 | // published: 1999, deprecated: 2021
90
- asio::ssl::context::no_tlsv1_1; // published: 2006, deprecated: 2021
91
- }
92
- if (origin_.options().tls_disable_v1_2 || has_capella_host) {
93
- tls_options |= asio::ssl::context::no_tlsv1_2; // published: 2008, still in use
119
+ public:
120
+ explicit cluster_impl(asio::io_context& ctx)
121
+ : ctx_(ctx)
122
+ , work_(asio::make_work_guard(ctx_))
123
+ , session_manager_(std::make_shared<io::http_session_manager>(id_, ctx_, tls_))
124
+ {
94
125
  }
95
- tls_.set_options(tls_options);
96
- switch (origin_.options().tls_verify) {
97
- case tls_verify_mode::none:
98
- tls_.set_verify_mode(asio::ssl::verify_none);
99
- break;
100
126
 
101
- case tls_verify_mode::peer:
102
- tls_.set_verify_mode(asio::ssl::verify_peer);
103
- break;
127
+ auto io_context() -> asio::io_context&
128
+ {
129
+ return ctx_;
104
130
  }
105
131
 
132
+ void configure_tls_options(bool has_capella_host)
133
+ {
134
+ asio::ssl::context::options tls_options =
135
+ asio::ssl::context::default_workarounds | // various bug workarounds that should be rather harmless
136
+ asio::ssl::context::no_sslv2 | // published: 1995, deprecated: 2011
137
+ asio::ssl::context::no_sslv3; // published: 1996, deprecated: 2015
138
+ if (origin_.options().tls_disable_deprecated_protocols) {
139
+ tls_options |= asio::ssl::context::no_tlsv1 | // published: 1999, deprecated: 2021
140
+ asio::ssl::context::no_tlsv1_1; // published: 2006, deprecated: 2021
141
+ }
142
+ if (origin_.options().tls_disable_v1_2 || has_capella_host) {
143
+ tls_options |= asio::ssl::context::no_tlsv1_2; // published: 2008, still in use
144
+ }
145
+ tls_.set_options(tls_options);
146
+ switch (origin_.options().tls_verify) {
147
+ case tls_verify_mode::none:
148
+ tls_.set_verify_mode(asio::ssl::verify_none);
149
+ break;
150
+
151
+ case tls_verify_mode::peer:
152
+ tls_.set_verify_mode(asio::ssl::verify_peer);
153
+ break;
154
+ }
155
+
106
156
  #ifdef COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE
107
- SSL_CTX_set_keylog_callback(tls_.native_handle(), [](const SSL* /* ssl */, const char* line) {
108
- std::ofstream keylog(COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE, std::ios::out | std::ios::app | std::ios::binary);
109
- keylog << std::string_view(line) << std::endl;
110
- });
111
- CB_LOG_CRITICAL(
112
- "COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE was set to \"{}\" during build, all TLS keys will be logged for network analysis "
113
- "(https://wiki.wireshark.org/TLS). DO NOT USE THIS BUILD IN PRODUCTION",
114
- COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE);
157
+ SSL_CTX_set_keylog_callback(tls_.native_handle(), [](const SSL* /* ssl */, const char* line) {
158
+ std::ofstream keylog(COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE, std::ios::out | std::ios::app | std::ios::binary);
159
+ keylog << std::string_view(line) << std::endl;
160
+ });
161
+ CB_LOG_CRITICAL(
162
+ "COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE was set to \"{}\" during build, all TLS keys will be logged for network analysis "
163
+ "(https://wiki.wireshark.org/TLS). DO NOT USE THIS BUILD IN PRODUCTION",
164
+ COUCHBASE_CXX_CLIENT_TLS_KEY_LOG_FILE);
115
165
  #endif
116
- }
166
+ }
117
167
 
118
- void
119
- cluster::do_ping(std::optional<std::string> report_id,
120
- std::optional<std::string> bucket_name,
121
- std::set<service_type> services,
122
- utils::movable_function<void(diag::ping_result)> handler)
123
- {
124
- if (!report_id) {
125
- report_id = std::make_optional(uuid::to_string(uuid::random()));
168
+ void open(couchbase::core::origin origin, utils::movable_function<void(std::error_code)>&& handler)
169
+ {
170
+ if (stopped_) {
171
+ return handler(errc::network::cluster_closed);
172
+ }
173
+ if (origin.get_nodes().empty()) {
174
+ stopped_ = true;
175
+ work_.reset();
176
+ return handler(errc::common::invalid_argument);
177
+ }
178
+
179
+ origin_ = std::move(origin);
180
+ CB_LOG_DEBUG(R"(open cluster, id: "{}", core version: "{}", {})", id_, couchbase::core::meta::sdk_semver(), origin_.to_json());
181
+ // ignore the enable_tracing flag if a tracer was passed in
182
+ if (nullptr != origin_.options().tracer) {
183
+ tracer_ = origin_.options().tracer;
184
+ } else {
185
+ if (origin_.options().enable_tracing) {
186
+ tracer_ = std::make_shared<tracing::threshold_logging_tracer>(ctx_, origin_.options().tracing_options);
187
+ } else {
188
+ tracer_ = std::make_shared<tracing::noop_tracer>();
189
+ }
190
+ }
191
+ tracer_->start();
192
+ // ignore the metrics options if a meter was passed in.
193
+ if (nullptr != origin_.options().meter) {
194
+ meter_ = origin_.options().meter;
195
+ } else {
196
+ if (origin_.options().enable_metrics) {
197
+ meter_ = std::make_shared<metrics::logging_meter>(ctx_, origin_.options().metrics_options);
198
+ } else {
199
+ meter_ = std::make_shared<metrics::noop_meter>();
200
+ }
201
+ }
202
+ meter_->start();
203
+ session_manager_->set_tracer(tracer_);
204
+ if (origin_.options().enable_dns_srv) {
205
+ std::string hostname;
206
+ std::string port;
207
+ std::tie(hostname, port) = origin_.next_address();
208
+ dns_srv_tracker_ =
209
+ std::make_shared<impl::dns_srv_tracker>(ctx_, hostname, origin_.options().dns_config, origin_.options().enable_tls);
210
+ return asio::post(asio::bind_executor(
211
+ ctx_, [self = shared_from_this(), hostname = std::move(hostname), handler = std::move(handler)]() mutable {
212
+ return self->dns_srv_tracker_->get_srv_nodes([self, hostname = std::move(hostname), handler = std::move(handler)](
213
+ origin::node_list nodes, std::error_code ec) mutable {
214
+ if (ec) {
215
+ return self->close([ec, handler = std::move(handler)]() mutable { handler(ec); });
216
+ }
217
+ if (!nodes.empty()) {
218
+ self->origin_.set_nodes(std::move(nodes));
219
+ CB_LOG_INFO("replace list of bootstrap nodes with addresses from DNS SRV of \"{}\": [{}]",
220
+ hostname,
221
+ utils::join_strings(self->origin_.get_nodes(), ", "));
222
+ }
223
+ return self->do_open(std::move(handler));
224
+ });
225
+ }));
226
+ }
227
+ do_open(std::move(handler));
228
+ }
229
+
230
+ void open_bucket(const std::string& bucket_name, utils::movable_function<void(std::error_code)>&& handler)
231
+ {
232
+ if (stopped_) {
233
+ return handler(errc::network::cluster_closed);
234
+ }
235
+ std::shared_ptr<bucket> b{};
236
+ {
237
+ std::scoped_lock lock(buckets_mutex_);
238
+ auto ptr = buckets_.find(bucket_name);
239
+ if (ptr == buckets_.end()) {
240
+ std::vector<protocol::hello_feature> known_features;
241
+ if (session_ && session_->has_config()) {
242
+ known_features = session_->supported_features();
243
+ }
244
+ b = std::make_shared<bucket>(id_, ctx_, tls_, tracer_, meter_, bucket_name, origin_, known_features, dns_srv_tracker_);
245
+ buckets_.try_emplace(bucket_name, b);
246
+ }
247
+ }
248
+ if (b == nullptr) {
249
+ return handler({});
250
+ }
251
+
252
+ b->on_configuration_update(session_manager_);
253
+ b->bootstrap([self = shared_from_this(), bucket_name, handler = std::move(handler)](std::error_code ec,
254
+ const topology::configuration& config) mutable {
255
+ if (ec) {
256
+ std::scoped_lock lock(self->buckets_mutex_);
257
+ self->buckets_.erase(bucket_name);
258
+ } else if (self->session_ && !self->session_->supports_gcccp()) {
259
+ self->session_manager_->set_configuration(config, self->origin_.options());
260
+ }
261
+ handler(ec);
262
+ });
126
263
  }
127
- if (stopped_) {
128
- return handler({ report_id.value(), meta::sdk_id() });
264
+
265
+ void close_bucket(const std::string& bucket_name, utils::movable_function<void(std::error_code)>&& handler)
266
+ {
267
+ if (stopped_) {
268
+ return handler(errc::network::cluster_closed);
269
+ }
270
+ std::shared_ptr<bucket> b{};
271
+ {
272
+ std::scoped_lock lock(buckets_mutex_);
273
+
274
+ if (auto ptr = buckets_.find(bucket_name); ptr != buckets_.end()) {
275
+ b = std::move(ptr->second);
276
+ buckets_.erase(ptr);
277
+ }
278
+ }
279
+ if (b != nullptr) {
280
+ b->close();
281
+ }
282
+ return handler({});
129
283
  }
130
- if (services.empty()) {
131
- services = {
132
- service_type::key_value, service_type::view, service_type::query, service_type::search,
133
- service_type::analytics, service_type::management, service_type::eventing,
134
- };
284
+
285
+ std::pair<std::error_code, couchbase::core::origin> origin() const
286
+ {
287
+ if (stopped_) {
288
+ return { errc::network::cluster_closed, {} };
289
+ }
290
+ return { {}, origin_ };
135
291
  }
136
- asio::post(
137
- asio::bind_executor(ctx_, [cluster = shared_from_this(), report_id, bucket_name, services, handler = std::move(handler)]() mutable {
138
- auto collector = std::make_shared<ping_collector_impl>(report_id.value(), std::move(handler));
139
- if (bucket_name) {
140
- if (services.find(service_type::key_value) != services.end()) {
141
- if (auto bucket = cluster->find_bucket_by_name(bucket_name.value()); bucket) {
142
- return bucket->ping(collector);
143
- }
144
- cluster->open_bucket(bucket_name.value(), [collector, cluster, bucket_name](std::error_code ec) {
145
- if (!ec) {
146
- if (auto bucket = cluster->find_bucket_by_name(bucket_name.value()); bucket) {
147
- return bucket->ping(collector);
292
+
293
+ template<class Request,
294
+ class Handler,
295
+ typename std::enable_if_t<!std::is_same_v<typename Request::encoded_request_type, io::http_request>, int> = 0>
296
+ void execute(Request request, Handler&& handler)
297
+ {
298
+ using response_type = typename Request::encoded_response_type;
299
+ if (stopped_) {
300
+ return handler(request.make_response(make_key_value_error_context(errc::network::cluster_closed, request.id), response_type{}));
301
+ }
302
+ if (auto bucket = find_bucket_by_name(request.id.bucket()); bucket != nullptr) {
303
+ return bucket->execute(std::move(request), std::forward<Handler>(handler));
304
+ }
305
+ if (request.id.bucket().empty()) {
306
+ return handler(
307
+ request.make_response(make_key_value_error_context(errc::common::bucket_not_found, request.id), response_type{}));
308
+ }
309
+ auto bucket_name = request.id.bucket();
310
+ return open_bucket(
311
+ bucket_name,
312
+ [self = shared_from_this(), request = std::move(request), handler = std::forward<Handler>(handler)](std::error_code ec) mutable {
313
+ if (ec) {
314
+ return handler(request.make_response(make_key_value_error_context(ec, request.id), response_type{}));
315
+ }
316
+ return self->execute(std::move(request), std::forward<Handler>(handler));
317
+ });
318
+ }
319
+
320
+ template<class Request,
321
+ class Handler,
322
+ typename std::enable_if_t<std::is_same_v<typename Request::encoded_request_type, io::http_request>, int> = 0>
323
+ void execute(Request request, Handler&& handler)
324
+ {
325
+ using response_type = typename Request::encoded_response_type;
326
+ if (stopped_) {
327
+ return handler(request.make_response({ errc::network::cluster_closed }, response_type{}));
328
+ }
329
+ if constexpr (operations::is_compound_operation_v<Request>) {
330
+ return request.execute(shared_from_this(), std::forward<Handler>(handler));
331
+ } else {
332
+ return session_manager_->execute(std::move(request), std::forward<Handler>(handler), origin_.credentials());
333
+ }
334
+ }
335
+
336
+ template<class Request,
337
+ class Handler,
338
+ typename std::enable_if_t<std::is_same_v<typename Request::encoded_request_type, io::http_request>, int> = 0>
339
+ void execute_with_bucket_capability_check(Request request, bucket_capability cap, Handler&& handler)
340
+ {
341
+ auto bucket_name = request.bucket_name;
342
+ return open_bucket(
343
+ bucket_name,
344
+ [self = shared_from_this(), bucket_name, cap, request = std::move(request), handler = std::forward<Handler>(handler)](
345
+ std::error_code ec) mutable {
346
+ if (ec) {
347
+ handler(request.make_response({ ec }, {}));
348
+ return;
349
+ }
350
+ return self->with_bucket_configuration(
351
+ bucket_name,
352
+ [self = std::move(self), cap, request = std::move(request), handler = std::forward<Handler>(handler)](
353
+ std::error_code ec, topology::configuration config) mutable {
354
+ if (ec) {
355
+ handler(request.make_response({ ec }, {}));
356
+ return;
357
+ }
358
+ auto bucket_caps = config.bucket_capabilities;
359
+ if (bucket_caps.find(cap) == bucket_caps.end()) {
360
+ handler(request.make_response({ errc::common::feature_not_available }, {}));
361
+ return;
362
+ }
363
+ return self->execute(std::move(request), std::forward<Handler>(handler));
364
+ });
365
+ });
366
+ }
367
+
368
+ std::shared_ptr<bucket> find_bucket_by_name(const std::string& name)
369
+ {
370
+ std::scoped_lock lock(buckets_mutex_);
371
+
372
+ auto bucket = buckets_.find(name);
373
+ if (bucket == buckets_.end()) {
374
+ return {};
375
+ }
376
+ return bucket->second;
377
+ }
378
+
379
+ void for_each_bucket(utils::movable_function<void(std::shared_ptr<bucket>)> handler)
380
+ {
381
+ std::vector<std::shared_ptr<bucket>> buckets{};
382
+ {
383
+ std::scoped_lock lock(buckets_mutex_);
384
+ buckets.reserve(buckets_.size());
385
+ for (const auto& [name, bucket] : buckets_) {
386
+ buckets.push_back(bucket);
387
+ }
388
+ }
389
+ for (auto bucket : buckets) {
390
+ handler(bucket);
391
+ }
392
+ }
393
+
394
+ void do_open(utils::movable_function<void(std::error_code)> handler)
395
+ {
396
+ // Warn users if idle_http_connection_timeout is too close to server idle timeouts
397
+ if (origin_.options().idle_http_connection_timeout > std::chrono::milliseconds(4'500)) {
398
+ CB_LOG_INFO("[{}]: The SDK may produce trivial warnings due to the idle HTTP connection timeout being set above the idle"
399
+ "timeout of various services",
400
+ id_);
401
+ }
402
+
403
+ // Warn users if they attempt to use Capella without TLS being enabled.
404
+ bool has_capella_host = false;
405
+ {
406
+ bool has_non_capella_host = false;
407
+ static std::string suffix = "cloud.couchbase.com";
408
+ for (const auto& node : origin_.get_hostnames()) {
409
+ if (auto pos = node.find(suffix); pos != std::string::npos && pos + suffix.size() == node.size()) {
410
+ has_capella_host = true;
411
+ } else {
412
+ has_non_capella_host = true;
413
+ }
414
+ }
415
+
416
+ if (has_capella_host && !origin_.options().enable_tls) {
417
+ CB_LOG_WARNING("[{}]: TLS is required when connecting to Couchbase Capella. Please enable TLS by prefixing "
418
+ "the connection string with \"couchbases://\" (note the final 's').",
419
+ id_);
420
+ }
421
+
422
+ if (origin_.options().enable_tls /* TLS is enabled */
423
+ && origin_.options().trust_certificate.empty() /* No CA certificate (or other SDK-specific trust source) is specified */
424
+ && origin_.options().trust_certificate_value.empty() /* and certificate value has not been specified */
425
+ && origin_.options().tls_verify != tls_verify_mode::none /* The user did not disable all TLS verification */
426
+ && has_non_capella_host /* The connection string has a hostname that does NOT end in ".cloud.couchbase.com" */) {
427
+ CB_LOG_WARNING("[{}] When TLS is enabled, the cluster options must specify certificate(s) to trust or ensure that they are "
428
+ "available in system CA store. (Unless connecting to cloud.couchbase.com.)",
429
+ id_);
430
+ }
431
+ }
432
+
433
+ if (origin_.options().enable_tls) {
434
+ configure_tls_options(has_capella_host);
435
+
436
+ if (origin_.options().trust_certificate.empty() &&
437
+ origin_.options().trust_certificate_value.empty()) { // trust certificate is not explicitly specified
438
+ CB_LOG_DEBUG(R"([{}]: use default CA for TLS verify)", id_);
439
+ std::error_code ec{};
440
+
441
+ // load system certificates
442
+ tls_.set_default_verify_paths(ec);
443
+ if (ec) {
444
+ CB_LOG_WARNING(R"([{}]: failed to load system CAs: {})", id_, ec.message());
445
+ }
446
+
447
+ // add the Capella Root CA in addition to system CAs
448
+ tls_.add_certificate_authority(
449
+ asio::const_buffer(couchbase::core::default_ca::capellaCaCert, strlen(couchbase::core::default_ca::capellaCaCert)), ec);
450
+ if (ec) {
451
+ CB_LOG_WARNING("[{}]: unable to load default CAs: {}", id_, ec.message());
452
+ // we don't consider this fatal and try to continue without it
453
+ }
454
+
455
+ if (const auto certificates = default_ca::mozilla_ca_certs();
456
+ !origin_.options().disable_mozilla_ca_certificates && !certificates.empty()) {
457
+ CB_LOG_DEBUG("[{}]: loading {} CA certificates from Mozilla bundle. Update date: \"{}\", SHA256: \"{}\"",
458
+ id_,
459
+ certificates.size(),
460
+ default_ca::mozilla_ca_certs_date(),
461
+ default_ca::mozilla_ca_certs_sha256());
462
+ for (const auto& cert : certificates) {
463
+ tls_.add_certificate_authority(asio::const_buffer(cert.body.data(), cert.body.size()), ec);
464
+ if (ec) {
465
+ CB_LOG_WARNING("[{}]: unable to load CA \"{}\" from Mozilla bundle: {}", id_, cert.authority, ec.message());
466
+ }
467
+ }
468
+ }
469
+ } else { // trust certificate is explicitly specified
470
+ std::error_code ec{};
471
+ // load only the explicit certificate
472
+ // system and default capella certificates are not loaded
473
+ if (!origin_.options().trust_certificate_value.empty()) {
474
+ CB_LOG_DEBUG(R"([{}]: use TLS certificate passed through via options object)", id_);
475
+ tls_.add_certificate_authority(asio::const_buffer(origin_.options().trust_certificate_value.data(),
476
+ origin_.options().trust_certificate_value.size()),
477
+ ec);
478
+ if (ec) {
479
+ CB_LOG_WARNING("[{}]: unable to load CA passed via options object: {}", id_, ec.message());
480
+ }
481
+ }
482
+ if (!origin_.options().trust_certificate.empty()) {
483
+ CB_LOG_DEBUG(R"([{}]: use TLS verify file: "{}")", id_, origin_.options().trust_certificate);
484
+ tls_.load_verify_file(origin_.options().trust_certificate, ec);
485
+ if (ec) {
486
+ CB_LOG_ERROR("[{}]: unable to load verify file \"{}\": {}", id_, origin_.options().trust_certificate, ec.message());
487
+ return close([ec, handler = std::move(handler)]() mutable { return handler(ec); });
488
+ }
489
+ }
490
+ }
491
+ if (origin_.credentials().uses_certificate()) {
492
+ std::error_code ec{};
493
+ CB_LOG_DEBUG(R"([{}]: use TLS certificate chain: "{}")", id_, origin_.certificate_path());
494
+ tls_.use_certificate_chain_file(origin_.certificate_path(), ec);
495
+ if (ec) {
496
+ CB_LOG_ERROR("[{}]: unable to load certificate chain \"{}\": {}", id_, origin_.certificate_path(), ec.message());
497
+ return close([ec, handler = std::move(handler)]() mutable { return handler(ec); });
498
+ }
499
+ CB_LOG_DEBUG(R"([{}]: use TLS private key: "{}")", id_, origin_.key_path());
500
+ tls_.use_private_key_file(origin_.key_path(), asio::ssl::context::file_format::pem, ec);
501
+ if (ec) {
502
+ CB_LOG_ERROR("[{}]: unable to load private key \"{}\": {}", id_, origin_.key_path(), ec.message());
503
+ return close([ec, handler = std::move(handler)]() mutable { return handler(ec); });
504
+ }
505
+ }
506
+ session_ = io::mcbp_session(id_, ctx_, tls_, origin_, dns_srv_tracker_);
507
+ } else {
508
+ session_ = io::mcbp_session(id_, ctx_, origin_, dns_srv_tracker_);
509
+ }
510
+ session_->bootstrap([self = shared_from_this(), handler = std::move(handler)](std::error_code ec,
511
+ const topology::configuration& config) mutable {
512
+ if (!ec) {
513
+ if (self->origin_.options().network == "auto") {
514
+ self->origin_.options().network = config.select_network(self->session_->bootstrap_hostname());
515
+ if (self->origin_.options().network == "default") {
516
+ CB_LOG_DEBUG(R"({} detected network is "{}")", self->session_->log_prefix(), self->origin_.options().network);
517
+ } else {
518
+ CB_LOG_INFO(R"({} detected network is "{}")", self->session_->log_prefix(), self->origin_.options().network);
519
+ }
520
+ }
521
+ if (self->origin_.options().network != "default") {
522
+ origin::node_list nodes;
523
+ nodes.reserve(config.nodes.size());
524
+ for (const auto& address : config.nodes) {
525
+ auto port =
526
+ address.port_or(self->origin_.options().network, service_type::key_value, self->origin_.options().enable_tls, 0);
527
+ if (port == 0) {
528
+ continue;
529
+ }
530
+ origin::node_entry node;
531
+ node.first = address.hostname_for(self->origin_.options().network);
532
+ node.second = std::to_string(port);
533
+ nodes.emplace_back(node);
534
+ }
535
+ self->origin_.set_nodes(nodes);
536
+ CB_LOG_INFO("replace list of bootstrap nodes with addresses of alternative network \"{}\": [{}]",
537
+ self->origin_.options().network,
538
+ utils::join_strings(self->origin_.get_nodes(), ","));
539
+ }
540
+ self->session_manager_->set_configuration(config, self->origin_.options());
541
+ self->session_->on_configuration_update(self->session_manager_);
542
+ self->session_->on_stop([self]() {
543
+ if (self->session_) {
544
+ self->session_.reset();
545
+ }
546
+ });
547
+ }
548
+ if (ec) {
549
+ return self->close([ec, handler = std::move(handler)]() mutable { handler(ec); });
550
+ }
551
+ handler(ec);
552
+ });
553
+ }
554
+
555
+ void with_bucket_configuration(const std::string& bucket_name,
556
+ utils::movable_function<void(std::error_code, topology::configuration)>&& handler)
557
+ {
558
+ if (stopped_) {
559
+ return handler(errc::network::cluster_closed, {});
560
+ }
561
+ if (auto bucket = find_bucket_by_name(bucket_name); bucket != nullptr) {
562
+ return bucket->with_configuration(std::move(handler));
563
+ }
564
+ return handler(errc::common::bucket_not_found, {});
565
+ }
566
+
567
+ void ping(std::optional<std::string> report_id,
568
+ std::optional<std::string> bucket_name,
569
+ std::set<service_type> services,
570
+ std::optional<std::chrono::milliseconds> timeout,
571
+ utils::movable_function<void(diag::ping_result)> handler)
572
+ {
573
+ if (!report_id) {
574
+ report_id = std::make_optional(uuid::to_string(uuid::random()));
575
+ }
576
+ if (stopped_) {
577
+ return handler({ report_id.value(), meta::sdk_id() });
578
+ }
579
+ if (services.empty()) {
580
+ services = {
581
+ service_type::key_value, service_type::view, service_type::query, service_type::search,
582
+ service_type::analytics, service_type::management, service_type::eventing,
583
+ };
584
+ }
585
+ asio::post(asio::bind_executor(
586
+ ctx_, [cluster = shared_from_this(), report_id, bucket_name, services, timeout, handler = std::move(handler)]() mutable {
587
+ auto collector = std::make_shared<ping_collector_impl>(report_id.value(), std::move(handler));
588
+ if (bucket_name) {
589
+ if (services.find(service_type::key_value) != services.end()) {
590
+ if (auto bucket = cluster->find_bucket_by_name(bucket_name.value()); bucket) {
591
+ return bucket->ping(collector, timeout);
592
+ }
593
+ cluster->open_bucket(bucket_name.value(), [collector, cluster, bucket_name, timeout](std::error_code ec) {
594
+ if (!ec) {
595
+ if (auto bucket = cluster->find_bucket_by_name(bucket_name.value()); bucket) {
596
+ return bucket->ping(collector, timeout);
597
+ }
148
598
  }
599
+ });
600
+ }
601
+ } else {
602
+ if (services.find(service_type::key_value) != services.end()) {
603
+ if (cluster->session_) {
604
+ cluster->session_->ping(collector->build_reporter(), timeout);
149
605
  }
150
- });
151
- }
152
- } else {
153
- if (services.find(service_type::key_value) != services.end()) {
154
- if (cluster->session_) {
155
- cluster->session_->ping(collector->build_reporter());
606
+ cluster->for_each_bucket([&collector, &timeout](auto bucket) { bucket->ping(collector, timeout); });
156
607
  }
157
- cluster->for_each_bucket([&collector](auto& bucket) { bucket->ping(collector); });
608
+ cluster->session_manager_->ping(services, timeout, collector, cluster->origin_.credentials());
158
609
  }
159
- cluster->session_manager_->ping(services, collector, cluster->origin_.credentials());
160
- }
161
- }));
162
- }
610
+ }));
611
+ }
163
612
 
164
- std::shared_ptr<bucket>
165
- cluster::find_bucket_by_name(const std::string& name)
166
- {
167
- std::scoped_lock lock(buckets_mutex_);
613
+ void diagnostics(std::optional<std::string> report_id, utils::movable_function<void(diag::diagnostics_result)>&& handler)
614
+ {
615
+ if (!report_id) {
616
+ report_id = std::make_optional(uuid::to_string(uuid::random()));
617
+ }
618
+ if (stopped_) {
619
+ return handler({ report_id.value(), couchbase::core::meta::sdk_id() });
620
+ }
621
+ asio::post(asio::bind_executor(ctx_, [self = shared_from_this(), report_id, handler = std::move(handler)]() mutable {
622
+ diag::diagnostics_result res{ report_id.value(), couchbase::core::meta::sdk_id() };
623
+ if (self->session_) {
624
+ res.services[service_type::key_value].emplace_back(self->session_->diag_info());
625
+ }
626
+ self->for_each_bucket([&res](const auto& bucket) { bucket->export_diag_info(res); });
627
+ self->session_manager_->export_diag_info(res);
628
+ handler(std::move(res));
629
+ }));
630
+ }
631
+
632
+ void close(utils::movable_function<void()>&& handler)
633
+ {
634
+ if (stopped_) {
635
+ return handler();
636
+ }
637
+ stopped_ = true;
638
+ asio::post(asio::bind_executor(ctx_, [self = shared_from_this(), handler = std::move(handler)]() mutable {
639
+ if (self->session_) {
640
+ self->session_->stop(retry_reason::do_not_retry);
641
+ self->session_.reset();
642
+ }
643
+ self->for_each_bucket([](auto bucket) { bucket->close(); });
644
+ self->session_manager_->close();
645
+ handler();
646
+ self->work_.reset();
647
+ if (self->tracer_) {
648
+ self->tracer_->stop();
649
+ }
650
+ self->tracer_.reset();
651
+ if (self->meter_) {
652
+ self->meter_->stop();
653
+ }
654
+ self->meter_.reset();
655
+ }));
656
+ }
657
+
658
+ auto direct_dispatch(const std::string& bucket_name, std::shared_ptr<couchbase::core::mcbp::queue_request> req) -> std::error_code
659
+ {
660
+ if (stopped_) {
661
+ return errc::network::cluster_closed;
662
+ }
663
+ if (bucket_name.empty()) {
664
+ return errc::common::invalid_argument;
665
+ }
666
+ if (auto bucket = find_bucket_by_name(bucket_name); bucket != nullptr) {
667
+ return bucket->direct_dispatch(std::move(req));
668
+ }
669
+
670
+ open_bucket(bucket_name, [self = shared_from_this(), req = std::move(req), bucket_name](std::error_code ec) mutable {
671
+ if (ec) {
672
+ return req->cancel(ec);
673
+ }
674
+ self->direct_dispatch(bucket_name, std::move(req));
675
+ });
676
+ return {};
677
+ }
678
+
679
+ auto direct_re_queue(const std::string& bucket_name, std::shared_ptr<mcbp::queue_request> req, bool is_retry) -> std::error_code
680
+ {
681
+ if (stopped_) {
682
+ return errc::network::cluster_closed;
683
+ }
684
+ if (bucket_name.empty()) {
685
+ return errc::common::invalid_argument;
686
+ }
687
+ if (auto bucket = find_bucket_by_name(bucket_name); bucket != nullptr) {
688
+ return bucket->direct_re_queue(std::move(req), is_retry);
689
+ }
168
690
 
169
- auto bucket = buckets_.find(name);
170
- if (bucket == buckets_.end()) {
691
+ open_bucket(bucket_name, [self = shared_from_this(), bucket_name, req = std::move(req), is_retry](std::error_code ec) mutable {
692
+ if (ec) {
693
+ return req->cancel(ec);
694
+ }
695
+ self->direct_re_queue(bucket_name, std::move(req), is_retry);
696
+ });
171
697
  return {};
172
698
  }
173
- return bucket->second;
699
+
700
+ private:
701
+ std::string id_{ uuid::to_string(uuid::random()) };
702
+ asio::io_context& ctx_;
703
+ asio::executor_work_guard<asio::io_context::executor_type> work_;
704
+ asio::ssl::context tls_{ asio::ssl::context::tls_client };
705
+ std::shared_ptr<io::http_session_manager> session_manager_;
706
+ std::optional<io::mcbp_session> session_{};
707
+ std::shared_ptr<impl::dns_srv_tracker> dns_srv_tracker_{};
708
+ std::mutex buckets_mutex_{};
709
+ std::map<std::string, std::shared_ptr<bucket>> buckets_{};
710
+ couchbase::core::origin origin_{};
711
+ std::shared_ptr<couchbase::tracing::request_tracer> tracer_{ nullptr };
712
+ std::shared_ptr<couchbase::metrics::meter> meter_{ nullptr };
713
+ std::atomic_bool stopped_{ false };
714
+ };
715
+
716
+ cluster::cluster(asio::io_context& ctx)
717
+ : impl_{ std::make_shared<cluster_impl>(ctx) }
718
+ {
719
+ }
720
+
721
+ auto
722
+ cluster::direct_dispatch(const std::string& bucket_name, std::shared_ptr<couchbase::core::mcbp::queue_request> req) const -> std::error_code
723
+ {
724
+ if (impl_) {
725
+ return impl_->direct_dispatch(bucket_name, std::move(req));
726
+ }
727
+ return errc::network::cluster_closed;
174
728
  }
175
729
 
176
730
  auto
177
- cluster::direct_dispatch(const std::string& bucket_name, std::shared_ptr<couchbase::core::mcbp::queue_request> req) -> std::error_code
731
+ cluster::direct_re_queue(const std::string& bucket_name, std::shared_ptr<mcbp::queue_request> req, bool is_retry) const -> std::error_code
178
732
  {
179
- if (stopped_) {
180
- return errc::network::cluster_closed;
733
+ if (impl_) {
734
+ return impl_->direct_re_queue(bucket_name, std::move(req), is_retry);
181
735
  }
182
- if (bucket_name.empty()) {
183
- return errc::common::invalid_argument;
736
+ return errc::network::cluster_closed;
737
+ }
738
+
739
+ void
740
+ cluster::close(utils::movable_function<void()>&& handler) const
741
+ {
742
+ if (impl_) {
743
+ impl_->close(std::move(handler));
184
744
  }
185
- if (auto bucket = find_bucket_by_name(bucket_name); bucket != nullptr) {
186
- return bucket->direct_dispatch(std::move(req));
745
+ }
746
+
747
+ void
748
+ cluster::open_bucket(const std::string& bucket_name, utils::movable_function<void(std::error_code)>&& handler) const
749
+ {
750
+ if (impl_) {
751
+ impl_->open_bucket(bucket_name, std::move(handler));
187
752
  }
753
+ }
188
754
 
189
- open_bucket(bucket_name, [self = shared_from_this(), req = std::move(req), bucket_name](std::error_code ec) mutable {
190
- if (ec) {
191
- return req->cancel(ec);
192
- }
193
- self->direct_dispatch(bucket_name, std::move(req));
194
- });
195
- return {};
755
+ void
756
+ cluster::open(couchbase::core::origin origin, utils::movable_function<void(std::error_code)>&& handler) const
757
+ {
758
+ if (impl_) {
759
+ impl_->open(std::move(origin), std::move(handler));
760
+ }
196
761
  }
197
762
 
198
- auto
199
- cluster::direct_re_queue(const std::string& bucket_name, std::shared_ptr<mcbp::queue_request> req, bool is_retry) -> std::error_code
763
+ void
764
+ cluster::diagnostics(std::optional<std::string> report_id, utils::movable_function<void(diag::diagnostics_result)>&& handler) const
200
765
  {
201
- if (stopped_) {
202
- return errc::network::cluster_closed;
766
+ if (impl_) {
767
+ impl_->diagnostics(std::move(report_id), std::move(handler));
203
768
  }
204
- if (bucket_name.empty()) {
205
- return errc::common::invalid_argument;
769
+ }
770
+
771
+ void
772
+ cluster::ping(std::optional<std::string> report_id,
773
+ std::optional<std::string> bucket_name,
774
+ std::set<service_type> services,
775
+ std::optional<std::chrono::milliseconds> timeout,
776
+ utils::movable_function<void(diag::ping_result)>&& handler) const
777
+ {
778
+ if (impl_) {
779
+ impl_->ping(std::move(report_id), std::move(bucket_name), std::move(services), std::move(timeout), std::move(handler));
206
780
  }
207
- if (auto bucket = find_bucket_by_name(bucket_name); bucket != nullptr) {
208
- return bucket->direct_re_queue(std::move(req), is_retry);
781
+ }
782
+
783
+ void
784
+ cluster::with_bucket_configuration(const std::string& bucket_name,
785
+ utils::movable_function<void(std::error_code, topology::configuration)>&& handler) const
786
+ {
787
+ if (impl_) {
788
+ impl_->with_bucket_configuration(bucket_name, std::move(handler));
209
789
  }
790
+ }
210
791
 
211
- open_bucket(bucket_name, [self = shared_from_this(), bucket_name, req = std::move(req), is_retry](std::error_code ec) mutable {
212
- if (ec) {
213
- return req->cancel(ec);
214
- }
215
- self->direct_re_queue(bucket_name, std::move(req), is_retry);
216
- });
217
- return {};
792
+ void
793
+ cluster::close_bucket(const std::string& bucket_name, utils::movable_function<void(std::error_code)>&& handler) const
794
+ {
795
+ if (impl_) {
796
+ impl_->close_bucket(bucket_name, std::move(handler));
797
+ }
798
+ }
799
+
800
+ std::pair<std::error_code, couchbase::core::origin>
801
+ cluster::origin() const
802
+ {
803
+ if (impl_) {
804
+ return impl_->origin();
805
+ }
806
+ return { errc::network::cluster_closed, {} };
807
+ }
808
+
809
+ auto
810
+ cluster::io_context() const -> asio::io_context&
811
+ {
812
+ return impl_->io_context();
813
+ }
814
+
815
+ void
816
+ cluster::execute(operations::append_request request, utils::movable_function<void(operations::append_response)>&& handler) const
817
+ {
818
+ return impl_->execute(std::move(request), std::move(handler));
819
+ }
820
+
821
+ void
822
+ cluster::execute(operations::decrement_request request, utils::movable_function<void(operations::decrement_response)>&& handler) const
823
+ {
824
+ return impl_->execute(std::move(request), std::move(handler));
825
+ }
826
+
827
+ void
828
+ cluster::execute(operations::exists_request request, utils::movable_function<void(operations::exists_response)>&& handler) const
829
+ {
830
+ return impl_->execute(std::move(request), std::move(handler));
831
+ }
832
+
833
+ void
834
+ cluster::execute(operations::get_request request, utils::movable_function<void(operations::get_response)>&& handler) const
835
+ {
836
+ return impl_->execute(std::move(request), std::move(handler));
837
+ }
838
+
839
+ void
840
+ cluster::execute(operations::get_all_replicas_request request,
841
+ utils::movable_function<void(operations::get_all_replicas_response)>&& handler) const
842
+ {
843
+ return request.execute(impl_, std::move(handler));
844
+ }
845
+
846
+ void
847
+ cluster::execute(operations::get_and_lock_request request, utils::movable_function<void(operations::get_and_lock_response)>&& handler) const
848
+ {
849
+ return impl_->execute(std::move(request), std::move(handler));
850
+ }
851
+
852
+ void
853
+ cluster::execute(operations::get_and_touch_request request,
854
+ utils::movable_function<void(operations::get_and_touch_response)>&& handler) const
855
+ {
856
+ return impl_->execute(std::move(request), std::move(handler));
857
+ }
858
+
859
+ void
860
+ cluster::execute(operations::get_any_replica_request request,
861
+ utils::movable_function<void(operations::get_any_replica_response)>&& handler) const
862
+ {
863
+ return request.execute(impl_, std::move(handler));
864
+ }
865
+
866
+ void
867
+ cluster::execute(operations::get_projected_request request,
868
+ utils::movable_function<void(operations::get_projected_response)>&& handler) const
869
+ {
870
+ return impl_->execute(std::move(request), std::move(handler));
871
+ }
872
+
873
+ void
874
+ cluster::execute(operations::increment_request request, utils::movable_function<void(operations::increment_response)>&& handler) const
875
+ {
876
+ return impl_->execute(std::move(request), std::move(handler));
877
+ }
878
+
879
+ void
880
+ cluster::execute(operations::insert_request request, utils::movable_function<void(operations::insert_response)>&& handler) const
881
+ {
882
+ return impl_->execute(std::move(request), std::move(handler));
883
+ }
884
+
885
+ void
886
+ cluster::execute(operations::lookup_in_request request, utils::movable_function<void(operations::lookup_in_response)>&& handler) const
887
+ {
888
+ return impl_->execute(std::move(request), std::move(handler));
889
+ }
890
+
891
+ void
892
+ cluster::execute(operations::lookup_in_any_replica_request request,
893
+ utils::movable_function<void(operations::lookup_in_any_replica_response)>&& handler) const
894
+ {
895
+ return request.execute(impl_, std::move(handler));
896
+ }
897
+
898
+ void
899
+ cluster::execute(operations::lookup_in_all_replicas_request request,
900
+ utils::movable_function<void(operations::lookup_in_all_replicas_response)>&& handler) const
901
+ {
902
+ return request.execute(impl_, std::move(handler));
903
+ }
904
+
905
+ void
906
+ cluster::execute(operations::mutate_in_request request, utils::movable_function<void(operations::mutate_in_response)>&& handler) const
907
+ {
908
+ return impl_->execute(std::move(request), std::move(handler));
909
+ }
910
+
911
+ void
912
+ cluster::execute(operations::prepend_request request, utils::movable_function<void(operations::prepend_response)>&& handler) const
913
+ {
914
+ return impl_->execute(std::move(request), std::move(handler));
915
+ }
916
+
917
+ void
918
+ cluster::execute(operations::query_request request, utils::movable_function<void(operations::query_response)>&& handler) const
919
+ {
920
+ return impl_->execute(std::move(request), std::move(handler));
921
+ }
922
+
923
+ void
924
+ cluster::execute(operations::remove_request request, utils::movable_function<void(operations::remove_response)>&& handler) const
925
+ {
926
+ return impl_->execute(std::move(request), std::move(handler));
927
+ }
928
+
929
+ void
930
+ cluster::execute(operations::replace_request request, utils::movable_function<void(operations::replace_response)>&& handler) const
931
+ {
932
+ return impl_->execute(std::move(request), std::move(handler));
933
+ }
934
+
935
+ void
936
+ cluster::execute(operations::search_request request, utils::movable_function<void(operations::search_response)>&& handler) const
937
+ {
938
+ return impl_->execute(std::move(request), std::move(handler));
939
+ }
940
+
941
+ void
942
+ cluster::execute(operations::touch_request request, utils::movable_function<void(operations::touch_response)>&& handler) const
943
+ {
944
+ return impl_->execute(std::move(request), std::move(handler));
218
945
  }
219
946
 
947
+ void
948
+ cluster::execute(operations::unlock_request request, utils::movable_function<void(operations::unlock_response)>&& handler) const
949
+ {
950
+ return impl_->execute(std::move(request), std::move(handler));
951
+ }
952
+
953
+ void
954
+ cluster::execute(operations::upsert_request request, utils::movable_function<void(operations::upsert_response)>&& handler) const
955
+ {
956
+ return impl_->execute(std::move(request), std::move(handler));
957
+ }
958
+
959
+ void
960
+ cluster::execute(operations::document_view_request request,
961
+ utils::movable_function<void(operations::document_view_response)>&& handler) const
962
+ {
963
+ return impl_->execute(std::move(request), std::move(handler));
964
+ }
965
+
966
+ void
967
+ cluster::execute(operations::http_noop_request request, utils::movable_function<void(operations::http_noop_response)>&& handler) const
968
+ {
969
+ return impl_->execute(std::move(request), std::move(handler));
970
+ }
971
+
972
+ void
973
+ cluster::execute(operations::management::analytics_dataset_create_request request,
974
+ utils::movable_function<void(operations::management::analytics_dataset_create_response)>&& handler) const
975
+ {
976
+ return impl_->execute(std::move(request), std::move(handler));
977
+ }
978
+
979
+ void
980
+ cluster::execute(operations::management::analytics_dataset_drop_request request,
981
+ utils::movable_function<void(operations::management::analytics_dataset_drop_response)>&& handler) const
982
+ {
983
+ return impl_->execute(std::move(request), std::move(handler));
984
+ }
985
+
986
+ void
987
+ cluster::execute(operations::management::analytics_dataset_get_all_request request,
988
+ utils::movable_function<void(operations::management::analytics_dataset_get_all_response)>&& handler) const
989
+ {
990
+ return impl_->execute(std::move(request), std::move(handler));
991
+ }
992
+
993
+ void
994
+ cluster::execute(operations::management::analytics_dataverse_create_request request,
995
+ utils::movable_function<void(operations::management::analytics_dataverse_create_response)>&& handler) const
996
+ {
997
+ return impl_->execute(std::move(request), std::move(handler));
998
+ }
999
+
1000
+ void
1001
+ cluster::execute(operations::management::analytics_dataverse_drop_request request,
1002
+ utils::movable_function<void(operations::management::analytics_dataverse_drop_response)>&& handler) const
1003
+ {
1004
+ return impl_->execute(std::move(request), std::move(handler));
1005
+ }
1006
+
1007
+ void
1008
+ cluster::execute(operations::management::analytics_get_pending_mutations_request request,
1009
+ utils::movable_function<void(operations::management::analytics_get_pending_mutations_response)>&& handler) const
1010
+ {
1011
+ return impl_->execute(std::move(request), std::move(handler));
1012
+ }
1013
+
1014
+ void
1015
+ cluster::execute(operations::management::analytics_index_create_request request,
1016
+ utils::movable_function<void(operations::management::analytics_index_create_response)>&& handler) const
1017
+ {
1018
+ return impl_->execute(std::move(request), std::move(handler));
1019
+ }
1020
+
1021
+ void
1022
+ cluster::execute(operations::management::analytics_index_drop_request request,
1023
+ utils::movable_function<void(operations::management::analytics_index_drop_response)>&& handler) const
1024
+ {
1025
+ return impl_->execute(std::move(request), std::move(handler));
1026
+ }
1027
+
1028
+ void
1029
+ cluster::execute(operations::management::analytics_index_get_all_request request,
1030
+ utils::movable_function<void(operations::management::analytics_index_get_all_response)>&& handler) const
1031
+ {
1032
+ return impl_->execute(std::move(request), std::move(handler));
1033
+ }
1034
+
1035
+ void
1036
+ cluster::execute(operations::management::analytics_link_connect_request request,
1037
+ utils::movable_function<void(operations::management::analytics_link_connect_response)>&& handler) const
1038
+ {
1039
+ return impl_->execute(std::move(request), std::move(handler));
1040
+ }
1041
+
1042
+ void
1043
+ cluster::execute(operations::management::analytics_link_disconnect_request request,
1044
+ utils::movable_function<void(operations::management::analytics_link_disconnect_response)>&& handler) const
1045
+ {
1046
+ return impl_->execute(std::move(request), std::move(handler));
1047
+ }
1048
+
1049
+ void
1050
+ cluster::execute(operations::management::analytics_link_drop_request request,
1051
+ utils::movable_function<void(operations::management::analytics_link_drop_response)>&& handler) const
1052
+ {
1053
+ return impl_->execute(std::move(request), std::move(handler));
1054
+ }
1055
+
1056
+ void
1057
+ cluster::execute(operations::management::analytics_link_get_all_request request,
1058
+ utils::movable_function<void(operations::management::analytics_link_get_all_response)>&& handler) const
1059
+ {
1060
+ return impl_->execute(std::move(request), std::move(handler));
1061
+ }
1062
+
1063
+ void
1064
+ cluster::execute(operations::management::bucket_create_request request,
1065
+ utils::movable_function<void(operations::management::bucket_create_response)>&& handler) const
1066
+ {
1067
+ return impl_->execute(std::move(request), std::move(handler));
1068
+ }
1069
+
1070
+ void
1071
+ cluster::execute(operations::management::bucket_drop_request request,
1072
+ utils::movable_function<void(operations::management::bucket_drop_response)>&& handler) const
1073
+ {
1074
+ return impl_->execute(std::move(request), std::move(handler));
1075
+ }
1076
+
1077
+ void
1078
+ cluster::execute(operations::management::bucket_flush_request request,
1079
+ utils::movable_function<void(operations::management::bucket_flush_response)>&& handler) const
1080
+ {
1081
+ return impl_->execute(std::move(request), std::move(handler));
1082
+ }
1083
+
1084
+ void
1085
+ cluster::execute(operations::management::bucket_get_request request,
1086
+ utils::movable_function<void(operations::management::bucket_get_response)>&& handler) const
1087
+ {
1088
+ return impl_->execute(std::move(request), std::move(handler));
1089
+ }
1090
+
1091
+ void
1092
+ cluster::execute(operations::management::bucket_get_all_request request,
1093
+ utils::movable_function<void(operations::management::bucket_get_all_response)>&& handler) const
1094
+ {
1095
+ return impl_->execute(std::move(request), std::move(handler));
1096
+ }
1097
+
1098
+ void
1099
+ cluster::execute(operations::management::bucket_update_request request,
1100
+ utils::movable_function<void(operations::management::bucket_update_response)>&& handler) const
1101
+ {
1102
+ return impl_->execute(std::move(request), std::move(handler));
1103
+ }
1104
+
1105
+ void
1106
+ cluster::execute(operations::management::collection_create_request request,
1107
+ utils::movable_function<void(operations::management::collection_create_response)>&& handler) const
1108
+ {
1109
+ if (request.history.has_value()) {
1110
+ return impl_->execute_with_bucket_capability_check(std::move(request), bucket_capability::non_deduped_history, std::move(handler));
1111
+ }
1112
+ return impl_->execute(std::move(request), std::move(handler));
1113
+ }
1114
+
1115
+ void
1116
+ cluster::execute(operations::management::collection_update_request request,
1117
+ utils::movable_function<void(operations::management::collection_update_response)>&& handler) const
1118
+ {
1119
+ if (request.history.has_value()) {
1120
+ return impl_->execute_with_bucket_capability_check(std::move(request), bucket_capability::non_deduped_history, std::move(handler));
1121
+ }
1122
+ return impl_->execute(std::move(request), std::move(handler));
1123
+ }
1124
+
1125
+ void
1126
+ cluster::execute(operations::management::collection_drop_request request,
1127
+ utils::movable_function<void(operations::management::collection_drop_response)>&& handler) const
1128
+ {
1129
+ return impl_->execute(std::move(request), std::move(handler));
1130
+ }
1131
+
1132
+ void
1133
+ cluster::execute(operations::management::collections_manifest_get_request request,
1134
+ utils::movable_function<void(operations::management::collections_manifest_get_response)>&& handler) const
1135
+ {
1136
+ return impl_->execute(std::move(request), std::move(handler));
1137
+ }
1138
+
1139
+ void
1140
+ cluster::execute(operations::management::scope_create_request request,
1141
+ utils::movable_function<void(operations::management::scope_create_response)>&& handler) const
1142
+ {
1143
+ return impl_->execute(std::move(request), std::move(handler));
1144
+ }
1145
+
1146
+ void
1147
+ cluster::execute(operations::management::scope_drop_request request,
1148
+ utils::movable_function<void(operations::management::scope_drop_response)>&& handler) const
1149
+ {
1150
+ return impl_->execute(std::move(request), std::move(handler));
1151
+ }
1152
+
1153
+ void
1154
+ cluster::execute(operations::management::scope_get_all_request request,
1155
+ utils::movable_function<void(operations::management::scope_get_all_response)>&& handler) const
1156
+ {
1157
+ return impl_->execute(std::move(request), std::move(handler));
1158
+ }
1159
+
1160
+ void
1161
+ cluster::execute(operations::management::eventing_deploy_function_request request,
1162
+ utils::movable_function<void(operations::management::eventing_deploy_function_response)>&& handler) const
1163
+ {
1164
+ return impl_->execute(std::move(request), std::move(handler));
1165
+ }
1166
+
1167
+ void
1168
+ cluster::execute(operations::management::eventing_drop_function_request request,
1169
+ utils::movable_function<void(operations::management::eventing_drop_function_response)>&& handler) const
1170
+ {
1171
+ return impl_->execute(std::move(request), std::move(handler));
1172
+ }
1173
+
1174
+ void
1175
+ cluster::execute(operations::management::eventing_get_all_functions_request request,
1176
+ utils::movable_function<void(operations::management::eventing_get_all_functions_response)>&& handler) const
1177
+ {
1178
+ return impl_->execute(std::move(request), std::move(handler));
1179
+ }
1180
+
1181
+ void
1182
+ cluster::execute(operations::management::eventing_get_function_request request,
1183
+ utils::movable_function<void(operations::management::eventing_get_function_response)>&& handler) const
1184
+ {
1185
+ return impl_->execute(std::move(request), std::move(handler));
1186
+ }
1187
+
1188
+ void
1189
+ cluster::execute(operations::management::eventing_get_status_request request,
1190
+ utils::movable_function<void(operations::management::eventing_get_status_response)>&& handler) const
1191
+ {
1192
+ return impl_->execute(std::move(request), std::move(handler));
1193
+ }
1194
+
1195
+ void
1196
+ cluster::execute(operations::management::eventing_pause_function_request request,
1197
+ utils::movable_function<void(operations::management::eventing_pause_function_response)>&& handler) const
1198
+ {
1199
+ return impl_->execute(std::move(request), std::move(handler));
1200
+ }
1201
+
1202
+ void
1203
+ cluster::execute(operations::management::eventing_resume_function_request request,
1204
+ utils::movable_function<void(operations::management::eventing_resume_function_response)>&& handler) const
1205
+ {
1206
+ return impl_->execute(std::move(request), std::move(handler));
1207
+ }
1208
+
1209
+ void
1210
+ cluster::execute(operations::management::eventing_undeploy_function_request request,
1211
+ utils::movable_function<void(operations::management::eventing_undeploy_function_response)>&& handler) const
1212
+ {
1213
+ return impl_->execute(std::move(request), std::move(handler));
1214
+ }
1215
+
1216
+ void
1217
+ cluster::execute(operations::management::eventing_upsert_function_request request,
1218
+ utils::movable_function<void(operations::management::eventing_upsert_function_response)>&& handler) const
1219
+ {
1220
+ return impl_->execute(std::move(request), std::move(handler));
1221
+ }
1222
+
1223
+ void
1224
+ cluster::execute(operations::management::view_index_drop_request request,
1225
+ utils::movable_function<void(operations::management::view_index_drop_response)>&& handler) const
1226
+ {
1227
+ return impl_->execute(std::move(request), std::move(handler));
1228
+ }
1229
+
1230
+ void
1231
+ cluster::execute(operations::management::view_index_get_request request,
1232
+ utils::movable_function<void(operations::management::view_index_get_response)>&& handler) const
1233
+ {
1234
+ return impl_->execute(std::move(request), std::move(handler));
1235
+ }
1236
+
1237
+ void
1238
+ cluster::execute(operations::management::view_index_get_all_request request,
1239
+ utils::movable_function<void(operations::management::view_index_get_all_response)>&& handler) const
1240
+ {
1241
+ return impl_->execute(std::move(request), std::move(handler));
1242
+ }
1243
+
1244
+ void
1245
+ cluster::execute(operations::management::view_index_upsert_request request,
1246
+ utils::movable_function<void(operations::management::view_index_upsert_response)>&& handler) const
1247
+ {
1248
+ return impl_->execute(std::move(request), std::move(handler));
1249
+ }
1250
+
1251
+ void
1252
+ cluster::execute(operations::management::change_password_request request,
1253
+ utils::movable_function<void(operations::management::change_password_response)>&& handler) const
1254
+ {
1255
+ return impl_->execute(std::move(request), std::move(handler));
1256
+ }
1257
+
1258
+ void
1259
+ cluster::execute(operations::management::group_drop_request request,
1260
+ utils::movable_function<void(operations::management::group_drop_response)>&& handler) const
1261
+ {
1262
+ return impl_->execute(std::move(request), std::move(handler));
1263
+ }
1264
+
1265
+ void
1266
+ cluster::execute(operations::management::group_get_request request,
1267
+ utils::movable_function<void(operations::management::group_get_response)>&& handler) const
1268
+ {
1269
+ return impl_->execute(std::move(request), std::move(handler));
1270
+ }
1271
+
1272
+ void
1273
+ cluster::execute(operations::management::group_get_all_request request,
1274
+ utils::movable_function<void(operations::management::group_get_all_response)>&& handler) const
1275
+ {
1276
+ return impl_->execute(std::move(request), std::move(handler));
1277
+ }
1278
+
1279
+ void
1280
+ cluster::execute(operations::management::group_upsert_request request,
1281
+ utils::movable_function<void(operations::management::group_upsert_response)>&& handler) const
1282
+ {
1283
+ return impl_->execute(std::move(request), std::move(handler));
1284
+ }
1285
+
1286
+ void
1287
+ cluster::execute(operations::management::role_get_all_request request,
1288
+ utils::movable_function<void(operations::management::role_get_all_response)>&& handler) const
1289
+ {
1290
+ return impl_->execute(std::move(request), std::move(handler));
1291
+ }
1292
+
1293
+ void
1294
+ cluster::execute(operations::management::user_drop_request request,
1295
+ utils::movable_function<void(operations::management::user_drop_response)>&& handler) const
1296
+ {
1297
+ return impl_->execute(std::move(request), std::move(handler));
1298
+ }
1299
+
1300
+ void
1301
+ cluster::execute(operations::management::user_get_request request,
1302
+ utils::movable_function<void(operations::management::user_get_response)>&& handler) const
1303
+ {
1304
+ return impl_->execute(std::move(request), std::move(handler));
1305
+ }
1306
+
1307
+ void
1308
+ cluster::execute(operations::management::user_get_all_request request,
1309
+ utils::movable_function<void(operations::management::user_get_all_response)>&& handler) const
1310
+ {
1311
+ return impl_->execute(std::move(request), std::move(handler));
1312
+ }
1313
+
1314
+ void
1315
+ cluster::execute(operations::management::user_upsert_request request,
1316
+ utils::movable_function<void(operations::management::user_upsert_response)>&& handler) const
1317
+ {
1318
+ return impl_->execute(std::move(request), std::move(handler));
1319
+ }
1320
+
1321
+ void
1322
+ cluster::execute(operations::management::search_get_stats_request request,
1323
+ utils::movable_function<void(operations::management::search_get_stats_response)>&& handler) const
1324
+ {
1325
+ return impl_->execute(std::move(request), std::move(handler));
1326
+ }
1327
+
1328
+ void
1329
+ cluster::execute(operations::management::search_index_analyze_document_request request,
1330
+ utils::movable_function<void(operations::management::search_index_analyze_document_response)>&& handler) const
1331
+ {
1332
+ return impl_->execute(std::move(request), std::move(handler));
1333
+ }
1334
+
1335
+ void
1336
+ cluster::execute(operations::management::search_index_control_ingest_request request,
1337
+ utils::movable_function<void(operations::management::search_index_control_ingest_response)>&& handler) const
1338
+ {
1339
+ return impl_->execute(std::move(request), std::move(handler));
1340
+ }
1341
+
1342
+ void
1343
+ cluster::execute(operations::management::search_index_control_plan_freeze_request request,
1344
+ utils::movable_function<void(operations::management::search_index_control_plan_freeze_response)>&& handler) const
1345
+ {
1346
+ return impl_->execute(std::move(request), std::move(handler));
1347
+ }
1348
+
1349
+ void
1350
+ cluster::execute(operations::management::search_index_control_query_request request,
1351
+ utils::movable_function<void(operations::management::search_index_control_query_response)>&& handler) const
1352
+ {
1353
+ return impl_->execute(std::move(request), std::move(handler));
1354
+ }
1355
+
1356
+ void
1357
+ cluster::execute(operations::management::search_index_drop_request request,
1358
+ utils::movable_function<void(operations::management::search_index_drop_response)>&& handler) const
1359
+ {
1360
+ return impl_->execute(std::move(request), std::move(handler));
1361
+ }
1362
+
1363
+ void
1364
+ cluster::execute(operations::management::search_index_get_request request,
1365
+ utils::movable_function<void(operations::management::search_index_get_response)>&& handler) const
1366
+ {
1367
+ return impl_->execute(std::move(request), std::move(handler));
1368
+ }
1369
+
1370
+ void
1371
+ cluster::execute(operations::management::search_index_get_all_request request,
1372
+ utils::movable_function<void(operations::management::search_index_get_all_response)>&& handler) const
1373
+ {
1374
+ return impl_->execute(std::move(request), std::move(handler));
1375
+ }
1376
+
1377
+ void
1378
+ cluster::execute(operations::management::search_index_get_documents_count_request request,
1379
+ utils::movable_function<void(operations::management::search_index_get_documents_count_response)>&& handler) const
1380
+ {
1381
+ return impl_->execute(std::move(request), std::move(handler));
1382
+ }
1383
+
1384
+ void
1385
+ cluster::execute(operations::management::search_index_get_stats_request request,
1386
+ utils::movable_function<void(operations::management::search_index_get_stats_response)>&& handler) const
1387
+ {
1388
+ return impl_->execute(std::move(request), std::move(handler));
1389
+ }
1390
+
1391
+ void
1392
+ cluster::execute(operations::management::search_index_upsert_request request,
1393
+ utils::movable_function<void(operations::management::search_index_upsert_response)>&& handler) const
1394
+ {
1395
+ return impl_->execute(std::move(request), std::move(handler));
1396
+ }
1397
+
1398
+ void
1399
+ cluster::execute(operations::management::query_index_build_request request,
1400
+ utils::movable_function<void(operations::management::query_index_build_response)>&& handler) const
1401
+ {
1402
+ return impl_->execute(std::move(request), std::move(handler));
1403
+ }
1404
+
1405
+ void
1406
+ cluster::execute(operations::management::query_index_build_deferred_request request,
1407
+ utils::movable_function<void(operations::management::query_index_build_deferred_response)>&& handler) const
1408
+ {
1409
+ return impl_->execute(std::move(request), std::move(handler));
1410
+ }
1411
+
1412
+ void
1413
+ cluster::execute(operations::management::query_index_create_request request,
1414
+ utils::movable_function<void(operations::management::query_index_create_response)>&& handler) const
1415
+ {
1416
+ return impl_->execute(std::move(request), std::move(handler));
1417
+ }
1418
+
1419
+ void
1420
+ cluster::execute(operations::management::query_index_drop_request request,
1421
+ utils::movable_function<void(operations::management::query_index_drop_response)>&& handler) const
1422
+ {
1423
+ return impl_->execute(std::move(request), std::move(handler));
1424
+ }
1425
+
1426
+ void
1427
+ cluster::execute(operations::management::query_index_get_all_request request,
1428
+ utils::movable_function<void(operations::management::query_index_get_all_response)>&& handler) const
1429
+ {
1430
+ return impl_->execute(std::move(request), std::move(handler));
1431
+ }
1432
+
1433
+ void
1434
+ cluster::execute(operations::management::query_index_get_all_deferred_request request,
1435
+ utils::movable_function<void(operations::management::query_index_get_all_deferred_response)>&& handler) const
1436
+ {
1437
+ return impl_->execute(std::move(request), std::move(handler));
1438
+ }
1439
+
1440
+ void
1441
+ cluster::execute(operations::management::bucket_describe_request request,
1442
+ utils::movable_function<void(operations::management::bucket_describe_response)>&& handler) const
1443
+ {
1444
+ return impl_->execute(std::move(request), std::move(handler));
1445
+ }
1446
+
1447
+ void
1448
+ cluster::execute(operations::management::cluster_describe_request request,
1449
+ utils::movable_function<void(operations::management::cluster_describe_response)>&& handler) const
1450
+ {
1451
+ return impl_->execute(std::move(request), std::move(handler));
1452
+ }
1453
+
1454
+ void
1455
+ cluster::execute(operations::management::cluster_developer_preview_enable_request request,
1456
+ utils::movable_function<void(operations::management::cluster_developer_preview_enable_response)>&& handler) const
1457
+ {
1458
+ return impl_->execute(std::move(request), std::move(handler));
1459
+ }
1460
+
1461
+ void
1462
+ cluster::execute(operations::management::freeform_request request,
1463
+ utils::movable_function<void(operations::management::freeform_response)>&& handler) const
1464
+ {
1465
+ return impl_->execute(std::move(request), std::move(handler));
1466
+ }
1467
+
1468
+ void
1469
+ cluster::execute(impl::get_replica_request request, utils::movable_function<void(impl::get_replica_response)>&& handler) const
1470
+ {
1471
+ return impl_->execute(std::move(request), std::move(handler));
1472
+ }
1473
+
1474
+ void
1475
+ cluster::execute(impl::observe_seqno_request request, utils::movable_function<void(impl::observe_seqno_response)>&& handler) const
1476
+ {
1477
+ return impl_->execute(std::move(request), std::move(handler));
1478
+ }
1479
+
1480
+ void
1481
+ cluster::execute(operations::management::analytics_link_replace_request<management::analytics::azure_blob_external_link> request,
1482
+ utils::movable_function<void(operations::management::analytics_link_replace_response)>&& handler) const
1483
+ {
1484
+ return impl_->execute(std::move(request), std::move(handler));
1485
+ }
1486
+
1487
+ void
1488
+ cluster::execute(operations::management::analytics_link_replace_request<management::analytics::couchbase_remote_link> request,
1489
+ utils::movable_function<void(operations::management::analytics_link_replace_response)>&& handler) const
1490
+ {
1491
+ return impl_->execute(std::move(request), std::move(handler));
1492
+ }
1493
+
1494
+ void
1495
+ cluster::execute(operations::management::analytics_link_replace_request<management::analytics::s3_external_link> request,
1496
+ utils::movable_function<void(operations::management::analytics_link_replace_response)>&& handler) const
1497
+ {
1498
+ return impl_->execute(std::move(request), std::move(handler));
1499
+ }
1500
+
1501
+ void
1502
+ cluster::execute(operations::management::analytics_link_create_request<management::analytics::azure_blob_external_link> request,
1503
+ utils::movable_function<void(operations::management::analytics_link_create_response)>&& handler) const
1504
+ {
1505
+ return impl_->execute(std::move(request), std::move(handler));
1506
+ }
1507
+
1508
+ void
1509
+ cluster::execute(operations::management::analytics_link_create_request<management::analytics::couchbase_remote_link> request,
1510
+ utils::movable_function<void(operations::management::analytics_link_create_response)>&& handler) const
1511
+ {
1512
+ return impl_->execute(std::move(request), std::move(handler));
1513
+ }
1514
+
1515
+ void
1516
+ cluster::execute(operations::management::analytics_link_create_request<management::analytics::s3_external_link> request,
1517
+ utils::movable_function<void(operations::management::analytics_link_create_response)>&& handler) const
1518
+ {
1519
+ return impl_->execute(std::move(request), std::move(handler));
1520
+ }
1521
+
1522
+ void
1523
+ cluster::execute(operations::analytics_request request, utils::movable_function<void(operations::analytics_response)>&& handler) const
1524
+ {
1525
+ return impl_->execute(std::move(request), std::move(handler));
1526
+ }
1527
+
1528
+ void
1529
+ cluster::execute(operations::upsert_request_with_legacy_durability request,
1530
+ utils::movable_function<void(operations::upsert_response)>&& handler) const
1531
+ {
1532
+ return request.execute(*this, std::move(handler));
1533
+ }
1534
+
1535
+ void
1536
+ cluster::execute(operations::insert_request_with_legacy_durability request,
1537
+ utils::movable_function<void(operations::insert_response)>&& handler) const
1538
+ {
1539
+ return request.execute(*this, std::move(handler));
1540
+ }
1541
+
1542
+ void
1543
+ cluster::execute(operations::append_request_with_legacy_durability request,
1544
+ utils::movable_function<void(operations::append_response)>&& handler) const
1545
+ {
1546
+ return request.execute(*this, std::move(handler));
1547
+ }
1548
+
1549
+ void
1550
+ cluster::execute(operations::prepend_request_with_legacy_durability request,
1551
+ utils::movable_function<void(operations::prepend_response)>&& handler) const
1552
+ {
1553
+ return request.execute(*this, std::move(handler));
1554
+ }
1555
+
1556
+ void
1557
+ cluster::execute(operations::replace_request_with_legacy_durability request,
1558
+ utils::movable_function<void(operations::replace_response)>&& handler) const
1559
+ {
1560
+ return request.execute(*this, std::move(handler));
1561
+ }
1562
+
1563
+ void
1564
+ cluster::execute(operations::mutate_in_request_with_legacy_durability request,
1565
+ utils::movable_function<void(operations::mutate_in_response)>&& handler) const
1566
+ {
1567
+ return request.execute(*this, std::move(handler));
1568
+ }
1569
+
1570
+ void
1571
+ cluster::execute(operations::remove_request_with_legacy_durability request,
1572
+ utils::movable_function<void(operations::remove_response)>&& handler) const
1573
+ {
1574
+ return request.execute(*this, std::move(handler));
1575
+ }
1576
+
1577
+ void
1578
+ cluster::execute(operations::increment_request_with_legacy_durability request,
1579
+ utils::movable_function<void(operations::increment_response)>&& handler) const
1580
+ {
1581
+ return request.execute(*this, std::move(handler));
1582
+ }
1583
+
1584
+ void
1585
+ cluster::execute(operations::decrement_request_with_legacy_durability request,
1586
+ utils::movable_function<void(operations::decrement_response)>&& handler) const
1587
+ {
1588
+ return request.execute(*this, std::move(handler));
1589
+ }
1590
+
1591
+ void
1592
+ cluster::execute(impl::lookup_in_replica_request request, utils::movable_function<void(impl::lookup_in_replica_response)>&& handler) const
1593
+ {
1594
+ return impl_->execute(std::move(request), std::move(handler));
1595
+ }
1596
+
1597
+ auto
1598
+ cluster::to_string() const -> std::string
1599
+ {
1600
+ return fmt::format(
1601
+ R"(#<cluster:{} impl={}>)", static_cast<const void*>(this), impl_ ? static_cast<const void*>(impl_.get()) : "(none)");
1602
+ }
220
1603
  } // namespace couchbase::core