couchbase 3.8.1 → 3.9.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 +2 -2
- data/ext/CMakeLists.txt +16 -1
- data/ext/cache/cpm/{CPM_0.42.0.cmake → CPM_0.43.1.cmake} +18 -2
- data/ext/cache/extconf_include.rb +6 -6
- data/ext/cache/mozilla-ca-bundle.crt +214 -155
- data/ext/cache/mozilla-ca-bundle.sha256 +1 -1
- data/ext/couchbase/CMakeLists.txt +130 -21
- data/ext/couchbase/cmake/APKBUILD.in +25 -4
- data/ext/couchbase/cmake/Bundler.cmake +143 -34
- data/ext/couchbase/cmake/CPM.cmake +126 -12
- data/ext/couchbase/cmake/Cache.cmake +7 -1
- data/ext/couchbase/cmake/CompilerOptions.cmake +1 -1
- data/ext/couchbase/cmake/CompilerWarnings.cmake +17 -6
- data/ext/couchbase/cmake/GrpcProtobuf.cmake +481 -0
- data/ext/couchbase/cmake/OpenSSL.cmake +10 -3
- data/ext/couchbase/cmake/Packaging.cmake +519 -65
- data/ext/couchbase/cmake/Protostellar.cmake +250 -0
- data/ext/couchbase/cmake/Sanitizers.cmake +61 -50
- data/ext/couchbase/cmake/StaticAnalyzers.cmake +16 -5
- data/ext/couchbase/cmake/TestFramework.cmake +283 -0
- data/ext/couchbase/cmake/TestFrameworkAddTests.cmake +51 -0
- data/ext/couchbase/cmake/Testing.cmake +27 -9
- data/ext/couchbase/cmake/ThirdPartyDependencies.cmake +141 -8
- data/ext/couchbase/cmake/VersionInfo.cmake +50 -0
- data/ext/couchbase/cmake/build_config.hxx.in +2 -1
- data/ext/couchbase/cmake/couchbase-cxx-client.spec.in +101 -23
- data/ext/couchbase/cmake/couchbase_cxx_client_static-config.cmake.in +7 -0
- data/ext/couchbase/cmake/couchbase_cxx_client_static.pc.in +2 -0
- data/ext/couchbase/cmake/gRPC_Generate.cmake +58 -0
- data/ext/couchbase/cmake/protobuf_Generate.cmake +69 -0
- data/ext/couchbase/cmake/require-git-checkout.cmake +25 -0
- data/ext/couchbase/cmake/tarball_glob.txt +49 -0
- data/ext/couchbase/core/agent_group.cxx +0 -8
- data/ext/couchbase/core/agent_group.hxx +0 -4
- data/ext/couchbase/core/analytics_stream.cxx +314 -0
- data/ext/couchbase/core/analytics_stream.hxx +129 -0
- data/ext/couchbase/core/analytics_stream_component.cxx +245 -0
- data/ext/couchbase/core/analytics_stream_component.hxx +67 -0
- data/ext/couchbase/core/app_telemetry_meter.cxx +25 -3
- data/ext/couchbase/core/app_telemetry_meter.hxx +77 -0
- data/ext/couchbase/core/app_telemetry_reporter.cxx +7 -6
- data/ext/couchbase/core/bucket.cxx +381 -87
- data/ext/couchbase/core/bucket.hxx +105 -25
- data/ext/couchbase/core/bucket_unit_test_api.hxx +57 -0
- data/ext/couchbase/core/capella.hxx +91 -0
- data/ext/couchbase/core/cluster.cxx +1554 -398
- data/ext/couchbase/core/cluster.hxx +39 -8
- data/ext/couchbase/core/cluster_agent.cxx +0 -8
- data/ext/couchbase/core/cluster_agent.hxx +0 -4
- data/ext/couchbase/core/cluster_options.hxx +26 -3
- data/ext/couchbase/core/collections_component.cxx +39 -15
- data/ext/couchbase/core/config_profiles.cxx +1 -1
- data/ext/couchbase/core/crud_component.cxx +2 -2
- data/ext/couchbase/core/crud_options.hxx +34 -0
- data/ext/couchbase/core/crypto/cbcrypto.cc +18 -13
- data/ext/couchbase/core/document_id_redaction.hxx +81 -0
- data/ext/couchbase/core/error_context/base_error_context.hxx +7 -6
- data/ext/couchbase/core/error_context/key_value.cxx +25 -2
- data/ext/couchbase/core/error_context/key_value.hxx +60 -33
- data/ext/couchbase/core/error_context/key_value_error_context.hxx +16 -15
- data/ext/couchbase/core/error_context/search.hxx +5 -0
- data/ext/couchbase/core/error_context/search_json.hxx +3 -0
- data/ext/couchbase/core/error_context/subdocument_error_context.hxx +19 -18
- data/ext/couchbase/core/error_context/view.hxx +5 -0
- data/ext/couchbase/core/free_form_http_request.cxx +237 -4
- data/ext/couchbase/core/free_form_http_request.hxx +41 -8
- data/ext/couchbase/core/http_component.cxx +300 -284
- data/ext/couchbase/core/http_component.hxx +0 -4
- data/ext/couchbase/core/impl/analytics.cxx +38 -5
- data/ext/couchbase/core/impl/analytics.hxx +34 -0
- data/ext/couchbase/core/impl/bootstrap_error.hxx +0 -3
- data/ext/couchbase/core/impl/collection.cxx +215 -202
- data/ext/couchbase/core/impl/collection_manager.cxx +1 -1
- data/ext/couchbase/core/impl/dns_srv_tracker.cxx +45 -18
- data/ext/couchbase/core/impl/error.cxx +22 -2
- data/ext/couchbase/core/impl/internal_analytics_stream_result.hxx +111 -0
- data/ext/couchbase/core/impl/internal_query_stream_result.hxx +110 -0
- data/ext/couchbase/core/impl/invoke_with_node_id.hxx +15 -7
- data/ext/couchbase/core/impl/key_value_error_category.cxx +6 -0
- data/ext/couchbase/core/impl/lookup_in_replica.cxx +10 -10
- data/ext/couchbase/core/impl/lookup_in_replica.hxx +4 -4
- data/ext/couchbase/core/impl/node_id.cxx +49 -13
- data/ext/couchbase/core/impl/observability_recorder.cxx +12 -2
- data/ext/couchbase/core/impl/observe_poll.cxx +63 -23
- data/ext/couchbase/core/impl/public_analytics_stream_result.cxx +372 -0
- data/ext/couchbase/core/impl/public_bucket.cxx +48 -2
- data/ext/couchbase/core/impl/public_cluster.cxx +325 -25
- data/ext/couchbase/core/impl/public_query_stream_result.cxx +380 -0
- data/ext/couchbase/core/impl/public_transaction_get_multi_replicas_from_preferred_server_group_result.cxx +42 -0
- data/ext/couchbase/core/impl/public_transaction_get_multi_result.cxx +42 -0
- data/ext/couchbase/core/impl/query.cxx +76 -7
- data/ext/couchbase/core/impl/query.hxx +36 -0
- data/ext/couchbase/core/impl/query_index_manager.cxx +54 -1
- data/ext/couchbase/core/impl/replica_utils.cxx +101 -0
- data/ext/couchbase/core/impl/replica_utils.hxx +64 -0
- data/ext/couchbase/core/impl/resolve_node_id.hxx +125 -0
- data/ext/couchbase/core/impl/scope.cxx +70 -0
- data/ext/couchbase/core/impl/search.cxx +31 -1
- data/ext/couchbase/core/impl/transactions.cxx +130 -0
- data/ext/couchbase/core/impl/wait_until_ready.cxx +439 -0
- data/ext/couchbase/core/impl/wait_until_ready.hxx +110 -0
- data/ext/couchbase/core/impl/with_bucket_config_or_timeout.hxx +180 -0
- data/ext/couchbase/core/impl/with_cancellation.hxx +11 -3
- data/ext/couchbase/core/io/configuration_belongs_to_session.hxx +66 -0
- data/ext/couchbase/core/io/dns_client.cxx +122 -45
- data/ext/couchbase/core/io/dns_codec.hxx +21 -21
- data/ext/couchbase/core/io/dns_config.cxx +21 -6
- data/ext/couchbase/core/io/http_command.hxx +149 -121
- data/ext/couchbase/core/io/http_error.hxx +107 -0
- data/ext/couchbase/core/io/http_parser.cxx +4 -0
- data/ext/couchbase/core/io/http_session.cxx +606 -154
- data/ext/couchbase/core/io/http_session.hxx +147 -30
- data/ext/couchbase/core/io/http_session_manager.hxx +329 -382
- data/ext/couchbase/core/io/http_streaming_parser.cxx +4 -0
- data/ext/couchbase/core/io/http_streaming_response.cxx +328 -43
- data/ext/couchbase/core/io/http_streaming_response.hxx +37 -3
- data/ext/couchbase/core/io/mcbp_buffer_pool.hxx +122 -0
- data/ext/couchbase/core/io/mcbp_command.hxx +150 -51
- data/ext/couchbase/core/io/mcbp_command_id.hxx +45 -0
- data/ext/couchbase/core/io/mcbp_message.cxx +9 -1
- data/ext/couchbase/core/io/mcbp_message.hxx +19 -0
- data/ext/couchbase/core/io/mcbp_output_queue.hxx +150 -0
- data/ext/couchbase/core/io/mcbp_parser.cxx +24 -7
- data/ext/couchbase/core/io/mcbp_session.cxx +316 -317
- data/ext/couchbase/core/io/mcbp_session.hxx +27 -18
- data/ext/couchbase/core/io/opaque_ring_table.hxx +145 -0
- data/ext/couchbase/core/io/retry_orchestrator.hxx +6 -5
- data/ext/couchbase/core/io/stream_deadline.hxx +50 -0
- data/ext/couchbase/core/io/streams.cxx +275 -14
- data/ext/couchbase/core/io/streams.hxx +53 -0
- data/ext/couchbase/core/logger/logger.cxx +36 -0
- data/ext/couchbase/core/logger/logger.hxx +46 -6
- data/ext/couchbase/core/logger/redaction.hxx +503 -0
- data/ext/couchbase/core/management/eventing_status.hxx +10 -0
- data/ext/couchbase/core/management/eventing_status_json.hxx +4 -0
- data/ext/couchbase/core/mcbp/big_endian.cxx +1 -1
- data/ext/couchbase/core/mcbp/codec.cxx +27 -18
- data/ext/couchbase/core/mcbp/operation_queue.cxx +2 -2
- data/ext/couchbase/core/mcbp/packet.hxx +2 -2
- data/ext/couchbase/core/mcbp/queue_request.cxx +23 -6
- data/ext/couchbase/core/mcbp/queue_request.hxx +21 -0
- data/ext/couchbase/core/meta/features.hxx +13 -0
- data/ext/couchbase/core/meta/version.cxx +6 -3
- data/ext/couchbase/core/metrics/logging_meter.cxx +5 -10
- data/ext/couchbase/core/metrics/meter_wrapper.cxx +63 -33
- data/ext/couchbase/core/metrics/meter_wrapper.hxx +55 -3
- data/ext/couchbase/core/operations/analytics_response_parsing.cxx +177 -0
- data/ext/couchbase/core/operations/analytics_response_parsing.hxx +55 -0
- data/ext/couchbase/core/operations/document_analytics.cxx +48 -130
- data/ext/couchbase/core/operations/document_analytics.hxx +14 -2
- data/ext/couchbase/core/operations/document_get_all_replicas.hxx +15 -7
- data/ext/couchbase/core/operations/document_get_any_replica.hxx +19 -8
- data/ext/couchbase/core/operations/document_get_projected.cxx +1 -1
- data/ext/couchbase/core/{impl/get_replica.cxx → operations/document_get_replica.cxx} +21 -3
- data/ext/couchbase/core/{impl/get_replica.hxx → operations/document_get_replica.hxx} +31 -4
- data/ext/couchbase/core/operations/document_lookup_in.cxx +10 -10
- data/ext/couchbase/core/operations/document_lookup_in_all_replicas.hxx +228 -198
- data/ext/couchbase/core/operations/document_lookup_in_any_replica.hxx +215 -217
- data/ext/couchbase/core/operations/document_query.cxx +108 -221
- data/ext/couchbase/core/operations/document_query.hxx +18 -4
- data/ext/couchbase/core/operations/document_search.cxx +52 -8
- data/ext/couchbase/core/operations/document_search.hxx +3 -0
- data/ext/couchbase/core/operations/document_view.cxx +3 -3
- data/ext/couchbase/core/operations/management/analytics_dataset_create.cxx +15 -8
- data/ext/couchbase/core/operations/management/analytics_dataset_create.hxx +4 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_drop.cxx +11 -6
- data/ext/couchbase/core/operations/management/analytics_dataset_get_all.cxx +3 -2
- data/ext/couchbase/core/operations/management/analytics_dataverse_create.cxx +10 -5
- data/ext/couchbase/core/operations/management/analytics_dataverse_drop.cxx +10 -5
- data/ext/couchbase/core/operations/management/analytics_get_pending_mutations.cxx +2 -1
- data/ext/couchbase/core/operations/management/analytics_index_create.cxx +33 -8
- data/ext/couchbase/core/operations/management/analytics_index_drop.cxx +12 -7
- data/ext/couchbase/core/operations/management/analytics_index_get_all.cxx +3 -2
- data/ext/couchbase/core/operations/management/analytics_link_connect.cxx +11 -6
- data/ext/couchbase/core/operations/management/analytics_link_create.cxx +3 -3
- data/ext/couchbase/core/operations/management/analytics_link_disconnect.cxx +10 -4
- data/ext/couchbase/core/operations/management/analytics_link_drop.cxx +6 -4
- data/ext/couchbase/core/operations/management/analytics_link_get_all.cxx +4 -3
- data/ext/couchbase/core/operations/management/analytics_link_replace.cxx +3 -3
- data/ext/couchbase/core/operations/management/analytics_link_utils.hxx +1 -1
- data/ext/couchbase/core/operations/management/bucket_create.cxx +37 -38
- data/ext/couchbase/core/operations/management/bucket_update.cxx +26 -28
- data/ext/couchbase/core/operations/management/change_password.cxx +2 -0
- data/ext/couchbase/core/operations/management/collection_drop.cxx +5 -1
- data/ext/couchbase/core/operations/management/error_utils.cxx +59 -5
- data/ext/couchbase/core/operations/management/error_utils.hxx +29 -1
- data/ext/couchbase/core/operations/management/eventing_deploy_function.cxx +9 -3
- data/ext/couchbase/core/operations/management/eventing_drop_function.cxx +8 -3
- data/ext/couchbase/core/operations/management/eventing_get_all_functions.cxx +4 -2
- data/ext/couchbase/core/operations/management/eventing_get_function.cxx +5 -3
- data/ext/couchbase/core/operations/management/eventing_get_status.cxx +4 -2
- data/ext/couchbase/core/operations/management/eventing_pause_function.cxx +9 -3
- data/ext/couchbase/core/operations/management/eventing_resume_function.cxx +9 -3
- data/ext/couchbase/core/operations/management/eventing_undeploy_function.cxx +9 -3
- data/ext/couchbase/core/operations/management/eventing_upsert_function.cxx +9 -3
- data/ext/couchbase/core/operations/management/group_drop.cxx +3 -1
- data/ext/couchbase/core/operations/management/group_get.cxx +3 -1
- data/ext/couchbase/core/operations/management/group_upsert.cxx +11 -8
- data/ext/couchbase/core/operations/management/query_index_build.cxx +5 -2
- data/ext/couchbase/core/operations/management/query_index_create.cxx +9 -3
- data/ext/couchbase/core/operations/management/query_index_drop.cxx +11 -4
- data/ext/couchbase/core/operations/management/query_index_get_all.cxx +1 -1
- data/ext/couchbase/core/operations/management/query_index_get_all_deferred.cxx +1 -1
- data/ext/couchbase/core/operations/management/scope_drop.cxx +5 -1
- data/ext/couchbase/core/operations/management/scope_get_all.cxx +6 -1
- data/ext/couchbase/core/operations/management/search_get_stats.cxx +10 -0
- data/ext/couchbase/core/operations/management/search_index_analyze_document.cxx +3 -2
- data/ext/couchbase/core/operations/management/search_index_control_ingest.cxx +4 -3
- data/ext/couchbase/core/operations/management/search_index_control_plan_freeze.cxx +4 -3
- data/ext/couchbase/core/operations/management/search_index_control_query.cxx +4 -3
- data/ext/couchbase/core/operations/management/search_index_drop.cxx +2 -2
- data/ext/couchbase/core/operations/management/search_index_get.cxx +2 -2
- data/ext/couchbase/core/operations/management/search_index_get_documents_count.cxx +3 -2
- data/ext/couchbase/core/operations/management/search_index_get_stats.cxx +3 -1
- data/ext/couchbase/core/operations/management/search_index_upsert.cxx +2 -2
- data/ext/couchbase/core/operations/management/user_drop.cxx +3 -1
- data/ext/couchbase/core/operations/management/user_get.cxx +3 -1
- data/ext/couchbase/core/operations/management/user_upsert.cxx +12 -9
- data/ext/couchbase/core/operations/management/view_index_drop.cxx +1 -1
- data/ext/couchbase/core/operations/management/view_index_get.cxx +1 -1
- data/ext/couchbase/core/operations/management/view_index_upsert.cxx +1 -1
- data/ext/couchbase/core/operations/operation_traits.hxx +18 -0
- data/ext/couchbase/core/operations/query_response_parsing.cxx +211 -0
- data/ext/couchbase/core/operations/query_response_parsing.hxx +60 -0
- data/ext/couchbase/core/operations_fwd.hxx +3 -3
- data/ext/couchbase/core/origin.cxx +54 -26
- data/ext/couchbase/core/origin.hxx +12 -0
- data/ext/couchbase/core/orphan_reporter.cxx +2 -1
- data/ext/couchbase/core/platform/random.cc +7 -7
- data/ext/couchbase/core/protocol/client_request.cxx +2 -2
- data/ext/couchbase/core/protocol/client_request.hxx +38 -21
- data/ext/couchbase/core/protocol/client_response.cxx +11 -3
- data/ext/couchbase/core/protocol/client_response.hxx +27 -6
- data/ext/couchbase/core/protocol/cmd_append.cxx +2 -2
- data/ext/couchbase/core/protocol/cmd_cluster_map_change_notification.cxx +2 -2
- data/ext/couchbase/core/protocol/cmd_decrement.cxx +6 -6
- data/ext/couchbase/core/protocol/cmd_get.cxx +1 -1
- data/ext/couchbase/core/protocol/cmd_get_and_lock.cxx +2 -2
- data/ext/couchbase/core/protocol/cmd_get_and_touch.cxx +2 -2
- data/ext/couchbase/core/protocol/cmd_get_cluster_config.cxx +6 -4
- data/ext/couchbase/core/protocol/cmd_get_collection_id.cxx +2 -2
- data/ext/couchbase/core/protocol/cmd_get_error_map.cxx +1 -1
- data/ext/couchbase/core/protocol/cmd_get_meta.cxx +4 -4
- data/ext/couchbase/core/protocol/cmd_get_replica.cxx +1 -1
- data/ext/couchbase/core/protocol/cmd_hello.cxx +1 -1
- data/ext/couchbase/core/protocol/cmd_increment.cxx +6 -6
- data/ext/couchbase/core/protocol/cmd_insert.cxx +4 -4
- data/ext/couchbase/core/protocol/cmd_lookup_in.cxx +4 -3
- data/ext/couchbase/core/protocol/cmd_lookup_in_replica.cxx +4 -3
- data/ext/couchbase/core/protocol/cmd_mutate_in.cxx +10 -9
- data/ext/couchbase/core/protocol/cmd_mutate_in.hxx +10 -10
- data/ext/couchbase/core/protocol/cmd_observe_seqno.cxx +7 -7
- data/ext/couchbase/core/protocol/cmd_prepend.cxx +2 -2
- data/ext/couchbase/core/protocol/cmd_remove.cxx +2 -2
- data/ext/couchbase/core/protocol/cmd_replace.cxx +4 -4
- data/ext/couchbase/core/protocol/cmd_touch.cxx +1 -1
- data/ext/couchbase/core/protocol/cmd_upsert.cxx +4 -4
- data/ext/couchbase/core/protocol/datatype.hxx +118 -1
- data/ext/couchbase/core/protocol/frame_info_utils.cxx +1 -1
- data/ext/couchbase/core/protocol/magic.hxx +4 -0
- data/ext/couchbase/core/protocol/magic_fmt.hxx +3 -0
- data/ext/couchbase/core/protocol/server_request.hxx +3 -1
- data/ext/couchbase/core/protocol/status.cxx +1 -1
- data/ext/couchbase/core/protostellar/analytics_converter.hxx +171 -0
- data/ext/couchbase/core/protostellar/bucket_admin_converter.hxx +301 -0
- data/ext/couchbase/core/protostellar/collection_admin_converter.hxx +92 -0
- data/ext/couchbase/core/protostellar/component.cxx +2445 -0
- data/ext/couchbase/core/protostellar/component.hxx +391 -0
- data/ext/couchbase/core/{columnar/bootstrap_notification_subscriber.hxx → protostellar/compression_settings.hxx} +11 -10
- data/ext/couchbase/core/protostellar/credentials.cxx +233 -0
- data/ext/couchbase/core/protostellar/credentials.hxx +88 -0
- data/ext/couchbase/core/protostellar/dispatcher.cxx +57 -0
- data/ext/couchbase/core/protostellar/dispatcher.hxx +482 -0
- data/ext/couchbase/core/protostellar/error_utils.cxx +293 -0
- data/ext/couchbase/core/protostellar/error_utils.hxx +97 -0
- data/ext/couchbase/core/protostellar/json_payload.hxx +49 -0
- data/ext/couchbase/core/protostellar/kv_converter.cxx +70 -0
- data/ext/couchbase/core/protostellar/kv_converter.hxx +600 -0
- data/ext/couchbase/core/protostellar/query_converter.hxx +265 -0
- data/ext/couchbase/core/protostellar/query_index_admin_converter.hxx +291 -0
- data/ext/couchbase/core/protostellar/query_proto.hxx +73 -0
- data/ext/couchbase/core/protostellar/search_converter.hxx +244 -0
- data/ext/couchbase/core/protostellar/search_index_admin_converter.hxx +156 -0
- data/ext/couchbase/core/protostellar/view_converter.hxx +158 -0
- data/ext/couchbase/core/query_stream.cxx +447 -0
- data/ext/couchbase/core/query_stream.hxx +141 -0
- data/ext/couchbase/core/query_stream_component.cxx +243 -0
- data/ext/couchbase/core/query_stream_component.hxx +68 -0
- data/ext/couchbase/core/range_scan_load_balancer.cxx +15 -8
- data/ext/couchbase/core/range_scan_orchestrator.cxx +15 -3
- data/ext/couchbase/core/response_handler.hxx +41 -4
- data/ext/couchbase/core/row_streamer.cxx +332 -46
- data/ext/couchbase/core/row_streamer.hxx +31 -1
- data/ext/couchbase/core/row_streamer_options.hxx +55 -0
- data/ext/couchbase/core/sasl/client.h +3 -0
- data/ext/couchbase/core/search_scoring.hxx +66 -0
- data/ext/couchbase/core/stream_error_details.hxx +69 -0
- data/ext/couchbase/core/timeout_defaults.hxx +0 -1
- data/ext/couchbase/core/topology/capabilities.hxx +6 -0
- data/ext/couchbase/core/topology/capabilities_fmt.hxx +3 -0
- data/ext/couchbase/core/topology/configuration.cxx +21 -6
- data/ext/couchbase/core/topology/configuration.hxx +29 -8
- data/ext/couchbase/core/topology/configuration_json.hxx +3 -0
- data/ext/couchbase/core/topology/error_map_json.hxx +3 -1
- data/ext/couchbase/core/tracing/threshold_logging_tracer.cxx +70 -4
- data/ext/couchbase/core/tracing/threshold_logging_tracer.hxx +10 -0
- data/ext/couchbase/core/transactions/active_transaction_record.cxx +0 -34
- data/ext/couchbase/core/transactions/attempt_context_impl.cxx +362 -241
- data/ext/couchbase/core/transactions/attempt_context_impl.hxx +24 -3
- data/ext/couchbase/core/transactions/error_list.hxx +2 -2
- data/ext/couchbase/core/transactions/get_multi_fetch.hxx +160 -0
- data/ext/couchbase/core/transactions/get_multi_orchestrator.cxx +326 -125
- data/ext/couchbase/core/transactions/get_multi_transaction_id.hxx +62 -0
- data/ext/couchbase/core/transactions/internal/atr_entry.hxx +22 -2
- data/ext/couchbase/core/transactions/internal/transaction_context.hxx +2 -2
- data/ext/couchbase/core/transactions/internal/transactions_cleanup.hxx +23 -1
- data/ext/couchbase/core/transactions/internal/utils.hxx +50 -14
- data/ext/couchbase/core/transactions/staged_mutation.cxx +23 -18
- data/ext/couchbase/core/transactions/staged_mutation.hxx +15 -4
- data/ext/couchbase/core/transactions/transaction_context.cxx +55 -40
- data/ext/couchbase/core/transactions/transaction_get_result.hxx +16 -0
- data/ext/couchbase/core/transactions/transactions.cxx +3 -55
- data/ext/couchbase/core/transactions/transactions_cleanup.cxx +194 -66
- data/ext/couchbase/core/transactions/transactions_config.cxx +0 -11
- data/ext/couchbase/core/transactions/utils.cxx +10 -0
- data/ext/couchbase/core/transactions/waitable_op_list.hxx +15 -4
- data/ext/couchbase/core/transactions.hxx +9 -9
- data/ext/couchbase/core/utils/byteswap.hxx +166 -9
- data/ext/couchbase/core/utils/connection_string.cxx +50 -85
- data/ext/couchbase/core/utils/connection_string.hxx +15 -0
- data/ext/couchbase/core/{columnar/backoff_calculator.hxx → utils/deadline.hxx} +13 -13
- data/ext/couchbase/core/utils/duration_parser.cxx +1 -1
- data/ext/couchbase/core/utils/json_streaming_lexer.cxx +48 -5
- data/ext/couchbase/core/utils/json_streaming_lexer.hxx +4 -1
- data/ext/couchbase/core/utils/movable_function.hxx +301 -52
- data/ext/couchbase/core/utils/name_codec.hxx +154 -11
- data/ext/couchbase/core/{columnar/retry_info.hxx → utils/process_id.hxx} +18 -13
- data/ext/couchbase/core/utils/url_codec.cxx +12 -51
- data/ext/couchbase/core/websocket_codec.cxx +3 -29
- data/ext/couchbase/couchbase/analytics_options.hxx +21 -10
- data/ext/couchbase/couchbase/analytics_row.hxx +105 -0
- data/ext/couchbase/couchbase/analytics_stream_result.hxx +266 -0
- data/ext/couchbase/couchbase/boolean_query.hxx +3 -3
- data/ext/couchbase/couchbase/bucket.hxx +57 -0
- data/ext/couchbase/couchbase/cluster.hxx +216 -5
- data/ext/couchbase/{core/columnar/security_options.hxx → couchbase/cluster_state.hxx} +18 -14
- data/ext/couchbase/couchbase/codec/lenient_json_transcoder.hxx +69 -0
- data/ext/couchbase/couchbase/collection.hxx +234 -14
- data/ext/couchbase/couchbase/common_durability_options.hxx +18 -3
- data/ext/couchbase/couchbase/conjunction_query.hxx +1 -1
- data/ext/couchbase/couchbase/create_dataset_analytics_options.hxx +6 -1
- data/ext/couchbase/couchbase/date_range_query.hxx +2 -2
- data/ext/couchbase/couchbase/decrement_options.hxx +1 -1
- data/ext/couchbase/couchbase/disjunction_query.hxx +1 -1
- data/ext/couchbase/couchbase/error.hxx +32 -0
- data/ext/couchbase/couchbase/error_codes.hxx +32 -0
- data/ext/couchbase/couchbase/geo_bounding_box_query.hxx +1 -1
- data/ext/couchbase/couchbase/geo_distance_query.hxx +1 -1
- data/ext/couchbase/couchbase/geo_polygon_query.hxx +1 -1
- data/ext/couchbase/couchbase/get_replica_options.hxx +68 -0
- data/ext/couchbase/couchbase/get_replica_result.hxx +5 -3
- data/ext/couchbase/couchbase/get_replica_strategy.hxx +161 -0
- data/ext/couchbase/couchbase/get_result.hxx +1 -0
- data/ext/couchbase/couchbase/increment_options.hxx +1 -1
- data/ext/couchbase/couchbase/insert_options.hxx +1 -1
- data/ext/couchbase/couchbase/match_phrase_query.hxx +1 -1
- data/ext/couchbase/couchbase/match_query.hxx +1 -1
- data/ext/couchbase/couchbase/mutate_in_options.hxx +3 -3
- data/ext/couchbase/couchbase/network_options.hxx +1 -1
- data/ext/couchbase/couchbase/node_id.hxx +42 -14
- data/ext/couchbase/couchbase/node_id_for_options.hxx +7 -1
- data/ext/couchbase/couchbase/node_ids_options.hxx +8 -2
- data/ext/couchbase/couchbase/numeric_range_query.hxx +1 -1
- data/ext/couchbase/couchbase/phrase_query.hxx +1 -1
- data/ext/couchbase/couchbase/prefix_query.hxx +1 -1
- data/ext/couchbase/couchbase/query_options.hxx +23 -12
- data/ext/couchbase/couchbase/query_row.hxx +111 -0
- data/ext/couchbase/couchbase/query_stream_result.hxx +302 -0
- data/ext/couchbase/couchbase/query_string_query.hxx +3 -3
- data/ext/couchbase/couchbase/regexp_query.hxx +1 -1
- data/ext/couchbase/couchbase/replace_options.hxx +3 -3
- data/ext/couchbase/couchbase/result.hxx +14 -3
- data/ext/couchbase/couchbase/scan_result_item.hxx +1 -0
- data/ext/couchbase/couchbase/scope.hxx +85 -2
- data/ext/couchbase/couchbase/search_options.hxx +58 -8
- data/ext/couchbase/couchbase/search_scoring.hxx +94 -0
- data/ext/couchbase/couchbase/search_scoring_none.hxx +51 -0
- data/ext/couchbase/couchbase/search_scoring_reciprocal_rank_fusion.hxx +88 -0
- data/ext/couchbase/couchbase/search_scoring_relative_score_fusion.hxx +70 -0
- data/ext/couchbase/couchbase/term_range_query.hxx +1 -1
- data/ext/couchbase/couchbase/tracing/request_span.hxx +46 -0
- data/ext/couchbase/couchbase/transactions/transaction_get_multi_replicas_from_preferred_server_group_result.hxx +23 -21
- data/ext/couchbase/couchbase/transactions/transaction_get_multi_result.hxx +24 -19
- data/ext/couchbase/couchbase/transactions/transaction_get_result.hxx +17 -3
- data/ext/couchbase/couchbase/transactions/transactions_config.hxx +4 -2
- data/ext/couchbase/couchbase/transactions.hxx +27 -18
- data/ext/couchbase/couchbase/upsert_options.hxx +3 -3
- data/ext/couchbase/couchbase/vector_query.hxx +1 -1
- data/ext/couchbase/couchbase/wait_until_ready_options.hxx +111 -0
- data/ext/couchbase/couchbase/wildcard_query.hxx +1 -1
- data/ext/extconf.rb +15 -10
- data/ext/rcb_analytics.cxx +82 -102
- data/ext/rcb_backend.cxx +42 -36
- data/ext/rcb_backend.hxx +2 -0
- data/ext/rcb_buckets.cxx +47 -59
- data/ext/rcb_collections.cxx +42 -52
- data/ext/rcb_crud.cxx +345 -224
- data/ext/rcb_diagnostics.cxx +117 -27
- data/ext/rcb_exceptions.cxx +152 -99
- data/ext/rcb_exceptions.hxx +25 -0
- data/ext/rcb_extras.cxx +18 -19
- data/ext/rcb_hdr_histogram.cxx +19 -4
- data/ext/rcb_logger.cxx +202 -27
- data/ext/rcb_logger.hxx +12 -0
- data/ext/rcb_multi.cxx +40 -40
- data/ext/rcb_observability.cxx +7 -5
- data/ext/rcb_query.cxx +99 -142
- data/ext/rcb_range_scan.cxx +41 -35
- data/ext/rcb_search.cxx +98 -99
- data/ext/rcb_users.cxx +36 -56
- data/ext/rcb_utils.cxx +100 -37
- data/ext/rcb_utils.hxx +287 -33
- data/ext/rcb_version.cxx +1 -1
- data/ext/rcb_views.cxx +55 -51
- data/lib/active_support/cache/couchbase_store.rb +77 -12
- data/lib/couchbase/bucket.rb +20 -0
- data/lib/couchbase/cluster.rb +33 -14
- data/lib/couchbase/collection.rb +36 -1
- data/lib/couchbase/errors.rb +18 -0
- data/lib/couchbase/fork_hooks.rb +16 -7
- data/lib/couchbase/get_replica_strategy.rb +89 -0
- data/lib/couchbase/logger.rb +1 -1
- data/lib/couchbase/management/analytics_index_manager.rb +15 -15
- data/lib/couchbase/management/bucket_manager.rb +6 -6
- data/lib/couchbase/management/collection_manager.rb +6 -6
- data/lib/couchbase/management/query_index_manager.rb +7 -7
- data/lib/couchbase/management/search_index_manager.rb +13 -13
- data/lib/couchbase/management/user_manager.rb +10 -10
- data/lib/couchbase/management/view_index_manager.rb +5 -5
- data/lib/couchbase/options.rb +181 -44
- data/lib/couchbase/protostellar/bucket.rb +4 -0
- data/lib/couchbase/protostellar/cluster.rb +4 -0
- data/lib/couchbase/protostellar/collection.rb +4 -0
- data/lib/couchbase/protostellar/error_handling.rb +2 -1
- data/lib/couchbase/protostellar/request.rb +1 -0
- data/lib/couchbase/protostellar/request_generator/kv.rb +16 -2
- data/lib/couchbase/protostellar/request_generator/search.rb +17 -1
- data/lib/couchbase/protostellar/retry/orchestrator.rb +3 -2
- data/lib/couchbase/protostellar/retry/strategies/fail_fast.rb +33 -0
- data/lib/couchbase/protostellar/retry/strategies.rb +1 -0
- data/lib/couchbase/search_options.rb +95 -6
- data/lib/couchbase/version.rb +1 -1
- metadata +92 -33
- data/ext/0001-fix-build-for-mingw-w64-ucrt-x86_64-toolchain.patch +0 -40
- data/ext/couchbase/core/columnar/agent.hxx +0 -71
- data/ext/couchbase/core/columnar/agent_config.hxx +0 -59
- data/ext/couchbase/core/columnar/background_bootstrap_listener.hxx +0 -42
- data/ext/couchbase/core/columnar/backoff_calculator.cxx +0 -62
- data/ext/couchbase/core/columnar/columnar_agent.cxx +0 -147
- data/ext/couchbase/core/columnar/columnar_agent_config.cxx +0 -48
- data/ext/couchbase/core/columnar/columnar_error.cxx +0 -51
- data/ext/couchbase/core/columnar/database_management_options.hxx +0 -56
- data/ext/couchbase/core/columnar/error.hxx +0 -51
- data/ext/couchbase/core/columnar/error_codes.cxx +0 -107
- data/ext/couchbase/core/columnar/error_codes.hxx +0 -75
- data/ext/couchbase/core/columnar/management_component.cxx +0 -300
- data/ext/couchbase/core/columnar/management_component.hxx +0 -56
- data/ext/couchbase/core/columnar/query_component.cxx +0 -523
- data/ext/couchbase/core/columnar/query_component.hxx +0 -57
- data/ext/couchbase/core/columnar/query_options.hxx +0 -59
- data/ext/couchbase/core/columnar/query_result.cxx +0 -130
- data/ext/couchbase/core/columnar/query_result.hxx +0 -78
- data/ext/couchbase/core/io/config_tracker.cxx +0 -687
- data/ext/couchbase/core/io/config_tracker.hxx +0 -123
data/ext/rcb_buckets.cxx
CHANGED
|
@@ -56,11 +56,11 @@ cb_generate_bucket_settings(VALUE bucket,
|
|
|
56
56
|
entry.bucket_type = core::management::cluster::bucket_type::ephemeral;
|
|
57
57
|
} else {
|
|
58
58
|
throw ruby_exception(rb_eArgError,
|
|
59
|
-
|
|
59
|
+
cb_sprintf("unknown bucket type, given %+" PRIsVALUE, bucket_type));
|
|
60
60
|
}
|
|
61
61
|
} else {
|
|
62
62
|
throw ruby_exception(
|
|
63
|
-
rb_eArgError,
|
|
63
|
+
rb_eArgError, cb_sprintf("bucket type must be a Symbol, given %+" PRIsVALUE, bucket_type));
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -68,7 +68,7 @@ cb_generate_bucket_settings(VALUE bucket,
|
|
|
68
68
|
entry.name = cb_string_new(name);
|
|
69
69
|
} else {
|
|
70
70
|
throw ruby_exception(rb_eArgError,
|
|
71
|
-
|
|
71
|
+
cb_sprintf("bucket name must be a String, given %+" PRIsVALUE, name));
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
if (VALUE quota = rb_hash_aref(bucket, rb_id2sym(rb_intern("ram_quota_mb"))); !NIL_P(quota)) {
|
|
@@ -76,28 +76,28 @@ cb_generate_bucket_settings(VALUE bucket,
|
|
|
76
76
|
entry.ram_quota_mb = FIX2ULONG(quota);
|
|
77
77
|
} else {
|
|
78
78
|
throw ruby_exception(
|
|
79
|
-
rb_eArgError,
|
|
79
|
+
rb_eArgError, cb_sprintf("bucket RAM quota must be an Integer, given %+" PRIsVALUE, quota));
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
if (VALUE expiry = rb_hash_aref(bucket, rb_id2sym(rb_intern("max_expiry"))); !NIL_P(expiry)) {
|
|
84
84
|
if (TYPE(expiry) == T_FIXNUM) {
|
|
85
|
-
entry.max_expiry =
|
|
85
|
+
entry.max_expiry = cb_num2uint(expiry);
|
|
86
86
|
} else {
|
|
87
87
|
throw ruby_exception(
|
|
88
88
|
rb_eArgError,
|
|
89
|
-
|
|
89
|
+
cb_sprintf("bucket max expiry must be an Integer, given %+" PRIsVALUE, expiry));
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
if (VALUE num_replicas = rb_hash_aref(bucket, rb_id2sym(rb_intern("num_replicas")));
|
|
94
94
|
!NIL_P(num_replicas)) {
|
|
95
95
|
if (TYPE(num_replicas) == T_FIXNUM) {
|
|
96
|
-
entry.num_replicas =
|
|
96
|
+
entry.num_replicas = cb_num2uint(num_replicas);
|
|
97
97
|
} else {
|
|
98
98
|
throw ruby_exception(
|
|
99
99
|
rb_eArgError,
|
|
100
|
-
|
|
100
|
+
cb_sprintf("bucket number of replicas must be an Integer, given %+" PRIsVALUE,
|
|
101
101
|
num_replicas));
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -124,12 +124,12 @@ cb_generate_bucket_settings(VALUE bucket,
|
|
|
124
124
|
} else {
|
|
125
125
|
throw ruby_exception(
|
|
126
126
|
rb_eArgError,
|
|
127
|
-
|
|
127
|
+
cb_sprintf("unknown compression mode, given %+" PRIsVALUE, compression_mode));
|
|
128
128
|
}
|
|
129
129
|
} else {
|
|
130
130
|
throw ruby_exception(
|
|
131
131
|
rb_eArgError,
|
|
132
|
-
|
|
132
|
+
cb_sprintf("bucket compression mode must be a Symbol, given %+" PRIsVALUE,
|
|
133
133
|
compression_mode));
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -148,12 +148,12 @@ cb_generate_bucket_settings(VALUE bucket,
|
|
|
148
148
|
core::management::cluster::bucket_eviction_policy::not_recently_used;
|
|
149
149
|
} else {
|
|
150
150
|
throw ruby_exception(
|
|
151
|
-
rb_eArgError,
|
|
151
|
+
rb_eArgError, cb_sprintf("unknown eviction policy, given %+" PRIsVALUE, eviction_policy));
|
|
152
152
|
}
|
|
153
153
|
} else {
|
|
154
154
|
throw ruby_exception(
|
|
155
155
|
rb_eArgError,
|
|
156
|
-
|
|
156
|
+
cb_sprintf("bucket eviction policy must be a Symbol, given %+" PRIsVALUE, eviction_policy));
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
@@ -167,12 +167,12 @@ cb_generate_bucket_settings(VALUE bucket,
|
|
|
167
167
|
} else {
|
|
168
168
|
throw ruby_exception(
|
|
169
169
|
rb_eArgError,
|
|
170
|
-
|
|
170
|
+
cb_sprintf("unknown storage backend type, given %+" PRIsVALUE, storage_backend));
|
|
171
171
|
}
|
|
172
172
|
} else {
|
|
173
173
|
throw ruby_exception(
|
|
174
174
|
rb_eArgError,
|
|
175
|
-
|
|
175
|
+
cb_sprintf("bucket storage backend type must be a Symbol, given %+" PRIsVALUE,
|
|
176
176
|
storage_backend));
|
|
177
177
|
}
|
|
178
178
|
}
|
|
@@ -191,12 +191,12 @@ cb_generate_bucket_settings(VALUE bucket,
|
|
|
191
191
|
entry.minimum_durability_level = couchbase::durability_level::persist_to_majority;
|
|
192
192
|
} else {
|
|
193
193
|
throw ruby_exception(
|
|
194
|
-
rb_eArgError,
|
|
194
|
+
rb_eArgError, cb_sprintf("unknown durability level, given %+" PRIsVALUE, minimum_level));
|
|
195
195
|
}
|
|
196
196
|
} else {
|
|
197
197
|
throw ruby_exception(
|
|
198
198
|
rb_eArgError,
|
|
199
|
-
|
|
199
|
+
cb_sprintf("bucket minimum durability level must be a Symbol, given %+" PRIsVALUE,
|
|
200
200
|
minimum_level));
|
|
201
201
|
}
|
|
202
202
|
}
|
|
@@ -211,11 +211,11 @@ cb_generate_bucket_settings(VALUE bucket,
|
|
|
211
211
|
rb_hash_aref(bucket, rb_id2sym(rb_intern("history_retention_bytes")));
|
|
212
212
|
!NIL_P(history_retention_bytes)) {
|
|
213
213
|
if (TYPE(history_retention_bytes) == T_FIXNUM) {
|
|
214
|
-
entry.history_retention_bytes =
|
|
214
|
+
entry.history_retention_bytes = cb_num2uint(history_retention_bytes);
|
|
215
215
|
} else {
|
|
216
216
|
throw ruby_exception(
|
|
217
217
|
rb_eArgError,
|
|
218
|
-
|
|
218
|
+
cb_sprintf("history retention bytes must be an Integer, given %+" PRIsVALUE,
|
|
219
219
|
history_retention_bytes));
|
|
220
220
|
}
|
|
221
221
|
}
|
|
@@ -224,11 +224,11 @@ cb_generate_bucket_settings(VALUE bucket,
|
|
|
224
224
|
rb_hash_aref(bucket, rb_id2sym(rb_intern("history_retention_duration")));
|
|
225
225
|
!NIL_P(history_retention_duration)) {
|
|
226
226
|
if (TYPE(history_retention_duration) == T_FIXNUM) {
|
|
227
|
-
entry.history_retention_duration =
|
|
227
|
+
entry.history_retention_duration = cb_num2uint(history_retention_duration);
|
|
228
228
|
} else {
|
|
229
229
|
throw ruby_exception(
|
|
230
230
|
rb_eArgError,
|
|
231
|
-
|
|
231
|
+
cb_sprintf("history retention duration must be an Integer, given %+" PRIsVALUE,
|
|
232
232
|
history_retention_duration));
|
|
233
233
|
}
|
|
234
234
|
}
|
|
@@ -236,11 +236,11 @@ cb_generate_bucket_settings(VALUE bucket,
|
|
|
236
236
|
if (VALUE num_vbuckets = rb_hash_aref(bucket, rb_id2sym(rb_intern("num_vbuckets")));
|
|
237
237
|
!NIL_P(num_vbuckets)) {
|
|
238
238
|
if (TYPE(num_vbuckets) == T_FIXNUM) {
|
|
239
|
-
entry.num_vbuckets =
|
|
239
|
+
entry.num_vbuckets = cb_num2uint(num_vbuckets);
|
|
240
240
|
} else {
|
|
241
241
|
throw ruby_exception(
|
|
242
242
|
rb_eArgError,
|
|
243
|
-
|
|
243
|
+
cb_sprintf("num vbuckets must be an Integer, given %+" PRIsVALUE, num_vbuckets));
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
|
|
@@ -260,13 +260,13 @@ cb_generate_bucket_settings(VALUE bucket,
|
|
|
260
260
|
core::management::cluster::bucket_conflict_resolution::custom;
|
|
261
261
|
} else {
|
|
262
262
|
throw ruby_exception(rb_eArgError,
|
|
263
|
-
|
|
263
|
+
cb_sprintf("unknown conflict resolution type, given %+" PRIsVALUE,
|
|
264
264
|
conflict_resolution_type));
|
|
265
265
|
}
|
|
266
266
|
} else {
|
|
267
267
|
throw ruby_exception(
|
|
268
268
|
rb_eArgError,
|
|
269
|
-
|
|
269
|
+
cb_sprintf("bucket conflict resolution type must be a Symbol, given %+" PRIsVALUE,
|
|
270
270
|
conflict_resolution_type));
|
|
271
271
|
}
|
|
272
272
|
}
|
|
@@ -281,9 +281,9 @@ cb_Backend_bucket_create(VALUE self,
|
|
|
281
281
|
{
|
|
282
282
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
283
283
|
|
|
284
|
-
|
|
284
|
+
cb_check_type(bucket_settings, T_HASH);
|
|
285
285
|
if (!NIL_P(options)) {
|
|
286
|
-
|
|
286
|
+
cb_check_type(options, T_HASH);
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
try {
|
|
@@ -307,10 +307,8 @@ cb_Backend_bucket_create(VALUE self,
|
|
|
307
307
|
|
|
308
308
|
return Qtrue;
|
|
309
309
|
} catch (const std::system_error& se) {
|
|
310
|
-
|
|
310
|
+
throw ruby_exception(cb_map_error_code(
|
|
311
311
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
312
|
-
} catch (const ruby_exception& e) {
|
|
313
|
-
rb_exc_raise(e.exception_object());
|
|
314
312
|
}
|
|
315
313
|
return Qnil;
|
|
316
314
|
}
|
|
@@ -323,9 +321,9 @@ cb_Backend_bucket_update(VALUE self,
|
|
|
323
321
|
{
|
|
324
322
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
325
323
|
|
|
326
|
-
|
|
324
|
+
cb_check_type(bucket_settings, T_HASH);
|
|
327
325
|
if (!NIL_P(options)) {
|
|
328
|
-
|
|
326
|
+
cb_check_type(options, T_HASH);
|
|
329
327
|
}
|
|
330
328
|
try {
|
|
331
329
|
core::operations::management::bucket_update_request req{};
|
|
@@ -347,10 +345,8 @@ cb_Backend_bucket_update(VALUE self,
|
|
|
347
345
|
}
|
|
348
346
|
return Qtrue;
|
|
349
347
|
} catch (const std::system_error& se) {
|
|
350
|
-
|
|
348
|
+
throw ruby_exception(cb_map_error_code(
|
|
351
349
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
352
|
-
} catch (const ruby_exception& e) {
|
|
353
|
-
rb_exc_raise(e.exception_object());
|
|
354
350
|
}
|
|
355
351
|
return Qnil;
|
|
356
352
|
}
|
|
@@ -360,9 +356,9 @@ cb_Backend_bucket_drop(VALUE self, VALUE bucket_name, VALUE options, VALUE obser
|
|
|
360
356
|
{
|
|
361
357
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
362
358
|
|
|
363
|
-
|
|
359
|
+
cb_check_type(bucket_name, T_STRING);
|
|
364
360
|
if (!NIL_P(options)) {
|
|
365
|
-
|
|
361
|
+
cb_check_type(options, T_HASH);
|
|
366
362
|
}
|
|
367
363
|
|
|
368
364
|
try {
|
|
@@ -382,10 +378,8 @@ cb_Backend_bucket_drop(VALUE self, VALUE bucket_name, VALUE options, VALUE obser
|
|
|
382
378
|
}
|
|
383
379
|
return Qtrue;
|
|
384
380
|
} catch (const std::system_error& se) {
|
|
385
|
-
|
|
381
|
+
throw ruby_exception(cb_map_error_code(
|
|
386
382
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
387
|
-
} catch (const ruby_exception& e) {
|
|
388
|
-
rb_exc_raise(e.exception_object());
|
|
389
383
|
}
|
|
390
384
|
return Qnil;
|
|
391
385
|
}
|
|
@@ -395,9 +389,9 @@ cb_Backend_bucket_flush(VALUE self, VALUE bucket_name, VALUE options, VALUE obse
|
|
|
395
389
|
{
|
|
396
390
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
397
391
|
|
|
398
|
-
|
|
392
|
+
cb_check_type(bucket_name, T_STRING);
|
|
399
393
|
if (!NIL_P(options)) {
|
|
400
|
-
|
|
394
|
+
cb_check_type(options, T_HASH);
|
|
401
395
|
}
|
|
402
396
|
|
|
403
397
|
try {
|
|
@@ -418,10 +412,8 @@ cb_Backend_bucket_flush(VALUE self, VALUE bucket_name, VALUE options, VALUE obse
|
|
|
418
412
|
|
|
419
413
|
return Qtrue;
|
|
420
414
|
} catch (const std::system_error& se) {
|
|
421
|
-
|
|
415
|
+
throw ruby_exception(cb_map_error_code(
|
|
422
416
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
423
|
-
} catch (const ruby_exception& e) {
|
|
424
|
-
rb_exc_raise(e.exception_object());
|
|
425
417
|
}
|
|
426
418
|
return Qnil;
|
|
427
419
|
}
|
|
@@ -586,7 +578,7 @@ cb_Backend_bucket_get_all(VALUE self, VALUE options, VALUE observability_handler
|
|
|
586
578
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
587
579
|
|
|
588
580
|
if (!NIL_P(options)) {
|
|
589
|
-
|
|
581
|
+
cb_check_type(options, T_HASH);
|
|
590
582
|
}
|
|
591
583
|
|
|
592
584
|
try {
|
|
@@ -613,10 +605,8 @@ cb_Backend_bucket_get_all(VALUE self, VALUE options, VALUE observability_handler
|
|
|
613
605
|
|
|
614
606
|
return res;
|
|
615
607
|
} catch (const std::system_error& se) {
|
|
616
|
-
|
|
608
|
+
throw ruby_exception(cb_map_error_code(
|
|
617
609
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
618
|
-
} catch (const ruby_exception& e) {
|
|
619
|
-
rb_exc_raise(e.exception_object());
|
|
620
610
|
}
|
|
621
611
|
return Qnil;
|
|
622
612
|
}
|
|
@@ -626,9 +616,9 @@ cb_Backend_bucket_get(VALUE self, VALUE bucket_name, VALUE options, VALUE observ
|
|
|
626
616
|
{
|
|
627
617
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
628
618
|
|
|
629
|
-
|
|
619
|
+
cb_check_type(bucket_name, T_STRING);
|
|
630
620
|
if (!NIL_P(options)) {
|
|
631
|
-
|
|
621
|
+
cb_check_type(options, T_HASH);
|
|
632
622
|
}
|
|
633
623
|
|
|
634
624
|
try {
|
|
@@ -651,10 +641,8 @@ cb_Backend_bucket_get(VALUE self, VALUE bucket_name, VALUE options, VALUE observ
|
|
|
651
641
|
cb_extract_bucket_settings(resp.bucket, res);
|
|
652
642
|
return res;
|
|
653
643
|
} catch (const std::system_error& se) {
|
|
654
|
-
|
|
644
|
+
throw ruby_exception(cb_map_error_code(
|
|
655
645
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
656
|
-
} catch (const ruby_exception& e) {
|
|
657
|
-
rb_exc_raise(e.exception_object());
|
|
658
646
|
}
|
|
659
647
|
return Qnil;
|
|
660
648
|
}
|
|
@@ -663,11 +651,11 @@ cb_Backend_bucket_get(VALUE self, VALUE bucket_name, VALUE options, VALUE observ
|
|
|
663
651
|
void
|
|
664
652
|
init_buckets(VALUE cBackend)
|
|
665
653
|
{
|
|
666
|
-
rb_define_method(cBackend, "bucket_create", cb_Backend_bucket_create, 3);
|
|
667
|
-
rb_define_method(cBackend, "bucket_update", cb_Backend_bucket_update, 3);
|
|
668
|
-
rb_define_method(cBackend, "bucket_drop", cb_Backend_bucket_drop, 3);
|
|
669
|
-
rb_define_method(cBackend, "bucket_flush", cb_Backend_bucket_flush, 3);
|
|
670
|
-
rb_define_method(cBackend, "bucket_get_all", cb_Backend_bucket_get_all, 2);
|
|
671
|
-
rb_define_method(cBackend, "bucket_get", cb_Backend_bucket_get, 3);
|
|
654
|
+
rb_define_method(cBackend, "bucket_create", cb_method<cb_Backend_bucket_create>::invoke, 3);
|
|
655
|
+
rb_define_method(cBackend, "bucket_update", cb_method<cb_Backend_bucket_update>::invoke, 3);
|
|
656
|
+
rb_define_method(cBackend, "bucket_drop", cb_method<cb_Backend_bucket_drop>::invoke, 3);
|
|
657
|
+
rb_define_method(cBackend, "bucket_flush", cb_method<cb_Backend_bucket_flush>::invoke, 3);
|
|
658
|
+
rb_define_method(cBackend, "bucket_get_all", cb_method<cb_Backend_bucket_get_all>::invoke, 2);
|
|
659
|
+
rb_define_method(cBackend, "bucket_get", cb_method<cb_Backend_bucket_get>::invoke, 3);
|
|
672
660
|
}
|
|
673
661
|
} // namespace couchbase::ruby
|
data/ext/rcb_collections.cxx
CHANGED
|
@@ -43,9 +43,9 @@ cb_Backend_scope_get_all(VALUE self, VALUE bucket_name, VALUE options, VALUE obs
|
|
|
43
43
|
{
|
|
44
44
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
cb_check_type(bucket_name, T_STRING);
|
|
47
47
|
if (!NIL_P(options)) {
|
|
48
|
-
|
|
48
|
+
cb_check_type(options, T_HASH);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
try {
|
|
@@ -91,10 +91,8 @@ cb_Backend_scope_get_all(VALUE self, VALUE bucket_name, VALUE options, VALUE obs
|
|
|
91
91
|
|
|
92
92
|
return res;
|
|
93
93
|
} catch (const std::system_error& se) {
|
|
94
|
-
|
|
94
|
+
throw ruby_exception(cb_map_error_code(
|
|
95
95
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
96
|
-
} catch (const ruby_exception& e) {
|
|
97
|
-
rb_exc_raise(e.exception_object());
|
|
98
96
|
}
|
|
99
97
|
return Qnil;
|
|
100
98
|
}
|
|
@@ -108,10 +106,10 @@ cb_Backend_scope_create(VALUE self,
|
|
|
108
106
|
{
|
|
109
107
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
110
108
|
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
cb_check_type(bucket_name, T_STRING);
|
|
110
|
+
cb_check_type(scope_name, T_STRING);
|
|
113
111
|
if (!NIL_P(options)) {
|
|
114
|
-
|
|
112
|
+
cb_check_type(options, T_HASH);
|
|
115
113
|
}
|
|
116
114
|
|
|
117
115
|
try {
|
|
@@ -135,10 +133,8 @@ cb_Backend_scope_create(VALUE self,
|
|
|
135
133
|
}
|
|
136
134
|
return ULL2NUM(resp.uid);
|
|
137
135
|
} catch (const std::system_error& se) {
|
|
138
|
-
|
|
136
|
+
throw ruby_exception(cb_map_error_code(
|
|
139
137
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
140
|
-
} catch (const ruby_exception& e) {
|
|
141
|
-
rb_exc_raise(e.exception_object());
|
|
142
138
|
}
|
|
143
139
|
return Qnil;
|
|
144
140
|
}
|
|
@@ -152,10 +148,10 @@ cb_Backend_scope_drop(VALUE self,
|
|
|
152
148
|
{
|
|
153
149
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
154
150
|
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
cb_check_type(bucket_name, T_STRING);
|
|
152
|
+
cb_check_type(scope_name, T_STRING);
|
|
157
153
|
if (!NIL_P(options)) {
|
|
158
|
-
|
|
154
|
+
cb_check_type(options, T_HASH);
|
|
159
155
|
}
|
|
160
156
|
|
|
161
157
|
try {
|
|
@@ -178,10 +174,8 @@ cb_Backend_scope_drop(VALUE self,
|
|
|
178
174
|
}
|
|
179
175
|
return ULL2NUM(resp.uid);
|
|
180
176
|
} catch (const std::system_error& se) {
|
|
181
|
-
|
|
177
|
+
throw ruby_exception(cb_map_error_code(
|
|
182
178
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
183
|
-
} catch (const ruby_exception& e) {
|
|
184
|
-
rb_exc_raise(e.exception_object());
|
|
185
179
|
}
|
|
186
180
|
return Qnil;
|
|
187
181
|
}
|
|
@@ -197,14 +191,14 @@ cb_Backend_collection_create(VALUE self,
|
|
|
197
191
|
{
|
|
198
192
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
199
193
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
194
|
+
cb_check_type(bucket_name, T_STRING);
|
|
195
|
+
cb_check_type(scope_name, T_STRING);
|
|
196
|
+
cb_check_type(collection_name, T_STRING);
|
|
203
197
|
if (!NIL_P(settings)) {
|
|
204
|
-
|
|
198
|
+
cb_check_type(settings, T_HASH);
|
|
205
199
|
}
|
|
206
200
|
if (!NIL_P(options)) {
|
|
207
|
-
|
|
201
|
+
cb_check_type(options, T_HASH);
|
|
208
202
|
}
|
|
209
203
|
|
|
210
204
|
try {
|
|
@@ -217,18 +211,18 @@ cb_Backend_collection_create(VALUE self,
|
|
|
217
211
|
if (VALUE max_expiry = rb_hash_aref(settings, rb_id2sym(rb_intern("max_expiry")));
|
|
218
212
|
!NIL_P(max_expiry)) {
|
|
219
213
|
if (TYPE(max_expiry) == T_FIXNUM) {
|
|
220
|
-
req.max_expiry =
|
|
214
|
+
req.max_expiry = cb_num2int(max_expiry);
|
|
221
215
|
if (req.max_expiry < -1) {
|
|
222
216
|
throw ruby_exception(
|
|
223
217
|
exc_invalid_argument(),
|
|
224
|
-
|
|
218
|
+
cb_sprintf(
|
|
225
219
|
"collection max expiry must be greater than or equal to -1, given %+" PRIsVALUE,
|
|
226
220
|
max_expiry));
|
|
227
221
|
}
|
|
228
222
|
} else {
|
|
229
223
|
throw ruby_exception(
|
|
230
224
|
rb_eArgError,
|
|
231
|
-
|
|
225
|
+
cb_sprintf("collection max expiry must be an Integer, given %+" PRIsVALUE, max_expiry));
|
|
232
226
|
}
|
|
233
227
|
}
|
|
234
228
|
if (VALUE history = rb_hash_aref(settings, rb_id2sym(rb_intern("history")));
|
|
@@ -254,10 +248,8 @@ cb_Backend_collection_create(VALUE self,
|
|
|
254
248
|
}
|
|
255
249
|
return ULL2NUM(resp.uid);
|
|
256
250
|
} catch (const std::system_error& se) {
|
|
257
|
-
|
|
251
|
+
throw ruby_exception(cb_map_error_code(
|
|
258
252
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
259
|
-
} catch (const ruby_exception& e) {
|
|
260
|
-
rb_exc_raise(e.exception_object());
|
|
261
253
|
}
|
|
262
254
|
return Qnil;
|
|
263
255
|
}
|
|
@@ -273,14 +265,14 @@ cb_Backend_collection_update(VALUE self,
|
|
|
273
265
|
{
|
|
274
266
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
275
267
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
268
|
+
cb_check_type(bucket_name, T_STRING);
|
|
269
|
+
cb_check_type(scope_name, T_STRING);
|
|
270
|
+
cb_check_type(collection_name, T_STRING);
|
|
279
271
|
if (!NIL_P(settings)) {
|
|
280
|
-
|
|
272
|
+
cb_check_type(settings, T_HASH);
|
|
281
273
|
}
|
|
282
274
|
if (!NIL_P(options)) {
|
|
283
|
-
|
|
275
|
+
cb_check_type(options, T_HASH);
|
|
284
276
|
}
|
|
285
277
|
|
|
286
278
|
try {
|
|
@@ -293,18 +285,18 @@ cb_Backend_collection_update(VALUE self,
|
|
|
293
285
|
if (VALUE max_expiry = rb_hash_aref(settings, rb_id2sym(rb_intern("max_expiry")));
|
|
294
286
|
!NIL_P(max_expiry)) {
|
|
295
287
|
if (TYPE(max_expiry) == T_FIXNUM) {
|
|
296
|
-
req.max_expiry =
|
|
288
|
+
req.max_expiry = cb_num2int(max_expiry);
|
|
297
289
|
if (req.max_expiry < -1) {
|
|
298
290
|
throw ruby_exception(
|
|
299
291
|
exc_invalid_argument(),
|
|
300
|
-
|
|
292
|
+
cb_sprintf(
|
|
301
293
|
"collection max expiry must be greater than or equal to -1, given %+" PRIsVALUE,
|
|
302
294
|
max_expiry));
|
|
303
295
|
}
|
|
304
296
|
} else {
|
|
305
297
|
throw ruby_exception(
|
|
306
298
|
rb_eArgError,
|
|
307
|
-
|
|
299
|
+
cb_sprintf("collection max expiry must be an Integer, given %+" PRIsVALUE, max_expiry));
|
|
308
300
|
}
|
|
309
301
|
}
|
|
310
302
|
if (VALUE history = rb_hash_aref(settings, rb_id2sym(rb_intern("history")));
|
|
@@ -330,10 +322,8 @@ cb_Backend_collection_update(VALUE self,
|
|
|
330
322
|
}
|
|
331
323
|
return ULL2NUM(resp.uid);
|
|
332
324
|
} catch (const std::system_error& se) {
|
|
333
|
-
|
|
325
|
+
throw ruby_exception(cb_map_error_code(
|
|
334
326
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
335
|
-
} catch (const ruby_exception& e) {
|
|
336
|
-
rb_exc_raise(e.exception_object());
|
|
337
327
|
}
|
|
338
328
|
return Qnil;
|
|
339
329
|
}
|
|
@@ -348,11 +338,11 @@ cb_Backend_collection_drop(VALUE self,
|
|
|
348
338
|
{
|
|
349
339
|
auto cluster = cb_backend_to_core_api_cluster(self);
|
|
350
340
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
341
|
+
cb_check_type(bucket_name, T_STRING);
|
|
342
|
+
cb_check_type(scope_name, T_STRING);
|
|
343
|
+
cb_check_type(collection_name, T_STRING);
|
|
354
344
|
if (!NIL_P(options)) {
|
|
355
|
-
|
|
345
|
+
cb_check_type(options, T_HASH);
|
|
356
346
|
}
|
|
357
347
|
|
|
358
348
|
try {
|
|
@@ -379,10 +369,8 @@ cb_Backend_collection_drop(VALUE self,
|
|
|
379
369
|
|
|
380
370
|
return ULL2NUM(resp.uid);
|
|
381
371
|
} catch (const std::system_error& se) {
|
|
382
|
-
|
|
372
|
+
throw ruby_exception(cb_map_error_code(
|
|
383
373
|
se.code(), fmt::format("failed to perform {}: {}", __func__, se.what()), false));
|
|
384
|
-
} catch (const ruby_exception& e) {
|
|
385
|
-
rb_exc_raise(e.exception_object());
|
|
386
374
|
}
|
|
387
375
|
return Qnil;
|
|
388
376
|
}
|
|
@@ -391,11 +379,13 @@ cb_Backend_collection_drop(VALUE self,
|
|
|
391
379
|
void
|
|
392
380
|
init_collections(VALUE cBackend)
|
|
393
381
|
{
|
|
394
|
-
rb_define_method(cBackend, "scope_get_all", cb_Backend_scope_get_all, 3);
|
|
395
|
-
rb_define_method(cBackend, "scope_create", cb_Backend_scope_create, 4);
|
|
396
|
-
rb_define_method(cBackend, "scope_drop", cb_Backend_scope_drop, 4);
|
|
397
|
-
rb_define_method(
|
|
398
|
-
|
|
399
|
-
rb_define_method(
|
|
382
|
+
rb_define_method(cBackend, "scope_get_all", cb_method<cb_Backend_scope_get_all>::invoke, 3);
|
|
383
|
+
rb_define_method(cBackend, "scope_create", cb_method<cb_Backend_scope_create>::invoke, 4);
|
|
384
|
+
rb_define_method(cBackend, "scope_drop", cb_method<cb_Backend_scope_drop>::invoke, 4);
|
|
385
|
+
rb_define_method(
|
|
386
|
+
cBackend, "collection_create", cb_method<cb_Backend_collection_create>::invoke, 6);
|
|
387
|
+
rb_define_method(
|
|
388
|
+
cBackend, "collection_update", cb_method<cb_Backend_collection_update>::invoke, 6);
|
|
389
|
+
rb_define_method(cBackend, "collection_drop", cb_method<cb_Backend_collection_drop>::invoke, 5);
|
|
400
390
|
}
|
|
401
391
|
} // namespace couchbase::ruby
|