couchbase 3.7.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/ext/CMakeLists.txt +4 -1
- data/ext/cache/extconf_include.rb +4 -3
- data/ext/cache/mozilla-ca-bundle.crt +66 -93
- data/ext/cache/mozilla-ca-bundle.sha256 +1 -1
- data/ext/couchbase/CMakeLists.txt +24 -11
- data/ext/couchbase/cmake/APKBUILD.in +17 -1
- data/ext/couchbase/cmake/Bundler.cmake +9 -1
- data/ext/couchbase/cmake/Cache.cmake +48 -19
- data/ext/couchbase/cmake/CompilerOptions.cmake +3 -1
- data/ext/couchbase/cmake/OpenSSL.cmake +10 -2
- data/ext/couchbase/cmake/Packaging.cmake +48 -8
- data/ext/couchbase/cmake/ThirdPartyDependencies.cmake +43 -1
- data/ext/couchbase/cmake/build_config.hxx.in +2 -0
- data/ext/couchbase/cmake/couchbase-cxx-client.spec.in +18 -0
- data/ext/couchbase/cmake/tarball_glob.txt +10 -0
- data/ext/couchbase/core/app_telemetry_meter.cxx +1 -0
- data/ext/couchbase/core/app_telemetry_reporter.cxx +45 -43
- data/ext/couchbase/core/app_telemetry_reporter.hxx +4 -3
- data/ext/couchbase/core/bucket.cxx +128 -13
- data/ext/couchbase/core/bucket.hxx +12 -2
- data/ext/couchbase/core/cluster.cxx +304 -152
- data/ext/couchbase/core/cluster.hxx +32 -0
- data/ext/couchbase/core/cluster_credentials.cxx +25 -0
- data/ext/couchbase/core/cluster_credentials.hxx +5 -0
- data/ext/couchbase/core/cluster_label_listener.cxx +72 -0
- data/ext/couchbase/core/cluster_label_listener.hxx +46 -0
- data/ext/couchbase/core/cluster_options.hxx +4 -0
- data/ext/couchbase/core/deprecation_utils.hxx +26 -0
- data/ext/couchbase/core/error.hxx +27 -0
- data/ext/couchbase/core/free_form_http_request.hxx +0 -2
- data/ext/couchbase/core/http_component.cxx +12 -48
- data/ext/couchbase/core/impl/analytics.cxx +3 -2
- data/ext/couchbase/core/impl/analytics.hxx +2 -1
- data/ext/couchbase/core/impl/analytics_index_manager.cxx +249 -137
- data/ext/couchbase/core/impl/binary_collection.cxx +134 -58
- data/ext/couchbase/core/impl/bucket_manager.cxx +87 -35
- data/ext/couchbase/core/impl/collection.cxx +560 -245
- data/ext/couchbase/core/impl/collection_manager.cxx +89 -49
- data/ext/couchbase/core/impl/dns_srv_tracker.cxx +4 -4
- data/ext/couchbase/core/impl/error.cxx +20 -13
- data/ext/couchbase/core/impl/error.hxx +15 -10
- data/ext/couchbase/core/impl/get_all_replicas.hxx +1 -1
- data/ext/couchbase/core/impl/get_any_replica.hxx +2 -1
- data/ext/couchbase/core/impl/get_replica.hxx +2 -0
- data/ext/couchbase/core/impl/lookup_in_replica.hxx +1 -1
- data/ext/couchbase/core/impl/observability_recorder.cxx +161 -0
- data/ext/couchbase/core/impl/observability_recorder.hxx +77 -0
- data/ext/couchbase/core/impl/observe_seqno.hxx +2 -0
- data/ext/couchbase/core/impl/public_bucket.cxx +31 -7
- data/ext/couchbase/core/impl/public_cluster.cxx +107 -19
- data/ext/couchbase/core/impl/query.cxx +6 -3
- data/ext/couchbase/core/impl/query.hxx +3 -1
- data/ext/couchbase/core/impl/query_index_manager.cxx +267 -102
- data/ext/couchbase/core/impl/scope.cxx +53 -11
- data/ext/couchbase/core/impl/search.cxx +8 -4
- data/ext/couchbase/core/impl/search.hxx +6 -2
- data/ext/couchbase/core/impl/search_index_manager.cxx +131 -41
- data/ext/couchbase/core/impl/with_cancellation.hxx +75 -0
- data/ext/couchbase/core/io/config_tracker.cxx +9 -9
- data/ext/couchbase/core/io/config_tracker.hxx +2 -1
- data/ext/couchbase/core/io/http_command.hxx +98 -49
- data/ext/couchbase/core/io/http_context.hxx +2 -0
- data/ext/couchbase/core/io/http_session.cxx +23 -10
- data/ext/couchbase/core/io/http_session.hxx +17 -9
- data/ext/couchbase/core/io/http_session_manager.hxx +163 -228
- data/ext/couchbase/core/io/http_traits.hxx +0 -7
- data/ext/couchbase/core/io/mcbp_command.hxx +123 -44
- data/ext/couchbase/core/io/mcbp_session.cxx +251 -26
- data/ext/couchbase/core/io/mcbp_session.hxx +9 -1
- data/ext/couchbase/core/io/mcbp_traits.hxx +0 -8
- data/ext/couchbase/core/io/streams.cxx +3 -3
- data/ext/couchbase/core/io/streams.hxx +3 -2
- data/ext/couchbase/core/meta/features.hxx +15 -0
- data/ext/couchbase/core/meta/version.cxx +13 -0
- data/ext/couchbase/core/meta/version.hxx +3 -0
- data/ext/couchbase/core/metrics/constants.hxx +23 -0
- data/ext/couchbase/core/metrics/logging_meter.cxx +5 -5
- data/ext/couchbase/core/metrics/meter_wrapper.cxx +65 -63
- data/ext/couchbase/core/metrics/meter_wrapper.hxx +12 -10
- data/ext/couchbase/core/operations/document_analytics.hxx +0 -5
- data/ext/couchbase/core/operations/document_append.hxx +0 -4
- data/ext/couchbase/core/operations/document_decrement.hxx +0 -5
- data/ext/couchbase/core/operations/document_exists.hxx +0 -7
- data/ext/couchbase/core/operations/document_get.hxx +0 -7
- data/ext/couchbase/core/operations/document_get_all_replicas.hxx +77 -27
- data/ext/couchbase/core/operations/document_get_and_lock.hxx +0 -9
- data/ext/couchbase/core/operations/document_get_and_touch.hxx +0 -9
- data/ext/couchbase/core/operations/document_get_any_replica.hxx +83 -2
- data/ext/couchbase/core/operations/document_get_projected.hxx +0 -9
- data/ext/couchbase/core/operations/document_increment.hxx +0 -5
- data/ext/couchbase/core/operations/document_insert.hxx +0 -4
- data/ext/couchbase/core/operations/document_lookup_in.hxx +0 -9
- data/ext/couchbase/core/operations/document_lookup_in_all_replicas.hxx +46 -4
- data/ext/couchbase/core/operations/document_lookup_in_any_replica.hxx +121 -43
- data/ext/couchbase/core/operations/document_mutate_in.hxx +0 -5
- data/ext/couchbase/core/operations/document_prepend.hxx +0 -4
- data/ext/couchbase/core/operations/document_query.hxx +0 -4
- data/ext/couchbase/core/operations/document_remove.hxx +0 -4
- data/ext/couchbase/core/operations/document_replace.hxx +0 -4
- data/ext/couchbase/core/operations/document_search.hxx +0 -7
- data/ext/couchbase/core/operations/document_touch.hxx +0 -7
- data/ext/couchbase/core/operations/document_unlock.hxx +0 -6
- data/ext/couchbase/core/operations/document_upsert.hxx +0 -4
- data/ext/couchbase/core/operations/document_view.cxx +2 -0
- data/ext/couchbase/core/operations/document_view.hxx +10 -13
- data/ext/couchbase/core/operations/http_noop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataverse_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataverse_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_connect.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_disconnect.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_replace.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_describe.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_flush.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_update.hxx +2 -0
- data/ext/couchbase/core/operations/management/change_password.hxx +2 -0
- data/ext/couchbase/core/operations/management/cluster_describe.hxx +2 -0
- data/ext/couchbase/core/operations/management/cluster_developer_preview_enable.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_update.hxx +2 -0
- data/ext/couchbase/core/operations/management/collections_manifest_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/error_utils.cxx +4 -1
- data/ext/couchbase/core/operations/management/eventing_deploy_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_drop_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_all_functions.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_status.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_pause_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_resume_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_undeploy_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_upsert_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/freeform.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_build.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_build_deferred.hxx +68 -30
- data/ext/couchbase/core/operations/management/query_index_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_get_all.hxx +4 -3
- data/ext/couchbase/core/operations/management/query_index_get_all_deferred.hxx +2 -1
- data/ext/couchbase/core/operations/management/role_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_get_stats.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_analyze_document.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_ingest.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_plan_freeze.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_query.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_documents_count.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_stats.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/operation_traits.hxx +6 -0
- data/ext/couchbase/core/operations.hxx +0 -1
- data/ext/couchbase/core/operations_fwd.hxx +8 -0
- data/ext/couchbase/core/origin.cxx +67 -12
- data/ext/couchbase/core/origin.hxx +13 -8
- data/ext/couchbase/core/orphan_reporter.cxx +164 -0
- data/ext/couchbase/core/orphan_reporter.hxx +65 -0
- data/ext/couchbase/core/sasl/CMakeLists.txt +1 -0
- data/ext/couchbase/core/sasl/client.cc +6 -0
- data/ext/couchbase/core/sasl/mechanism.cc +2 -1
- data/ext/couchbase/core/sasl/mechanism.h +2 -1
- data/ext/couchbase/core/sasl/oauthbearer/oauthbearer.cc +41 -0
- data/ext/couchbase/core/sasl/oauthbearer/oauthbearer.h +47 -0
- data/ext/couchbase/core/tls_context_provider.cxx +44 -0
- data/ext/couchbase/core/tls_context_provider.hxx +44 -0
- data/ext/couchbase/core/tracing/attribute_helpers.hxx +45 -0
- data/ext/couchbase/core/tracing/constants.hxx +148 -68
- data/ext/couchbase/core/tracing/threshold_logging_options.hxx +0 -3
- data/ext/couchbase/core/tracing/threshold_logging_tracer.cxx +122 -170
- data/ext/couchbase/core/tracing/tracer_wrapper.cxx +17 -24
- data/ext/couchbase/core/tracing/tracer_wrapper.hxx +8 -10
- data/ext/couchbase/core/tracing/wrapper_sdk_tracer.cxx +114 -0
- data/ext/couchbase/core/tracing/wrapper_sdk_tracer.hxx +85 -0
- data/ext/couchbase/core/transactions/attempt_context_impl.cxx +16 -14
- data/ext/couchbase/core/transactions/attempt_context_impl.hxx +4 -4
- data/ext/couchbase/core/transactions/transactions.cxx +1 -1
- data/ext/couchbase/core/transactions/transactions_cleanup.cxx +1 -2
- data/ext/couchbase/core/utils/byteswap.hxx +12 -0
- data/ext/couchbase/core/utils/concurrent_fixed_priority_queue.hxx +102 -0
- data/ext/couchbase/core/utils/connection_string.cxx +2 -0
- data/ext/couchbase/couchbase/certificate_authenticator.hxx +1 -0
- data/ext/couchbase/couchbase/cluster.hxx +47 -0
- data/ext/couchbase/couchbase/cluster_options.hxx +16 -0
- data/ext/couchbase/couchbase/collection.hxx +60 -15
- data/ext/couchbase/couchbase/error_codes.hxx +48 -48
- data/ext/couchbase/couchbase/jwt_authenticator.hxx +52 -0
- data/ext/couchbase/couchbase/metrics/meter.hxx +2 -1
- data/ext/couchbase/couchbase/metrics/otel_meter.hxx +75 -80
- data/ext/couchbase/couchbase/network_options.hxx +19 -0
- data/ext/couchbase/couchbase/password_authenticator.hxx +1 -0
- data/ext/couchbase/couchbase/tracing/otel_tracer.hxx +15 -17
- data/ext/couchbase/couchbase/tracing/request_span.hxx +2 -2
- data/ext/couchbase.cxx +4 -0
- data/ext/extconf.rb +1 -0
- data/ext/rcb_analytics.cxx +157 -47
- data/ext/rcb_backend.cxx +118 -71
- data/ext/rcb_buckets.cxx +39 -16
- data/ext/rcb_collections.cxx +36 -12
- data/ext/rcb_crud.cxx +587 -294
- data/ext/rcb_hdr_histogram.cxx +219 -0
- data/ext/rcb_hdr_histogram.hxx +28 -0
- data/ext/rcb_multi.cxx +142 -59
- data/ext/rcb_observability.cxx +132 -0
- data/ext/rcb_observability.hxx +49 -0
- data/ext/rcb_query.cxx +77 -27
- data/ext/rcb_search.cxx +92 -31
- data/ext/rcb_users.cxx +69 -26
- data/ext/rcb_utils.cxx +91 -0
- data/ext/rcb_utils.hxx +141 -168
- data/ext/rcb_views.cxx +36 -12
- data/lib/active_support/cache/couchbase_store.rb +6 -6
- data/lib/couchbase/authenticator.rb +14 -0
- data/lib/couchbase/binary_collection.rb +37 -22
- data/lib/couchbase/bucket.rb +46 -31
- data/lib/couchbase/cluster.rb +146 -61
- data/lib/couchbase/collection.rb +257 -186
- data/lib/couchbase/datastructures/couchbase_list.rb +81 -50
- data/lib/couchbase/datastructures/couchbase_map.rb +86 -50
- data/lib/couchbase/datastructures/couchbase_queue.rb +64 -38
- data/lib/couchbase/datastructures/couchbase_set.rb +57 -41
- data/lib/couchbase/deprecations.rb +1 -1
- data/lib/couchbase/diagnostics.rb +8 -8
- data/lib/couchbase/errors.rb +6 -0
- data/lib/couchbase/management/analytics_index_manager.rb +90 -59
- data/lib/couchbase/management/bucket_manager.rb +73 -45
- data/lib/couchbase/management/collection_manager.rb +86 -43
- data/lib/couchbase/management/collection_query_index_manager.rb +56 -33
- data/lib/couchbase/management/query_index_manager.rb +88 -36
- data/lib/couchbase/management/scope_search_index_manager.rb +119 -52
- data/lib/couchbase/management/search_index_manager.rb +401 -178
- data/lib/couchbase/management/user_manager.rb +343 -174
- data/lib/couchbase/management/view_index_manager.rb +166 -73
- data/lib/couchbase/metrics/logging_meter.rb +108 -0
- data/lib/couchbase/metrics/logging_value_recorder.rb +50 -0
- data/lib/couchbase/metrics/meter.rb +27 -0
- data/lib/couchbase/metrics/noop_meter.rb +30 -0
- data/lib/couchbase/metrics/noop_value_recorder.rb +27 -0
- data/lib/couchbase/metrics/value_recorder.rb +25 -0
- data/lib/couchbase/options.rb +69 -3
- data/lib/couchbase/protostellar/cluster.rb +3 -0
- data/lib/couchbase/scope.rb +62 -48
- data/lib/couchbase/search_options.rb +18 -18
- data/lib/couchbase/tracing/noop_span.rb +29 -0
- data/lib/couchbase/tracing/noop_tracer.rb +29 -0
- data/lib/couchbase/tracing/request_span.rb +34 -0
- data/lib/couchbase/tracing/request_tracer.rb +28 -0
- data/lib/couchbase/tracing/threshold_logging_span.rb +112 -0
- data/lib/couchbase/tracing/threshold_logging_tracer.rb +231 -0
- data/lib/couchbase/utils/hdr_histogram.rb +55 -0
- data/lib/couchbase/utils/observability.rb +257 -0
- data/lib/couchbase/utils/observability_constants.rb +200 -0
- data/lib/couchbase/utils/stdlib_logger_adapter.rb +1 -3
- data/lib/couchbase/version.rb +1 -1
- data/lib/couchbase.rb +2 -2
- metadata +58 -6
data/ext/rcb_analytics.cxx
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
#include <ruby.h>
|
|
45
45
|
|
|
46
46
|
#include "rcb_backend.hxx"
|
|
47
|
+
#include "rcb_observability.hxx"
|
|
47
48
|
#include "rcb_utils.hxx"
|
|
48
49
|
|
|
49
50
|
namespace couchbase::ruby
|
|
@@ -51,19 +52,23 @@ namespace couchbase::ruby
|
|
|
51
52
|
namespace
|
|
52
53
|
{
|
|
53
54
|
VALUE
|
|
54
|
-
cb_Backend_analytics_get_pending_mutations(VALUE self, VALUE options)
|
|
55
|
+
cb_Backend_analytics_get_pending_mutations(VALUE self, VALUE options, VALUE observability_handler)
|
|
55
56
|
{
|
|
56
57
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
57
58
|
|
|
58
59
|
try {
|
|
59
60
|
core::operations::management::analytics_get_pending_mutations_request req{};
|
|
60
61
|
cb_extract_timeout(req, options);
|
|
62
|
+
|
|
63
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
64
|
+
|
|
61
65
|
std::promise<core::operations::management::analytics_get_pending_mutations_response> promise;
|
|
62
66
|
auto f = promise.get_future();
|
|
63
67
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
64
68
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
65
69
|
});
|
|
66
70
|
auto resp = cb_wait_for_future(f);
|
|
71
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
67
72
|
if (resp.ctx.ec) {
|
|
68
73
|
if (resp.errors.empty()) {
|
|
69
74
|
cb_throw_error(resp.ctx, "unable to get pending mutations for the analytics service");
|
|
@@ -91,19 +96,23 @@ cb_Backend_analytics_get_pending_mutations(VALUE self, VALUE options)
|
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
VALUE
|
|
94
|
-
cb_Backend_analytics_dataset_get_all(VALUE self, VALUE options)
|
|
99
|
+
cb_Backend_analytics_dataset_get_all(VALUE self, VALUE options, VALUE observability_handler)
|
|
95
100
|
{
|
|
96
101
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
97
102
|
|
|
98
103
|
try {
|
|
99
104
|
core::operations::management::analytics_dataset_get_all_request req{};
|
|
100
105
|
cb_extract_timeout(req, options);
|
|
106
|
+
|
|
107
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
108
|
+
|
|
101
109
|
std::promise<core::operations::management::analytics_dataset_get_all_response> promise;
|
|
102
110
|
auto f = promise.get_future();
|
|
103
111
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
104
112
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
105
113
|
});
|
|
106
114
|
auto resp = cb_wait_for_future(f);
|
|
115
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
107
116
|
if (resp.ctx.ec) {
|
|
108
117
|
if (resp.errors.empty()) {
|
|
109
118
|
cb_throw_error(resp.ctx, "unable to fetch all datasets");
|
|
@@ -135,7 +144,10 @@ cb_Backend_analytics_dataset_get_all(VALUE self, VALUE options)
|
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
VALUE
|
|
138
|
-
cb_Backend_analytics_dataset_drop(VALUE self,
|
|
147
|
+
cb_Backend_analytics_dataset_drop(VALUE self,
|
|
148
|
+
VALUE dataset_name,
|
|
149
|
+
VALUE options,
|
|
150
|
+
VALUE observability_handler)
|
|
139
151
|
{
|
|
140
152
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
141
153
|
|
|
@@ -151,13 +163,19 @@ cb_Backend_analytics_dataset_drop(VALUE self, VALUE dataset_name, VALUE options)
|
|
|
151
163
|
req.dataverse_name = cb_string_new(dataverse_name);
|
|
152
164
|
}
|
|
153
165
|
cb_extract_option_bool(req.ignore_if_does_not_exist, options, "ignore_if_does_not_exist");
|
|
166
|
+
|
|
167
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
168
|
+
|
|
154
169
|
std::promise<core::operations::management::analytics_dataset_drop_response> promise;
|
|
155
170
|
auto f = promise.get_future();
|
|
156
171
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
157
172
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
158
173
|
});
|
|
159
174
|
|
|
160
|
-
|
|
175
|
+
auto resp = cb_wait_for_future(f);
|
|
176
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
177
|
+
|
|
178
|
+
if (resp.ctx.ec) {
|
|
161
179
|
if (resp.errors.empty()) {
|
|
162
180
|
cb_throw_error(
|
|
163
181
|
resp.ctx,
|
|
@@ -186,7 +204,8 @@ VALUE
|
|
|
186
204
|
cb_Backend_analytics_dataset_create(VALUE self,
|
|
187
205
|
VALUE dataset_name,
|
|
188
206
|
VALUE bucket_name,
|
|
189
|
-
VALUE options
|
|
207
|
+
VALUE options,
|
|
208
|
+
VALUE observability_handler)
|
|
190
209
|
{
|
|
191
210
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
192
211
|
|
|
@@ -201,13 +220,17 @@ cb_Backend_analytics_dataset_create(VALUE self,
|
|
|
201
220
|
cb_extract_option_string(req.condition, options, "condition");
|
|
202
221
|
cb_extract_option_string(req.dataverse_name, options, "dataverse_name");
|
|
203
222
|
cb_extract_option_bool(req.ignore_if_exists, options, "ignore_if_exists");
|
|
223
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
204
224
|
std::promise<core::operations::management::analytics_dataset_create_response> promise;
|
|
205
225
|
auto f = promise.get_future();
|
|
206
226
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
207
227
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
208
228
|
});
|
|
209
229
|
|
|
210
|
-
|
|
230
|
+
auto resp = cb_wait_for_future(f);
|
|
231
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
232
|
+
|
|
233
|
+
if (resp.ctx.ec) {
|
|
211
234
|
if (resp.errors.empty()) {
|
|
212
235
|
cb_throw_error(
|
|
213
236
|
resp.ctx,
|
|
@@ -233,7 +256,10 @@ cb_Backend_analytics_dataset_create(VALUE self,
|
|
|
233
256
|
}
|
|
234
257
|
|
|
235
258
|
VALUE
|
|
236
|
-
cb_Backend_analytics_dataverse_drop(VALUE self,
|
|
259
|
+
cb_Backend_analytics_dataverse_drop(VALUE self,
|
|
260
|
+
VALUE dataverse_name,
|
|
261
|
+
VALUE options,
|
|
262
|
+
VALUE observability_handler)
|
|
237
263
|
{
|
|
238
264
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
239
265
|
|
|
@@ -244,12 +270,15 @@ cb_Backend_analytics_dataverse_drop(VALUE self, VALUE dataverse_name, VALUE opti
|
|
|
244
270
|
cb_extract_timeout(req, options);
|
|
245
271
|
req.dataverse_name = cb_string_new(dataverse_name);
|
|
246
272
|
cb_extract_option_bool(req.ignore_if_does_not_exist, options, "ignore_if_does_not_exist");
|
|
273
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
247
274
|
std::promise<core::operations::management::analytics_dataverse_drop_response> promise;
|
|
248
275
|
auto f = promise.get_future();
|
|
249
276
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
250
277
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
251
278
|
});
|
|
252
|
-
|
|
279
|
+
auto resp = cb_wait_for_future(f);
|
|
280
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
281
|
+
if (resp.ctx.ec) {
|
|
253
282
|
if (resp.errors.empty()) {
|
|
254
283
|
cb_throw_error(resp.ctx, fmt::format("unable to drop dataverse `{}`", req.dataverse_name));
|
|
255
284
|
} else {
|
|
@@ -272,7 +301,10 @@ cb_Backend_analytics_dataverse_drop(VALUE self, VALUE dataverse_name, VALUE opti
|
|
|
272
301
|
}
|
|
273
302
|
|
|
274
303
|
VALUE
|
|
275
|
-
cb_Backend_analytics_dataverse_create(VALUE self,
|
|
304
|
+
cb_Backend_analytics_dataverse_create(VALUE self,
|
|
305
|
+
VALUE dataverse_name,
|
|
306
|
+
VALUE options,
|
|
307
|
+
VALUE observability_handler)
|
|
276
308
|
{
|
|
277
309
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
278
310
|
|
|
@@ -286,12 +318,15 @@ cb_Backend_analytics_dataverse_create(VALUE self, VALUE dataverse_name, VALUE op
|
|
|
286
318
|
cb_extract_timeout(req, options);
|
|
287
319
|
req.dataverse_name = cb_string_new(dataverse_name);
|
|
288
320
|
cb_extract_option_bool(req.ignore_if_exists, options, "ignore_if_exists");
|
|
321
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
289
322
|
std::promise<core::operations::management::analytics_dataverse_create_response> promise;
|
|
290
323
|
auto f = promise.get_future();
|
|
291
324
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
292
325
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
293
326
|
});
|
|
294
|
-
|
|
327
|
+
auto resp = cb_wait_for_future(f);
|
|
328
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
329
|
+
if (resp.ctx.ec) {
|
|
295
330
|
if (resp.errors.empty()) {
|
|
296
331
|
cb_throw_error(resp.ctx,
|
|
297
332
|
fmt::format("unable to create dataverse `{}`", req.dataverse_name));
|
|
@@ -315,19 +350,21 @@ cb_Backend_analytics_dataverse_create(VALUE self, VALUE dataverse_name, VALUE op
|
|
|
315
350
|
}
|
|
316
351
|
|
|
317
352
|
VALUE
|
|
318
|
-
cb_Backend_analytics_index_get_all(VALUE self, VALUE options)
|
|
353
|
+
cb_Backend_analytics_index_get_all(VALUE self, VALUE options, VALUE observability_handler)
|
|
319
354
|
{
|
|
320
355
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
321
356
|
|
|
322
357
|
try {
|
|
323
358
|
core::operations::management::analytics_index_get_all_request req{};
|
|
324
359
|
cb_extract_timeout(req, options);
|
|
360
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
325
361
|
std::promise<core::operations::management::analytics_index_get_all_response> promise;
|
|
326
362
|
auto f = promise.get_future();
|
|
327
363
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
328
364
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
329
365
|
});
|
|
330
366
|
auto resp = cb_wait_for_future(f);
|
|
367
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
331
368
|
if (resp.ctx.ec) {
|
|
332
369
|
if (resp.errors.empty()) {
|
|
333
370
|
cb_throw_error(resp.ctx, "unable to fetch all indexes");
|
|
@@ -363,7 +400,8 @@ cb_Backend_analytics_index_create(VALUE self,
|
|
|
363
400
|
VALUE index_name,
|
|
364
401
|
VALUE dataset_name,
|
|
365
402
|
VALUE fields,
|
|
366
|
-
VALUE options
|
|
403
|
+
VALUE options,
|
|
404
|
+
VALUE observability_handler)
|
|
367
405
|
{
|
|
368
406
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
369
407
|
|
|
@@ -389,12 +427,17 @@ cb_Backend_analytics_index_create(VALUE self,
|
|
|
389
427
|
|
|
390
428
|
cb_extract_option_string(req.dataverse_name, options, "dataverse_name");
|
|
391
429
|
cb_extract_option_bool(req.ignore_if_exists, options, "ignore_if_exists");
|
|
430
|
+
|
|
431
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
432
|
+
|
|
392
433
|
std::promise<core::operations::management::analytics_index_create_response> promise;
|
|
393
434
|
auto f = promise.get_future();
|
|
394
435
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
395
436
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
396
437
|
});
|
|
397
|
-
|
|
438
|
+
auto resp = cb_wait_for_future(f);
|
|
439
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
440
|
+
if (resp.ctx.ec) {
|
|
398
441
|
if (resp.errors.empty()) {
|
|
399
442
|
cb_throw_error(resp.ctx,
|
|
400
443
|
fmt::format("unable to create index `{}` on `{}`.`{}`",
|
|
@@ -423,7 +466,11 @@ cb_Backend_analytics_index_create(VALUE self,
|
|
|
423
466
|
}
|
|
424
467
|
|
|
425
468
|
VALUE
|
|
426
|
-
cb_Backend_analytics_index_drop(VALUE self,
|
|
469
|
+
cb_Backend_analytics_index_drop(VALUE self,
|
|
470
|
+
VALUE index_name,
|
|
471
|
+
VALUE dataset_name,
|
|
472
|
+
VALUE options,
|
|
473
|
+
VALUE observability_handler)
|
|
427
474
|
{
|
|
428
475
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
429
476
|
|
|
@@ -437,12 +484,15 @@ cb_Backend_analytics_index_drop(VALUE self, VALUE index_name, VALUE dataset_name
|
|
|
437
484
|
req.dataset_name = cb_string_new(dataset_name);
|
|
438
485
|
cb_extract_option_string(req.dataverse_name, options, "dataverse_name");
|
|
439
486
|
cb_extract_option_bool(req.ignore_if_does_not_exist, options, "ignore_if_does_not_exist");
|
|
487
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
440
488
|
std::promise<core::operations::management::analytics_index_drop_response> promise;
|
|
441
489
|
auto f = promise.get_future();
|
|
442
490
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
443
491
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
444
492
|
});
|
|
445
|
-
|
|
493
|
+
auto resp = cb_wait_for_future(f);
|
|
494
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
495
|
+
if (resp.ctx.ec) {
|
|
446
496
|
if (resp.errors.empty()) {
|
|
447
497
|
cb_throw_error(resp.ctx,
|
|
448
498
|
fmt::format("unable to drop index `{}`.`{}`.`{}`",
|
|
@@ -471,7 +521,7 @@ cb_Backend_analytics_index_drop(VALUE self, VALUE index_name, VALUE dataset_name
|
|
|
471
521
|
}
|
|
472
522
|
|
|
473
523
|
VALUE
|
|
474
|
-
cb_Backend_analytics_link_connect(VALUE self, VALUE options)
|
|
524
|
+
cb_Backend_analytics_link_connect(VALUE self, VALUE options, VALUE observability_handler)
|
|
475
525
|
{
|
|
476
526
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
477
527
|
|
|
@@ -481,13 +531,17 @@ cb_Backend_analytics_link_connect(VALUE self, VALUE options)
|
|
|
481
531
|
cb_extract_option_string(req.link_name, options, "link_name");
|
|
482
532
|
cb_extract_option_string(req.dataverse_name, options, "dataverse_name");
|
|
483
533
|
cb_extract_option_bool(req.force, options, "force");
|
|
534
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
484
535
|
std::promise<core::operations::management::analytics_link_connect_response> promise;
|
|
485
536
|
auto f = promise.get_future();
|
|
486
537
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
487
538
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
488
539
|
});
|
|
489
540
|
|
|
490
|
-
|
|
541
|
+
auto resp = cb_wait_for_future(f);
|
|
542
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
543
|
+
|
|
544
|
+
if (resp.ctx.ec) {
|
|
491
545
|
if (resp.errors.empty()) {
|
|
492
546
|
cb_throw_error(
|
|
493
547
|
resp.ctx,
|
|
@@ -513,7 +567,7 @@ cb_Backend_analytics_link_connect(VALUE self, VALUE options)
|
|
|
513
567
|
}
|
|
514
568
|
|
|
515
569
|
VALUE
|
|
516
|
-
cb_Backend_analytics_link_disconnect(VALUE self, VALUE options)
|
|
570
|
+
cb_Backend_analytics_link_disconnect(VALUE self, VALUE options, VALUE observability_handler)
|
|
517
571
|
{
|
|
518
572
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
519
573
|
|
|
@@ -522,12 +576,17 @@ cb_Backend_analytics_link_disconnect(VALUE self, VALUE options)
|
|
|
522
576
|
cb_extract_timeout(req, options);
|
|
523
577
|
cb_extract_option_string(req.link_name, options, "link_name");
|
|
524
578
|
cb_extract_option_string(req.dataverse_name, options, "dataverse_name");
|
|
579
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
525
580
|
std::promise<core::operations::management::analytics_link_disconnect_response> promise;
|
|
526
581
|
auto f = promise.get_future();
|
|
527
582
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
528
583
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
529
584
|
});
|
|
530
|
-
|
|
585
|
+
|
|
586
|
+
auto resp = cb_wait_for_future(f);
|
|
587
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
588
|
+
|
|
589
|
+
if (resp.ctx.ec) {
|
|
531
590
|
if (resp.errors.empty()) {
|
|
532
591
|
cb_throw_error(
|
|
533
592
|
resp.ctx,
|
|
@@ -603,7 +662,7 @@ cb_fill_link(core::management::analytics::s3_external_link& dst, VALUE src)
|
|
|
603
662
|
}
|
|
604
663
|
|
|
605
664
|
VALUE
|
|
606
|
-
cb_Backend_analytics_link_create(VALUE self, VALUE link, VALUE options)
|
|
665
|
+
cb_Backend_analytics_link_create(VALUE self, VALUE link, VALUE options, VALUE observability_handler)
|
|
607
666
|
{
|
|
608
667
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
609
668
|
|
|
@@ -621,13 +680,18 @@ cb_Backend_analytics_link_create(VALUE self, VALUE link, VALUE options)
|
|
|
621
680
|
cb_extract_timeout(req, options);
|
|
622
681
|
cb_fill_link(req.link, link);
|
|
623
682
|
|
|
683
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
684
|
+
|
|
624
685
|
std::promise<core::operations::management::analytics_link_create_response> promise;
|
|
625
686
|
auto f = promise.get_future();
|
|
626
687
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
627
688
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
628
689
|
});
|
|
629
690
|
|
|
630
|
-
|
|
691
|
+
auto resp = cb_wait_for_future(f);
|
|
692
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
693
|
+
|
|
694
|
+
if (resp.ctx.ec) {
|
|
631
695
|
if (resp.errors.empty()) {
|
|
632
696
|
cb_throw_error(resp.ctx,
|
|
633
697
|
fmt::format("unable to create couchbase_remote link `{}` on `{}`",
|
|
@@ -651,13 +715,18 @@ cb_Backend_analytics_link_create(VALUE self, VALUE link, VALUE options)
|
|
|
651
715
|
cb_extract_timeout(req, options);
|
|
652
716
|
cb_fill_link(req.link, link);
|
|
653
717
|
|
|
718
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
719
|
+
|
|
654
720
|
std::promise<core::operations::management::analytics_link_create_response> promise;
|
|
655
721
|
auto f = promise.get_future();
|
|
656
722
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
657
723
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
658
724
|
});
|
|
659
725
|
|
|
660
|
-
|
|
726
|
+
auto resp = cb_wait_for_future(f);
|
|
727
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
728
|
+
|
|
729
|
+
if (resp.ctx.ec) {
|
|
661
730
|
if (resp.errors.empty()) {
|
|
662
731
|
cb_throw_error(resp.ctx,
|
|
663
732
|
fmt::format("unable to create azure_blob_external link `{}` on `{}`",
|
|
@@ -682,13 +751,18 @@ cb_Backend_analytics_link_create(VALUE self, VALUE link, VALUE options)
|
|
|
682
751
|
cb_extract_timeout(req, options);
|
|
683
752
|
cb_fill_link(req.link, link);
|
|
684
753
|
|
|
754
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
755
|
+
|
|
685
756
|
std::promise<core::operations::management::analytics_link_create_response> promise;
|
|
686
757
|
auto f = promise.get_future();
|
|
687
758
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
688
759
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
689
760
|
});
|
|
690
761
|
|
|
691
|
-
|
|
762
|
+
auto resp = cb_wait_for_future(f);
|
|
763
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
764
|
+
|
|
765
|
+
if (resp.ctx.ec) {
|
|
692
766
|
if (resp.errors.empty()) {
|
|
693
767
|
cb_throw_error(resp.ctx,
|
|
694
768
|
fmt::format("unable to create s3_external link `{}` on `{}`",
|
|
@@ -717,7 +791,10 @@ cb_Backend_analytics_link_create(VALUE self, VALUE link, VALUE options)
|
|
|
717
791
|
}
|
|
718
792
|
|
|
719
793
|
VALUE
|
|
720
|
-
cb_Backend_analytics_link_replace(VALUE self,
|
|
794
|
+
cb_Backend_analytics_link_replace(VALUE self,
|
|
795
|
+
VALUE link,
|
|
796
|
+
VALUE options,
|
|
797
|
+
VALUE observability_handler)
|
|
721
798
|
{
|
|
722
799
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
723
800
|
|
|
@@ -736,13 +813,18 @@ cb_Backend_analytics_link_replace(VALUE self, VALUE link, VALUE options)
|
|
|
736
813
|
cb_extract_timeout(req, options);
|
|
737
814
|
cb_fill_link(req.link, link);
|
|
738
815
|
|
|
816
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
817
|
+
|
|
739
818
|
std::promise<core::operations::management::analytics_link_replace_response> promise;
|
|
740
819
|
auto f = promise.get_future();
|
|
741
820
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
742
821
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
743
822
|
});
|
|
744
823
|
|
|
745
|
-
|
|
824
|
+
auto resp = cb_wait_for_future(f);
|
|
825
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
826
|
+
|
|
827
|
+
if (resp.ctx.ec) {
|
|
746
828
|
if (resp.errors.empty()) {
|
|
747
829
|
cb_throw_error(resp.ctx,
|
|
748
830
|
fmt::format("unable to replace couchbase_remote link `{}` on `{}`",
|
|
@@ -767,13 +849,18 @@ cb_Backend_analytics_link_replace(VALUE self, VALUE link, VALUE options)
|
|
|
767
849
|
cb_extract_timeout(req, options);
|
|
768
850
|
cb_fill_link(req.link, link);
|
|
769
851
|
|
|
852
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
853
|
+
|
|
770
854
|
std::promise<core::operations::management::analytics_link_replace_response> promise;
|
|
771
855
|
auto f = promise.get_future();
|
|
772
856
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
773
857
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
774
858
|
});
|
|
775
859
|
|
|
776
|
-
|
|
860
|
+
auto resp = cb_wait_for_future(f);
|
|
861
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
862
|
+
|
|
863
|
+
if (resp.ctx.ec) {
|
|
777
864
|
if (resp.errors.empty()) {
|
|
778
865
|
cb_throw_error(resp.ctx,
|
|
779
866
|
fmt::format("unable to replace azure_blob_external link `{}` on `{}`",
|
|
@@ -798,13 +885,18 @@ cb_Backend_analytics_link_replace(VALUE self, VALUE link, VALUE options)
|
|
|
798
885
|
cb_extract_timeout(req, options);
|
|
799
886
|
cb_fill_link(req.link, link);
|
|
800
887
|
|
|
888
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
889
|
+
|
|
801
890
|
std::promise<core::operations::management::analytics_link_replace_response> promise;
|
|
802
891
|
auto f = promise.get_future();
|
|
803
892
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
804
893
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
805
894
|
});
|
|
806
895
|
|
|
807
|
-
|
|
896
|
+
auto resp = cb_wait_for_future(f);
|
|
897
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
898
|
+
|
|
899
|
+
if (resp.ctx.ec) {
|
|
808
900
|
if (resp.errors.empty()) {
|
|
809
901
|
cb_throw_error(resp.ctx,
|
|
810
902
|
fmt::format("unable to replace s3_external link `{}` on `{}`",
|
|
@@ -833,7 +925,11 @@ cb_Backend_analytics_link_replace(VALUE self, VALUE link, VALUE options)
|
|
|
833
925
|
}
|
|
834
926
|
|
|
835
927
|
VALUE
|
|
836
|
-
cb_Backend_analytics_link_drop(VALUE self,
|
|
928
|
+
cb_Backend_analytics_link_drop(VALUE self,
|
|
929
|
+
VALUE link,
|
|
930
|
+
VALUE dataverse,
|
|
931
|
+
VALUE options,
|
|
932
|
+
VALUE observability_handler)
|
|
837
933
|
{
|
|
838
934
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
839
935
|
|
|
@@ -850,13 +946,18 @@ cb_Backend_analytics_link_drop(VALUE self, VALUE link, VALUE dataverse, VALUE op
|
|
|
850
946
|
req.link_name = cb_string_new(link);
|
|
851
947
|
req.dataverse_name = cb_string_new(dataverse);
|
|
852
948
|
|
|
949
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
950
|
+
|
|
853
951
|
std::promise<core::operations::management::analytics_link_drop_response> promise;
|
|
854
952
|
auto f = promise.get_future();
|
|
855
953
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
856
954
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
857
955
|
});
|
|
858
956
|
|
|
859
|
-
|
|
957
|
+
auto resp = cb_wait_for_future(f);
|
|
958
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
959
|
+
|
|
960
|
+
if (resp.ctx.ec) {
|
|
860
961
|
if (resp.errors.empty()) {
|
|
861
962
|
cb_throw_error(
|
|
862
963
|
resp.ctx,
|
|
@@ -883,7 +984,7 @@ cb_Backend_analytics_link_drop(VALUE self, VALUE link, VALUE dataverse, VALUE op
|
|
|
883
984
|
}
|
|
884
985
|
|
|
885
986
|
VALUE
|
|
886
|
-
cb_Backend_analytics_link_get_all(VALUE self, VALUE options)
|
|
987
|
+
cb_Backend_analytics_link_get_all(VALUE self, VALUE options, VALUE observability_handler)
|
|
887
988
|
{
|
|
888
989
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
889
990
|
|
|
@@ -899,12 +1000,15 @@ cb_Backend_analytics_link_get_all(VALUE self, VALUE options)
|
|
|
899
1000
|
cb_extract_option_string(req.link_name, options, "link_name");
|
|
900
1001
|
cb_extract_option_string(req.dataverse_name, options, "dataverse");
|
|
901
1002
|
|
|
1003
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
1004
|
+
|
|
902
1005
|
std::promise<core::operations::management::analytics_link_get_all_response> promise;
|
|
903
1006
|
auto f = promise.get_future();
|
|
904
1007
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
905
1008
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
906
1009
|
});
|
|
907
1010
|
auto resp = cb_wait_for_future(f);
|
|
1011
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
908
1012
|
|
|
909
1013
|
if (resp.ctx.ec) {
|
|
910
1014
|
if (resp.errors.empty()) {
|
|
@@ -1029,7 +1133,10 @@ cb_for_each_named_param_analytics(VALUE key, VALUE value, VALUE arg)
|
|
|
1029
1133
|
}
|
|
1030
1134
|
|
|
1031
1135
|
VALUE
|
|
1032
|
-
cb_Backend_document_analytics(VALUE self,
|
|
1136
|
+
cb_Backend_document_analytics(VALUE self,
|
|
1137
|
+
VALUE statement,
|
|
1138
|
+
VALUE options,
|
|
1139
|
+
VALUE observability_handler)
|
|
1033
1140
|
{
|
|
1034
1141
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
1035
1142
|
|
|
@@ -1103,12 +1210,15 @@ cb_Backend_document_analytics(VALUE self, VALUE statement, VALUE options)
|
|
|
1103
1210
|
rb_hash_foreach(raw_params, cb_for_each_named_param_analytics, reinterpret_cast<VALUE>(&req));
|
|
1104
1211
|
}
|
|
1105
1212
|
|
|
1213
|
+
auto parent_span = cb_create_parent_span(req, self);
|
|
1214
|
+
|
|
1106
1215
|
std::promise<core::operations::analytics_response> promise;
|
|
1107
1216
|
auto f = promise.get_future();
|
|
1108
1217
|
cluster.execute(req, [promise = std::move(promise)](auto&& resp) mutable {
|
|
1109
1218
|
promise.set_value(std::forward<decltype(resp)>(resp));
|
|
1110
1219
|
});
|
|
1111
1220
|
auto resp = cb_wait_for_future(f);
|
|
1221
|
+
cb_add_core_spans(observability_handler, std::move(parent_span), resp.ctx.retry_attempts);
|
|
1112
1222
|
if (resp.ctx.ec) {
|
|
1113
1223
|
if (!resp.meta.errors.empty()) {
|
|
1114
1224
|
const auto& first_error = resp.meta.errors.front();
|
|
@@ -1171,25 +1281,25 @@ cb_Backend_document_analytics(VALUE self, VALUE statement, VALUE options)
|
|
|
1171
1281
|
void
|
|
1172
1282
|
init_analytics(VALUE cBackend)
|
|
1173
1283
|
{
|
|
1174
|
-
rb_define_method(cBackend, "document_analytics", cb_Backend_document_analytics,
|
|
1284
|
+
rb_define_method(cBackend, "document_analytics", cb_Backend_document_analytics, 3);
|
|
1175
1285
|
|
|
1176
1286
|
// Management APIs
|
|
1177
1287
|
rb_define_method(
|
|
1178
|
-
cBackend, "analytics_get_pending_mutations", cb_Backend_analytics_get_pending_mutations,
|
|
1179
|
-
rb_define_method(cBackend, "analytics_dataverse_drop", cb_Backend_analytics_dataverse_drop,
|
|
1288
|
+
cBackend, "analytics_get_pending_mutations", cb_Backend_analytics_get_pending_mutations, 2);
|
|
1289
|
+
rb_define_method(cBackend, "analytics_dataverse_drop", cb_Backend_analytics_dataverse_drop, 3);
|
|
1180
1290
|
rb_define_method(
|
|
1181
|
-
cBackend, "analytics_dataverse_create", cb_Backend_analytics_dataverse_create,
|
|
1182
|
-
rb_define_method(cBackend, "analytics_dataset_create", cb_Backend_analytics_dataset_create,
|
|
1183
|
-
rb_define_method(cBackend, "analytics_dataset_drop", cb_Backend_analytics_dataset_drop,
|
|
1184
|
-
rb_define_method(cBackend, "analytics_dataset_get_all", cb_Backend_analytics_dataset_get_all,
|
|
1185
|
-
rb_define_method(cBackend, "analytics_index_get_all", cb_Backend_analytics_index_get_all,
|
|
1186
|
-
rb_define_method(cBackend, "analytics_index_create", cb_Backend_analytics_index_create,
|
|
1187
|
-
rb_define_method(cBackend, "analytics_index_drop", cb_Backend_analytics_index_drop,
|
|
1188
|
-
rb_define_method(cBackend, "analytics_link_connect", cb_Backend_analytics_link_connect,
|
|
1189
|
-
rb_define_method(cBackend, "analytics_link_disconnect", cb_Backend_analytics_link_disconnect,
|
|
1190
|
-
rb_define_method(cBackend, "analytics_link_create", cb_Backend_analytics_link_create,
|
|
1191
|
-
rb_define_method(cBackend, "analytics_link_replace", cb_Backend_analytics_link_replace,
|
|
1192
|
-
rb_define_method(cBackend, "analytics_link_drop", cb_Backend_analytics_link_drop,
|
|
1193
|
-
rb_define_method(cBackend, "analytics_link_get_all", cb_Backend_analytics_link_get_all,
|
|
1291
|
+
cBackend, "analytics_dataverse_create", cb_Backend_analytics_dataverse_create, 3);
|
|
1292
|
+
rb_define_method(cBackend, "analytics_dataset_create", cb_Backend_analytics_dataset_create, 4);
|
|
1293
|
+
rb_define_method(cBackend, "analytics_dataset_drop", cb_Backend_analytics_dataset_drop, 3);
|
|
1294
|
+
rb_define_method(cBackend, "analytics_dataset_get_all", cb_Backend_analytics_dataset_get_all, 2);
|
|
1295
|
+
rb_define_method(cBackend, "analytics_index_get_all", cb_Backend_analytics_index_get_all, 2);
|
|
1296
|
+
rb_define_method(cBackend, "analytics_index_create", cb_Backend_analytics_index_create, 5);
|
|
1297
|
+
rb_define_method(cBackend, "analytics_index_drop", cb_Backend_analytics_index_drop, 4);
|
|
1298
|
+
rb_define_method(cBackend, "analytics_link_connect", cb_Backend_analytics_link_connect, 2);
|
|
1299
|
+
rb_define_method(cBackend, "analytics_link_disconnect", cb_Backend_analytics_link_disconnect, 2);
|
|
1300
|
+
rb_define_method(cBackend, "analytics_link_create", cb_Backend_analytics_link_create, 3);
|
|
1301
|
+
rb_define_method(cBackend, "analytics_link_replace", cb_Backend_analytics_link_replace, 3);
|
|
1302
|
+
rb_define_method(cBackend, "analytics_link_drop", cb_Backend_analytics_link_drop, 4);
|
|
1303
|
+
rb_define_method(cBackend, "analytics_link_get_all", cb_Backend_analytics_link_get_all, 2);
|
|
1194
1304
|
}
|
|
1195
1305
|
} // namespace couchbase::ruby
|