couchbase 4.2.8-dev.1 → 4.2.9
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.
- package/CMakeLists.txt +1 -1
- package/deps/couchbase-cxx-cache/mozilla-ca-bundle.crt +139 -56
- package/deps/couchbase-cxx-cache/mozilla-ca-bundle.sha256 +1 -1
- package/deps/couchbase-cxx-client/CMakeLists.txt +397 -424
- package/deps/couchbase-cxx-client/core/agent_config.hxx +1 -1
- package/deps/couchbase-cxx-client/core/agent_group.cxx +0 -1
- package/deps/couchbase-cxx-client/core/agent_group.hxx +9 -0
- package/deps/couchbase-cxx-client/core/agent_group_config.hxx +1 -1
- package/deps/couchbase-cxx-client/core/bucket.cxx +22 -8
- package/deps/couchbase-cxx-client/core/bucket.hxx +3 -1
- package/deps/couchbase-cxx-client/core/cluster.cxx +1453 -108
- package/deps/couchbase-cxx-client/core/cluster.hxx +183 -473
- package/deps/couchbase-cxx-client/core/cluster_agent_config.hxx +1 -1
- package/deps/couchbase-cxx-client/core/cluster_options.cxx +12 -2
- package/deps/couchbase-cxx-client/core/cluster_options.hxx +9 -8
- package/deps/couchbase-cxx-client/core/config_profiles.cxx +2 -2
- package/deps/couchbase-cxx-client/core/config_profiles.hxx +1 -1
- package/deps/couchbase-cxx-client/core/core_sdk_shim.cxx +1 -2
- package/deps/couchbase-cxx-client/core/core_sdk_shim.hxx +3 -2
- package/deps/couchbase-cxx-client/core/diagnostics.hxx +0 -1
- package/deps/couchbase-cxx-client/core/dispatcher.cxx +2 -2
- package/deps/couchbase-cxx-client/core/impl/analytics.cxx +38 -76
- package/deps/couchbase-cxx-client/core/impl/analytics.hxx +40 -0
- package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +820 -0
- package/deps/couchbase-cxx-client/core/impl/binary_collection.cxx +403 -0
- package/deps/couchbase-cxx-client/core/impl/bucket.cxx +78 -0
- package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +433 -0
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +226 -44
- package/deps/couchbase-cxx-client/core/impl/collection.cxx +1384 -0
- package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +306 -0
- package/deps/couchbase-cxx-client/core/impl/configuration_profiles_registry.cxx +3 -1
- package/deps/couchbase-cxx-client/core/impl/dns_srv_tracker.cxx +2 -0
- package/deps/couchbase-cxx-client/core/{operations/mcbp_noop.cxx → impl/doc_id_query.cxx} +19 -15
- package/deps/couchbase-cxx-client/core/impl/key_value_error_category.cxx +4 -2
- package/deps/couchbase-cxx-client/core/impl/lookup_in_all_replicas.hxx +0 -10
- package/deps/couchbase-cxx-client/core/impl/lookup_in_any_replica.hxx +0 -10
- package/deps/couchbase-cxx-client/core/impl/observe_poll.cxx +24 -17
- package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/query.cxx +45 -68
- package/deps/couchbase-cxx-client/core/impl/query.hxx +34 -0
- package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +628 -0
- package/deps/couchbase-cxx-client/core/impl/scope.cxx +172 -0
- package/deps/couchbase-cxx-client/core/impl/search.cxx +12 -61
- package/deps/couchbase-cxx-client/core/impl/search.hxx +37 -0
- package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +469 -0
- package/deps/couchbase-cxx-client/core/impl/search_row_location.cxx +12 -0
- package/deps/couchbase-cxx-client/core/impl/search_sort_geo_distance.cxx +87 -0
- package/deps/couchbase-cxx-client/core/impl/with_legacy_durability.hxx +23 -25
- package/deps/couchbase-cxx-client/core/io/dns_config.cxx +28 -0
- package/deps/couchbase-cxx-client/core/io/dns_config.hxx +6 -25
- package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +9 -1
- package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +1 -1
- package/deps/couchbase-cxx-client/core/io/mcbp_message.hxx +3 -2
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +51 -21
- package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +2 -1
- package/deps/couchbase-cxx-client/core/logger/logger.hxx +4 -4
- package/deps/couchbase-cxx-client/core/management/bucket_settings.hxx +1 -1
- package/deps/couchbase-cxx-client/core/mcbp/packet.cxx +1 -1
- package/deps/couchbase-cxx-client/core/mcbp/queue_callback.hxx +1 -1
- package/deps/couchbase-cxx-client/core/meta/features.hxx +28 -0
- package/deps/couchbase-cxx-client/core/operations/document_query.cxx +17 -1
- package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_create.cxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/change_password.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/error_utils.cxx +6 -5
- package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get_all.cxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +2 -2
- package/deps/couchbase-cxx-client/core/operations/management/query_index_create.cxx +4 -1
- package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.cxx +4 -1
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.cxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.cxx +4 -4
- package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +4 -4
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations.hxx +0 -1
- package/deps/couchbase-cxx-client/core/operations_fwd.hxx +260 -0
- package/deps/couchbase-cxx-client/core/origin.cxx +146 -5
- package/deps/couchbase-cxx-client/core/origin.hxx +30 -140
- package/deps/couchbase-cxx-client/core/protocol/cmd_cluster_map_change_notification.hxx +3 -3
- package/deps/couchbase-cxx-client/core/protocol/cmd_hello.hxx +5 -0
- package/deps/couchbase-cxx-client/core/protocol/cmd_observe_seqno.hxx +4 -4
- package/deps/couchbase-cxx-client/core/protocol/hello_feature.hxx +6 -0
- package/deps/couchbase-cxx-client/core/protocol/hello_feature_fmt.hxx +3 -0
- package/deps/couchbase-cxx-client/core/protocol/status.cxx +6 -0
- package/deps/couchbase-cxx-client/core/protocol/status.hxx +1 -0
- package/deps/couchbase-cxx-client/core/query_context.hxx +11 -7
- package/deps/couchbase-cxx-client/core/range_scan_orchestrator.cxx +1 -1
- package/deps/couchbase-cxx-client/core/topology/configuration.cxx +23 -0
- package/deps/couchbase-cxx-client/core/topology/configuration.hxx +8 -12
- package/deps/couchbase-cxx-client/core/topology/configuration_fmt.hxx +3 -3
- package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +2 -0
- package/deps/couchbase-cxx-client/core/topology/error_map.hxx +2 -2
- package/deps/couchbase-cxx-client/core/topology/error_map_json.hxx +4 -0
- package/deps/couchbase-cxx-client/core/transactions/active_transaction_record.cxx +58 -0
- package/deps/couchbase-cxx-client/core/transactions/active_transaction_record.hxx +5 -40
- package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.cxx +30 -0
- package/deps/couchbase-cxx-client/core/transactions/atr_cleanup_entry.cxx +18 -18
- package/deps/couchbase-cxx-client/core/transactions/attempt_context.cxx +36 -0
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +39 -41
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +2 -2
- package/deps/couchbase-cxx-client/core/transactions/internal/atr_cleanup_entry.hxx +3 -1
- package/deps/couchbase-cxx-client/core/transactions/internal/atr_entry.hxx +2 -0
- package/deps/couchbase-cxx-client/core/transactions/internal/doc_record.cxx +32 -0
- package/deps/couchbase-cxx-client/core/transactions/internal/doc_record.hxx +4 -30
- package/deps/couchbase-cxx-client/core/transactions/internal/doc_record_fmt.hxx +41 -0
- package/deps/couchbase-cxx-client/core/transactions/internal/logging.hxx +17 -15
- package/deps/couchbase-cxx-client/core/transactions/internal/transaction_context.hxx +1 -1
- package/deps/couchbase-cxx-client/core/transactions/internal/transactions_cleanup.hxx +4 -4
- package/deps/couchbase-cxx-client/core/transactions/internal/utils.hxx +1 -13
- package/deps/couchbase-cxx-client/core/transactions/result.hxx +0 -26
- package/deps/couchbase-cxx-client/core/transactions/result_fmt.hxx +46 -0
- package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +16 -14
- package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +6 -6
- package/deps/couchbase-cxx-client/core/transactions/transaction_keyspace.cxx +48 -0
- package/deps/couchbase-cxx-client/core/transactions/transaction_links.hxx +1 -0
- package/deps/couchbase-cxx-client/core/transactions/transaction_options.cxx +61 -4
- package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +9 -8
- package/deps/couchbase-cxx-client/core/transactions/transactions_cleanup.cxx +9 -16
- package/deps/couchbase-cxx-client/core/transactions/transactions_config.cxx +7 -6
- package/deps/couchbase-cxx-client/core/transactions.hxx +6 -5
- package/deps/couchbase-cxx-client/core/utils/join_strings.hxx +4 -3
- package/deps/couchbase-cxx-client/core/utils/keyspace.hxx +4 -4
- package/deps/couchbase-cxx-client/couchbase/allow_querying_search_index_options.hxx +44 -0
- package/deps/couchbase-cxx-client/couchbase/analytics_index_manager.hxx +463 -0
- package/deps/couchbase-cxx-client/couchbase/analyze_document_options.hxx +44 -0
- package/deps/couchbase-cxx-client/couchbase/append_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/behavior_options.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/binary_collection.hxx +19 -115
- package/deps/couchbase-cxx-client/couchbase/bucket.hxx +13 -30
- package/deps/couchbase-cxx-client/couchbase/bucket_manager.hxx +8 -7
- package/deps/couchbase-cxx-client/couchbase/build_query_index_options.hxx +0 -1
- package/deps/couchbase-cxx-client/couchbase/cluster.hxx +41 -73
- package/deps/couchbase-cxx-client/couchbase/cluster_options.hxx +1 -27
- package/deps/couchbase-cxx-client/couchbase/collection.hxx +176 -386
- package/deps/couchbase-cxx-client/couchbase/collection_manager.hxx +8 -9
- package/deps/couchbase-cxx-client/couchbase/collection_query_index_manager.hxx +21 -24
- package/deps/couchbase-cxx-client/couchbase/connect_link_analytics_options.hxx +116 -0
- package/deps/couchbase-cxx-client/couchbase/create_bucket_options.hxx +3 -3
- package/deps/couchbase-cxx-client/couchbase/create_collection_options.hxx +3 -2
- package/deps/couchbase-cxx-client/couchbase/create_dataset_analytics_options.hxx +120 -0
- package/deps/couchbase-cxx-client/couchbase/create_dataverse_analytics_options.hxx +85 -0
- package/deps/couchbase-cxx-client/couchbase/create_index_analytics_options.hxx +103 -0
- package/deps/couchbase-cxx-client/couchbase/create_link_analytics_options.hxx +63 -0
- package/deps/couchbase-cxx-client/couchbase/decrement_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/disallow_querying_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/disconnect_link_analytics_options.hxx +105 -0
- package/deps/couchbase-cxx-client/couchbase/drop_dataset_analytics_options.hxx +103 -0
- package/deps/couchbase-cxx-client/couchbase/drop_dataverse_analytics_options.hxx +84 -0
- package/deps/couchbase-cxx-client/couchbase/drop_index_analytics_options.hxx +103 -0
- package/deps/couchbase-cxx-client/couchbase/drop_link_analytics_options.hxx +63 -0
- package/deps/couchbase-cxx-client/couchbase/drop_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/error_codes.hxx +22 -1
- package/deps/couchbase-cxx-client/couchbase/exists_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/fmt/key_value_error_map_attribute.hxx +6 -0
- package/deps/couchbase-cxx-client/couchbase/fmt/key_value_status_code.hxx +3 -0
- package/deps/couchbase-cxx-client/couchbase/fmt/transaction_keyspace.hxx +37 -0
- package/deps/couchbase-cxx-client/couchbase/freeze_plan_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/get_all_datasets_analytics_options.hxx +66 -0
- package/deps/couchbase-cxx-client/couchbase/get_all_indexes_analytics_options.hxx +65 -0
- package/deps/couchbase-cxx-client/couchbase/get_all_query_indexes_options.hxx +1 -4
- package/deps/couchbase-cxx-client/couchbase/get_all_replicas_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/get_all_search_indexes_options.hxx +45 -0
- package/deps/couchbase-cxx-client/couchbase/get_and_lock_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/get_and_touch_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/get_any_replica_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/get_indexed_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/get_links_analytics_options.hxx +121 -0
- package/deps/couchbase-cxx-client/couchbase/get_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/get_pending_mutations_analytics_options.hxx +67 -0
- package/deps/couchbase-cxx-client/couchbase/get_search_index_options.hxx +44 -0
- package/deps/couchbase-cxx-client/couchbase/increment_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/insert_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/key_value_error_map_attribute.hxx +12 -0
- package/deps/couchbase-cxx-client/couchbase/key_value_status_code.hxx +1 -0
- package/deps/couchbase-cxx-client/couchbase/lookup_in_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/management/analytics_dataset.hxx +48 -0
- package/deps/couchbase-cxx-client/couchbase/management/analytics_index.hxx +48 -0
- package/deps/couchbase-cxx-client/couchbase/management/analytics_link.hxx +239 -0
- package/deps/couchbase-cxx-client/couchbase/management/query_index.hxx +3 -3
- package/deps/couchbase-cxx-client/couchbase/management/search_index.hxx +40 -0
- package/deps/couchbase-cxx-client/couchbase/manager_error_context.hxx +0 -1
- package/deps/couchbase-cxx-client/couchbase/mutate_in_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/network_options.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/pause_ingest_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/phrase_query.hxx +19 -0
- package/deps/couchbase-cxx-client/couchbase/prepend_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/query_index_manager.hxx +99 -20
- package/deps/couchbase-cxx-client/couchbase/query_options.hxx +0 -21
- package/deps/couchbase-cxx-client/couchbase/remove_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/replace_link_analytics_options.hxx +63 -0
- package/deps/couchbase-cxx-client/couchbase/replace_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/resume_ingest_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/scope.hxx +13 -45
- package/deps/couchbase-cxx-client/couchbase/search_facet_result.hxx +1 -7
- package/deps/couchbase-cxx-client/couchbase/search_geo_distance_units.hxx +26 -0
- package/deps/couchbase-cxx-client/couchbase/search_index_manager.hxx +292 -0
- package/deps/couchbase-cxx-client/couchbase/search_row_location.hxx +10 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_geo_distance.hxx +84 -0
- package/deps/couchbase-cxx-client/couchbase/security_options.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/touch_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/tracing/request_tracer.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/transactions/async_attempt_context.hxx +10 -7
- package/deps/couchbase-cxx-client/couchbase/transactions/attempt_context.hxx +10 -10
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_keyspace.hxx +8 -58
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_options.hxx +28 -70
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_query_options.hxx +7 -2
- package/deps/couchbase-cxx-client/couchbase/transactions/transactions_cleanup_config.hxx +2 -1
- package/deps/couchbase-cxx-client/couchbase/transactions/transactions_config.hxx +11 -38
- package/deps/couchbase-cxx-client/couchbase/unfreeze_plan_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/unlock_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/upsert_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/upsert_search_index_options.hxx +41 -0
- package/dist/binding.d.ts +7 -9
- package/dist/bindingutilities.js +2 -0
- package/dist/collection.js +3 -3
- package/dist/errors.d.ts +9 -0
- package/dist/errors.js +14 -2
- package/dist/transactions.d.ts +2 -0
- package/dist/transactions.js +2 -3
- package/dist/usermanager.js +1 -1
- package/package.json +7 -7
- package/src/binding.cpp +1 -0
- package/src/connection.cpp +12 -9
- package/src/connection.hpp +3 -3
- package/src/connection_autogen.cpp +7 -5
- package/src/constants.cpp +3 -0
- package/src/instance.cpp +2 -2
- package/src/instance.hpp +1 -1
- package/src/jstocbpp_autogen.hpp +21 -38
- package/src/jstocbpp_basic.hpp +2 -0
- package/src/jstocbpp_errors.hpp +1 -0
- package/src/jstocbpp_transactions.hpp +6 -22
- package/src/mutationtoken.hpp +1 -0
- package/tools/gen-bindings-json.py +39 -16
- package/deps/couchbase-cxx-cache/spdlog/66ab2619a0014319471759c03e2de1af6bda14de/spdlog/example/CMakeLists.txt +0 -23
- package/deps/couchbase-cxx-cache/spdlog/66ab2619a0014319471759c03e2de1af6bda14de/spdlog/example/example.cpp +0 -398
- package/deps/couchbase-cxx-client/core/impl/append.cxx +0 -87
- package/deps/couchbase-cxx-client/core/impl/build_deferred_query_indexes.cxx +0 -157
- package/deps/couchbase-cxx-client/core/impl/create_bucket.cxx +0 -158
- package/deps/couchbase-cxx-client/core/impl/create_collection.cxx +0 -83
- package/deps/couchbase-cxx-client/core/impl/create_query_index.cxx +0 -232
- package/deps/couchbase-cxx-client/core/impl/create_scope.cxx +0 -69
- package/deps/couchbase-cxx-client/core/impl/decrement.cxx +0 -96
- package/deps/couchbase-cxx-client/core/impl/drop_bucket.cxx +0 -66
- package/deps/couchbase-cxx-client/core/impl/drop_collection.cxx +0 -76
- package/deps/couchbase-cxx-client/core/impl/drop_query_index.cxx +0 -187
- package/deps/couchbase-cxx-client/core/impl/drop_scope.cxx +0 -68
- package/deps/couchbase-cxx-client/core/impl/exists.cxx +0 -47
- package/deps/couchbase-cxx-client/core/impl/flush_bucket.cxx +0 -66
- package/deps/couchbase-cxx-client/core/impl/get.cxx +0 -68
- package/deps/couchbase-cxx-client/core/impl/get_all_buckets.cxx +0 -178
- package/deps/couchbase-cxx-client/core/impl/get_all_query_indexes.cxx +0 -106
- package/deps/couchbase-cxx-client/core/impl/get_all_replicas.cxx +0 -145
- package/deps/couchbase-cxx-client/core/impl/get_all_scopes.cxx +0 -94
- package/deps/couchbase-cxx-client/core/impl/get_and_lock.cxx +0 -49
- package/deps/couchbase-cxx-client/core/impl/get_and_touch.cxx +0 -49
- package/deps/couchbase-cxx-client/core/impl/get_any_replica.cxx +0 -134
- package/deps/couchbase-cxx-client/core/impl/get_bucket.cxx +0 -168
- package/deps/couchbase-cxx-client/core/impl/increment.cxx +0 -96
- package/deps/couchbase-cxx-client/core/impl/insert.cxx +0 -90
- package/deps/couchbase-cxx-client/core/impl/lookup_in.cxx +0 -69
- package/deps/couchbase-cxx-client/core/impl/lookup_in_all_replicas.cxx +0 -178
- package/deps/couchbase-cxx-client/core/impl/lookup_in_any_replica.cxx +0 -169
- package/deps/couchbase-cxx-client/core/impl/mutate_in.cxx +0 -125
- package/deps/couchbase-cxx-client/core/impl/prepend.cxx +0 -87
- package/deps/couchbase-cxx-client/core/impl/remove.cxx +0 -86
- package/deps/couchbase-cxx-client/core/impl/replace.cxx +0 -102
- package/deps/couchbase-cxx-client/core/impl/touch.cxx +0 -49
- package/deps/couchbase-cxx-client/core/impl/unlock.cxx +0 -47
- package/deps/couchbase-cxx-client/core/impl/update_bucket.cxx +0 -133
- package/deps/couchbase-cxx-client/core/impl/update_collection.cxx +0 -83
- package/deps/couchbase-cxx-client/core/impl/upsert.cxx +0 -100
- package/deps/couchbase-cxx-client/core/impl/watch_query_indexes.cxx +0 -196
- package/deps/couchbase-cxx-client/core/operations/mcbp_noop.hxx +0 -49
- /package/deps/couchbase-cxx-client/core/impl/{streaming_json_lexter_error_category.cxx → streaming_json_lexer_error_category.cxx} +0 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
#pragma once
|
|
19
|
+
|
|
20
|
+
namespace couchbase::core
|
|
21
|
+
{
|
|
22
|
+
namespace management::analytics
|
|
23
|
+
{
|
|
24
|
+
struct azure_blob_external_link;
|
|
25
|
+
struct couchbase_remote_link;
|
|
26
|
+
struct s3_external_link;
|
|
27
|
+
} // namespace management::analytics
|
|
28
|
+
|
|
29
|
+
namespace impl
|
|
30
|
+
{
|
|
31
|
+
struct get_replica_request;
|
|
32
|
+
struct get_replica_response;
|
|
33
|
+
struct lookup_in_replica_request;
|
|
34
|
+
struct lookup_in_replica_response;
|
|
35
|
+
struct observe_seqno_request;
|
|
36
|
+
struct observe_seqno_response;
|
|
37
|
+
template<typename mutation_request>
|
|
38
|
+
struct with_legacy_durability;
|
|
39
|
+
} // namespace impl
|
|
40
|
+
|
|
41
|
+
namespace operations
|
|
42
|
+
{
|
|
43
|
+
struct analytics_request;
|
|
44
|
+
struct analytics_response;
|
|
45
|
+
struct append_request;
|
|
46
|
+
struct append_response;
|
|
47
|
+
struct decrement_request;
|
|
48
|
+
struct decrement_response;
|
|
49
|
+
struct exists_request;
|
|
50
|
+
struct exists_response;
|
|
51
|
+
struct get_request;
|
|
52
|
+
struct get_response;
|
|
53
|
+
struct get_all_replicas_request;
|
|
54
|
+
struct get_all_replicas_response;
|
|
55
|
+
struct get_and_lock_request;
|
|
56
|
+
struct get_and_lock_response;
|
|
57
|
+
struct get_and_touch_request;
|
|
58
|
+
struct get_and_touch_response;
|
|
59
|
+
struct get_any_replica_request;
|
|
60
|
+
struct get_any_replica_response;
|
|
61
|
+
struct get_projected_request;
|
|
62
|
+
struct get_projected_response;
|
|
63
|
+
struct increment_request;
|
|
64
|
+
struct increment_response;
|
|
65
|
+
struct insert_request;
|
|
66
|
+
struct insert_response;
|
|
67
|
+
struct lookup_in_request;
|
|
68
|
+
struct lookup_in_response;
|
|
69
|
+
struct lookup_in_any_replica_request;
|
|
70
|
+
struct lookup_in_any_replica_response;
|
|
71
|
+
struct lookup_in_all_replicas_request;
|
|
72
|
+
struct lookup_in_all_replicas_response;
|
|
73
|
+
struct mutate_in_request;
|
|
74
|
+
struct mutate_in_response;
|
|
75
|
+
struct prepend_request;
|
|
76
|
+
struct prepend_response;
|
|
77
|
+
struct query_request;
|
|
78
|
+
struct query_response;
|
|
79
|
+
struct remove_request;
|
|
80
|
+
struct remove_response;
|
|
81
|
+
struct replace_request;
|
|
82
|
+
struct replace_response;
|
|
83
|
+
struct search_request;
|
|
84
|
+
struct search_response;
|
|
85
|
+
struct touch_request;
|
|
86
|
+
struct touch_response;
|
|
87
|
+
struct unlock_request;
|
|
88
|
+
struct unlock_response;
|
|
89
|
+
struct upsert_request;
|
|
90
|
+
struct upsert_response;
|
|
91
|
+
struct document_view_request;
|
|
92
|
+
struct document_view_response;
|
|
93
|
+
struct http_noop_request;
|
|
94
|
+
struct http_noop_response;
|
|
95
|
+
|
|
96
|
+
using append_request_with_legacy_durability = impl::with_legacy_durability<append_request>;
|
|
97
|
+
using decrement_request_with_legacy_durability = impl::with_legacy_durability<decrement_request>;
|
|
98
|
+
using increment_request_with_legacy_durability = impl::with_legacy_durability<increment_request>;
|
|
99
|
+
using insert_request_with_legacy_durability = impl::with_legacy_durability<insert_request>;
|
|
100
|
+
using mutate_in_request_with_legacy_durability = impl::with_legacy_durability<mutate_in_request>;
|
|
101
|
+
using prepend_request_with_legacy_durability = impl::with_legacy_durability<prepend_request>;
|
|
102
|
+
using remove_request_with_legacy_durability = impl::with_legacy_durability<remove_request>;
|
|
103
|
+
using replace_request_with_legacy_durability = impl::with_legacy_durability<replace_request>;
|
|
104
|
+
using upsert_request_with_legacy_durability = impl::with_legacy_durability<upsert_request>;
|
|
105
|
+
|
|
106
|
+
namespace management
|
|
107
|
+
{
|
|
108
|
+
struct analytics_dataset_create_request;
|
|
109
|
+
struct analytics_dataset_create_response;
|
|
110
|
+
struct analytics_dataset_drop_request;
|
|
111
|
+
struct analytics_dataset_drop_response;
|
|
112
|
+
struct analytics_dataset_get_all_request;
|
|
113
|
+
struct analytics_dataset_get_all_response;
|
|
114
|
+
struct analytics_dataverse_create_request;
|
|
115
|
+
struct analytics_dataverse_create_response;
|
|
116
|
+
struct analytics_dataverse_drop_request;
|
|
117
|
+
struct analytics_dataverse_drop_response;
|
|
118
|
+
struct analytics_get_pending_mutations_request;
|
|
119
|
+
struct analytics_get_pending_mutations_response;
|
|
120
|
+
struct analytics_index_create_request;
|
|
121
|
+
struct analytics_index_create_response;
|
|
122
|
+
struct analytics_index_drop_request;
|
|
123
|
+
struct analytics_index_drop_response;
|
|
124
|
+
struct analytics_index_get_all_request;
|
|
125
|
+
struct analytics_index_get_all_response;
|
|
126
|
+
struct analytics_link_connect_request;
|
|
127
|
+
struct analytics_link_connect_response;
|
|
128
|
+
template<typename analytics_link_type>
|
|
129
|
+
struct analytics_link_create_request;
|
|
130
|
+
struct analytics_link_create_response;
|
|
131
|
+
struct analytics_link_disconnect_request;
|
|
132
|
+
struct analytics_link_disconnect_response;
|
|
133
|
+
struct analytics_link_drop_request;
|
|
134
|
+
struct analytics_link_drop_response;
|
|
135
|
+
struct analytics_link_get_all_request;
|
|
136
|
+
struct analytics_link_get_all_response;
|
|
137
|
+
template<typename analytics_link_type>
|
|
138
|
+
struct analytics_link_replace_request;
|
|
139
|
+
struct analytics_link_replace_response;
|
|
140
|
+
struct bucket_create_request;
|
|
141
|
+
struct bucket_create_response;
|
|
142
|
+
struct bucket_drop_request;
|
|
143
|
+
struct bucket_drop_response;
|
|
144
|
+
struct bucket_flush_request;
|
|
145
|
+
struct bucket_flush_response;
|
|
146
|
+
struct bucket_get_request;
|
|
147
|
+
struct bucket_get_response;
|
|
148
|
+
struct bucket_get_all_request;
|
|
149
|
+
struct bucket_get_all_response;
|
|
150
|
+
struct bucket_update_request;
|
|
151
|
+
struct bucket_update_response;
|
|
152
|
+
struct cluster_developer_preview_enable_request;
|
|
153
|
+
struct cluster_developer_preview_enable_response;
|
|
154
|
+
struct collection_create_request;
|
|
155
|
+
struct collection_create_response;
|
|
156
|
+
struct collection_drop_request;
|
|
157
|
+
struct collection_drop_response;
|
|
158
|
+
struct collection_update_request;
|
|
159
|
+
struct collection_update_response;
|
|
160
|
+
struct collections_manifest_get_request;
|
|
161
|
+
struct collections_manifest_get_response;
|
|
162
|
+
struct scope_create_request;
|
|
163
|
+
struct scope_create_response;
|
|
164
|
+
struct scope_drop_request;
|
|
165
|
+
struct scope_drop_response;
|
|
166
|
+
struct scope_get_all_request;
|
|
167
|
+
struct scope_get_all_response;
|
|
168
|
+
struct eventing_deploy_function_request;
|
|
169
|
+
struct eventing_deploy_function_response;
|
|
170
|
+
struct eventing_drop_function_request;
|
|
171
|
+
struct eventing_drop_function_response;
|
|
172
|
+
struct eventing_get_all_functions_request;
|
|
173
|
+
struct eventing_get_all_functions_response;
|
|
174
|
+
struct eventing_get_function_request;
|
|
175
|
+
struct eventing_get_function_response;
|
|
176
|
+
struct eventing_get_status_request;
|
|
177
|
+
struct eventing_get_status_response;
|
|
178
|
+
struct eventing_pause_function_request;
|
|
179
|
+
struct eventing_pause_function_response;
|
|
180
|
+
struct eventing_resume_function_request;
|
|
181
|
+
struct eventing_resume_function_response;
|
|
182
|
+
struct eventing_undeploy_function_request;
|
|
183
|
+
struct eventing_undeploy_function_response;
|
|
184
|
+
struct eventing_upsert_function_request;
|
|
185
|
+
struct eventing_upsert_function_response;
|
|
186
|
+
struct view_index_drop_request;
|
|
187
|
+
struct view_index_drop_response;
|
|
188
|
+
struct view_index_get_request;
|
|
189
|
+
struct view_index_get_response;
|
|
190
|
+
struct view_index_get_all_request;
|
|
191
|
+
struct view_index_get_all_response;
|
|
192
|
+
struct view_index_upsert_request;
|
|
193
|
+
struct view_index_upsert_response;
|
|
194
|
+
struct change_password_request;
|
|
195
|
+
struct change_password_response;
|
|
196
|
+
struct group_drop_request;
|
|
197
|
+
struct group_drop_response;
|
|
198
|
+
struct group_get_request;
|
|
199
|
+
struct group_get_response;
|
|
200
|
+
struct group_get_all_request;
|
|
201
|
+
struct group_get_all_response;
|
|
202
|
+
struct group_upsert_request;
|
|
203
|
+
struct group_upsert_response;
|
|
204
|
+
struct role_get_all_request;
|
|
205
|
+
struct role_get_all_response;
|
|
206
|
+
struct user_drop_request;
|
|
207
|
+
struct user_drop_response;
|
|
208
|
+
struct user_get_request;
|
|
209
|
+
struct user_get_response;
|
|
210
|
+
struct user_get_all_request;
|
|
211
|
+
struct user_get_all_response;
|
|
212
|
+
struct user_upsert_request;
|
|
213
|
+
struct user_upsert_response;
|
|
214
|
+
struct search_get_stats_request;
|
|
215
|
+
struct search_get_stats_response;
|
|
216
|
+
struct search_index_analyze_document_request;
|
|
217
|
+
struct search_index_analyze_document_response;
|
|
218
|
+
struct search_index_control_ingest_request;
|
|
219
|
+
struct search_index_control_ingest_response;
|
|
220
|
+
struct search_index_control_plan_freeze_request;
|
|
221
|
+
struct search_index_control_plan_freeze_response;
|
|
222
|
+
struct search_index_control_query_request;
|
|
223
|
+
struct search_index_control_query_response;
|
|
224
|
+
struct search_index_drop_request;
|
|
225
|
+
struct search_index_drop_response;
|
|
226
|
+
struct search_index_get_request;
|
|
227
|
+
struct search_index_get_response;
|
|
228
|
+
struct search_index_get_all_request;
|
|
229
|
+
struct search_index_get_all_response;
|
|
230
|
+
struct search_index_get_documents_count_request;
|
|
231
|
+
struct search_index_get_documents_count_response;
|
|
232
|
+
struct search_index_get_stats_request;
|
|
233
|
+
struct search_index_get_stats_response;
|
|
234
|
+
struct search_index_upsert_request;
|
|
235
|
+
struct search_index_upsert_response;
|
|
236
|
+
struct query_index_build_request;
|
|
237
|
+
struct query_index_build_response;
|
|
238
|
+
struct query_index_build_deferred_request;
|
|
239
|
+
struct query_index_build_deferred_response;
|
|
240
|
+
struct query_index_create_request;
|
|
241
|
+
struct query_index_create_response;
|
|
242
|
+
struct query_index_drop_request;
|
|
243
|
+
struct query_index_drop_response;
|
|
244
|
+
struct query_index_get_all_request;
|
|
245
|
+
struct query_index_get_all_response;
|
|
246
|
+
struct query_index_get_all_deferred_request;
|
|
247
|
+
struct query_index_get_all_deferred_response;
|
|
248
|
+
|
|
249
|
+
struct bucket_describe_request;
|
|
250
|
+
struct bucket_describe_response;
|
|
251
|
+
struct cluster_describe_request;
|
|
252
|
+
struct cluster_describe_response;
|
|
253
|
+
struct freeform_request;
|
|
254
|
+
struct freeform_response;
|
|
255
|
+
struct search_index_stats_request;
|
|
256
|
+
struct search_index_stats_response;
|
|
257
|
+
} // namespace management
|
|
258
|
+
} // namespace operations
|
|
259
|
+
|
|
260
|
+
} // namespace couchbase::core
|
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
#include "origin.hxx"
|
|
19
19
|
|
|
20
|
+
#include "core/utils/connection_string.hxx"
|
|
21
|
+
|
|
20
22
|
#include <fmt/chrono.h>
|
|
21
|
-
#include <fmt/
|
|
23
|
+
#include <fmt/core.h>
|
|
22
24
|
|
|
23
25
|
#include <tao/json.hpp>
|
|
24
26
|
|
|
@@ -166,7 +168,7 @@ struct traits<couchbase::transactions::transactions_config::built> {
|
|
|
166
168
|
static void assign(tao::json::basic_value<Traits>& v, const couchbase::transactions::transactions_config::built& o)
|
|
167
169
|
{
|
|
168
170
|
v = {
|
|
169
|
-
{ "
|
|
171
|
+
{ "timeout", o.timeout },
|
|
170
172
|
{ "durability_level", o.level },
|
|
171
173
|
{
|
|
172
174
|
"query_config",
|
|
@@ -184,9 +186,6 @@ struct traits<couchbase::transactions::transactions_config::built> {
|
|
|
184
186
|
},
|
|
185
187
|
},
|
|
186
188
|
};
|
|
187
|
-
if (const auto& p = o.kv_timeout; p.has_value()) {
|
|
188
|
-
v["key_value_timeout"] = p.value();
|
|
189
|
-
}
|
|
190
189
|
if (const auto& p = o.metadata_collection; p.has_value()) {
|
|
191
190
|
v["metadata_collection"] = {
|
|
192
191
|
{ "bucket", p.value().bucket },
|
|
@@ -267,4 +266,146 @@ origin::to_json() const -> std::string
|
|
|
267
266
|
}
|
|
268
267
|
return tao::json::to_string(json);
|
|
269
268
|
}
|
|
269
|
+
|
|
270
|
+
bool
|
|
271
|
+
cluster_credentials::uses_certificate() const
|
|
272
|
+
{
|
|
273
|
+
return !certificate_path.empty();
|
|
274
|
+
}
|
|
270
275
|
} // namespace couchbase::core
|
|
276
|
+
|
|
277
|
+
couchbase::core::origin::origin(const couchbase::core::origin& other)
|
|
278
|
+
: options_(other.options_)
|
|
279
|
+
, credentials_(other.credentials_)
|
|
280
|
+
, nodes_(other.nodes_)
|
|
281
|
+
, next_node_(nodes_.begin())
|
|
282
|
+
{
|
|
283
|
+
}
|
|
284
|
+
couchbase::core::origin::origin(couchbase::core::cluster_credentials auth,
|
|
285
|
+
const std::string& hostname,
|
|
286
|
+
std::uint16_t port,
|
|
287
|
+
couchbase::core::cluster_options options)
|
|
288
|
+
: options_(std::move(options))
|
|
289
|
+
, credentials_(std::move(auth))
|
|
290
|
+
, nodes_{ { hostname, std::to_string(port) } }
|
|
291
|
+
, next_node_(nodes_.begin())
|
|
292
|
+
{
|
|
293
|
+
}
|
|
294
|
+
couchbase::core::origin::origin(couchbase::core::cluster_credentials auth,
|
|
295
|
+
const std::string& hostname,
|
|
296
|
+
const std::string& port,
|
|
297
|
+
couchbase::core::cluster_options options)
|
|
298
|
+
: options_(std::move(options))
|
|
299
|
+
, credentials_(std::move(auth))
|
|
300
|
+
, nodes_{ { hostname, port } }
|
|
301
|
+
, next_node_(nodes_.begin())
|
|
302
|
+
{
|
|
303
|
+
}
|
|
304
|
+
couchbase::core::origin::origin(couchbase::core::cluster_credentials auth, const couchbase::core::utils::connection_string& connstr)
|
|
305
|
+
: options_(connstr.options)
|
|
306
|
+
, credentials_(std::move(auth))
|
|
307
|
+
{
|
|
308
|
+
nodes_.reserve(connstr.bootstrap_nodes.size());
|
|
309
|
+
for (const auto& node : connstr.bootstrap_nodes) {
|
|
310
|
+
nodes_.emplace_back(node.address, node.port > 0 ? std::to_string(node.port) : std::to_string(connstr.default_port));
|
|
311
|
+
}
|
|
312
|
+
next_node_ = nodes_.begin();
|
|
313
|
+
}
|
|
314
|
+
couchbase::core::origin&
|
|
315
|
+
couchbase::core::origin::operator=(const couchbase::core::origin& other)
|
|
316
|
+
{
|
|
317
|
+
if (this != &other) {
|
|
318
|
+
options_ = other.options_;
|
|
319
|
+
credentials_ = other.credentials_;
|
|
320
|
+
nodes_ = other.nodes_;
|
|
321
|
+
next_node_ = nodes_.begin();
|
|
322
|
+
exhausted_ = false;
|
|
323
|
+
}
|
|
324
|
+
return *this;
|
|
325
|
+
}
|
|
326
|
+
const std::string&
|
|
327
|
+
couchbase::core::origin::username() const
|
|
328
|
+
{
|
|
329
|
+
return credentials_.username;
|
|
330
|
+
}
|
|
331
|
+
const std::string&
|
|
332
|
+
couchbase::core::origin::password() const
|
|
333
|
+
{
|
|
334
|
+
return credentials_.password;
|
|
335
|
+
}
|
|
336
|
+
const std::string&
|
|
337
|
+
couchbase::core::origin::certificate_path() const
|
|
338
|
+
{
|
|
339
|
+
return credentials_.certificate_path;
|
|
340
|
+
}
|
|
341
|
+
const std::string&
|
|
342
|
+
couchbase::core::origin::key_path() const
|
|
343
|
+
{
|
|
344
|
+
return credentials_.key_path;
|
|
345
|
+
}
|
|
346
|
+
std::vector<std::string>
|
|
347
|
+
couchbase::core::origin::get_hostnames() const
|
|
348
|
+
{
|
|
349
|
+
std::vector<std::string> res;
|
|
350
|
+
res.reserve(nodes_.size());
|
|
351
|
+
for (const auto& [hostname, _] : nodes_) {
|
|
352
|
+
res.emplace_back(hostname);
|
|
353
|
+
}
|
|
354
|
+
return res;
|
|
355
|
+
}
|
|
356
|
+
std::vector<std::string>
|
|
357
|
+
couchbase::core::origin::get_nodes() const
|
|
358
|
+
{
|
|
359
|
+
std::vector<std::string> res;
|
|
360
|
+
res.reserve(nodes_.size());
|
|
361
|
+
for (const auto& [hostname, port] : nodes_) {
|
|
362
|
+
res.emplace_back(fmt::format("\"{}:{}\"", hostname, port));
|
|
363
|
+
}
|
|
364
|
+
return res;
|
|
365
|
+
}
|
|
366
|
+
void
|
|
367
|
+
couchbase::core::origin::set_nodes(couchbase::core::origin::node_list nodes)
|
|
368
|
+
{
|
|
369
|
+
nodes_ = std::move(nodes);
|
|
370
|
+
next_node_ = nodes_.begin();
|
|
371
|
+
exhausted_ = false;
|
|
372
|
+
}
|
|
373
|
+
std::pair<std::string, std::string>
|
|
374
|
+
couchbase::core::origin::next_address()
|
|
375
|
+
{
|
|
376
|
+
if (exhausted_) {
|
|
377
|
+
restart();
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
auto address = *next_node_;
|
|
381
|
+
if (++next_node_ == nodes_.end()) {
|
|
382
|
+
exhausted_ = true;
|
|
383
|
+
}
|
|
384
|
+
return address;
|
|
385
|
+
}
|
|
386
|
+
bool
|
|
387
|
+
couchbase::core::origin::exhausted() const
|
|
388
|
+
{
|
|
389
|
+
return exhausted_;
|
|
390
|
+
}
|
|
391
|
+
void
|
|
392
|
+
couchbase::core::origin::restart()
|
|
393
|
+
{
|
|
394
|
+
exhausted_ = false;
|
|
395
|
+
next_node_ = nodes_.begin();
|
|
396
|
+
}
|
|
397
|
+
const couchbase::core::cluster_options&
|
|
398
|
+
couchbase::core::origin::options() const
|
|
399
|
+
{
|
|
400
|
+
return options_;
|
|
401
|
+
}
|
|
402
|
+
couchbase::core::cluster_options&
|
|
403
|
+
couchbase::core::origin::options()
|
|
404
|
+
{
|
|
405
|
+
return options_;
|
|
406
|
+
}
|
|
407
|
+
const couchbase::core::cluster_credentials&
|
|
408
|
+
couchbase::core::origin::credentials() const
|
|
409
|
+
{
|
|
410
|
+
return credentials_;
|
|
411
|
+
}
|
|
@@ -17,15 +17,19 @@
|
|
|
17
17
|
|
|
18
18
|
#pragma once
|
|
19
19
|
|
|
20
|
-
#include "
|
|
21
|
-
|
|
22
|
-
#include <fmt/core.h>
|
|
20
|
+
#include "cluster_options.hxx"
|
|
23
21
|
|
|
24
22
|
#include <string>
|
|
25
23
|
#include <utility>
|
|
24
|
+
#include <vector>
|
|
26
25
|
|
|
27
26
|
namespace couchbase::core
|
|
28
27
|
{
|
|
28
|
+
namespace utils
|
|
29
|
+
{
|
|
30
|
+
struct connection_string;
|
|
31
|
+
} // namespace utils
|
|
32
|
+
|
|
29
33
|
struct cluster_credentials {
|
|
30
34
|
std::string username{};
|
|
31
35
|
std::string password{};
|
|
@@ -33,10 +37,7 @@ struct cluster_credentials {
|
|
|
33
37
|
std::string key_path{};
|
|
34
38
|
std::optional<std::vector<std::string>> allowed_sasl_mechanisms{};
|
|
35
39
|
|
|
36
|
-
[[nodiscard]] bool uses_certificate() const
|
|
37
|
-
{
|
|
38
|
-
return !certificate_path.empty();
|
|
39
|
-
}
|
|
40
|
+
[[nodiscard]] bool uses_certificate() const;
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
struct origin {
|
|
@@ -44,146 +45,35 @@ struct origin {
|
|
|
44
45
|
using node_list = std::vector<node_entry>;
|
|
45
46
|
|
|
46
47
|
origin() = default;
|
|
47
|
-
|
|
48
48
|
~origin() = default;
|
|
49
49
|
|
|
50
50
|
origin(origin&& other) = default;
|
|
51
|
+
origin(const origin& other);
|
|
52
|
+
origin(cluster_credentials auth, const std::string& hostname, std::uint16_t port, cluster_options options);
|
|
53
|
+
origin(cluster_credentials auth, const std::string& hostname, const std::string& port, cluster_options options);
|
|
54
|
+
origin(cluster_credentials auth, const utils::connection_string& connstr);
|
|
55
|
+
origin& operator=(origin&& other) = default;
|
|
56
|
+
origin& operator=(const origin& other);
|
|
51
57
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
, next_node_(nodes_.begin())
|
|
57
|
-
{
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
origin(cluster_credentials auth, const std::string& hostname, std::uint16_t port, cluster_options options)
|
|
61
|
-
: options_(std::move(options))
|
|
62
|
-
, credentials_(std::move(auth))
|
|
63
|
-
, nodes_{ { hostname, std::to_string(port) } }
|
|
64
|
-
, next_node_(nodes_.begin())
|
|
65
|
-
{
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
origin(cluster_credentials auth, const std::string& hostname, const std::string& port, cluster_options options)
|
|
69
|
-
: options_(std::move(options))
|
|
70
|
-
, credentials_(std::move(auth))
|
|
71
|
-
, nodes_{ { hostname, port } }
|
|
72
|
-
, next_node_(nodes_.begin())
|
|
73
|
-
{
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
origin(cluster_credentials auth, const utils::connection_string& connstr)
|
|
77
|
-
: options_(connstr.options)
|
|
78
|
-
, credentials_(std::move(auth))
|
|
79
|
-
{
|
|
80
|
-
nodes_.reserve(connstr.bootstrap_nodes.size());
|
|
81
|
-
for (const auto& node : connstr.bootstrap_nodes) {
|
|
82
|
-
nodes_.emplace_back(node.address, node.port > 0 ? std::to_string(node.port) : std::to_string(connstr.default_port));
|
|
83
|
-
}
|
|
84
|
-
next_node_ = nodes_.begin();
|
|
85
|
-
}
|
|
58
|
+
[[nodiscard]] const std::string& username() const;
|
|
59
|
+
[[nodiscard]] const std::string& password() const;
|
|
60
|
+
[[nodiscard]] const std::string& certificate_path() const;
|
|
61
|
+
[[nodiscard]] const std::string& key_path() const;
|
|
86
62
|
|
|
87
|
-
|
|
63
|
+
[[nodiscard]] std::vector<std::string> get_hostnames() const;
|
|
64
|
+
[[nodiscard]] std::vector<std::string> get_nodes() const;
|
|
65
|
+
|
|
66
|
+
void set_nodes(node_list nodes);
|
|
67
|
+
|
|
68
|
+
[[nodiscard]] std::pair<std::string, std::string> next_address();
|
|
69
|
+
|
|
70
|
+
[[nodiscard]] bool exhausted() const;
|
|
88
71
|
|
|
89
|
-
|
|
90
|
-
{
|
|
91
|
-
if (this != &other) {
|
|
92
|
-
options_ = other.options_;
|
|
93
|
-
credentials_ = other.credentials_;
|
|
94
|
-
nodes_ = other.nodes_;
|
|
95
|
-
next_node_ = nodes_.begin();
|
|
96
|
-
exhausted_ = false;
|
|
97
|
-
}
|
|
98
|
-
return *this;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
[[nodiscard]] const std::string& username() const
|
|
102
|
-
{
|
|
103
|
-
return credentials_.username;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
[[nodiscard]] const std::string& password() const
|
|
107
|
-
{
|
|
108
|
-
return credentials_.password;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
[[nodiscard]] const std::string& certificate_path() const
|
|
112
|
-
{
|
|
113
|
-
return credentials_.certificate_path;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
[[nodiscard]] const std::string& key_path() const
|
|
117
|
-
{
|
|
118
|
-
return credentials_.key_path;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
[[nodiscard]] std::vector<std::string> get_hostnames() const
|
|
122
|
-
{
|
|
123
|
-
std::vector<std::string> res;
|
|
124
|
-
res.reserve(nodes_.size());
|
|
125
|
-
for (const auto& [hostname, _] : nodes_) {
|
|
126
|
-
res.emplace_back(hostname);
|
|
127
|
-
}
|
|
128
|
-
return res;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
[[nodiscard]] std::vector<std::string> get_nodes() const
|
|
132
|
-
{
|
|
133
|
-
std::vector<std::string> res;
|
|
134
|
-
res.reserve(nodes_.size());
|
|
135
|
-
for (const auto& [hostname, port] : nodes_) {
|
|
136
|
-
res.emplace_back(fmt::format("\"{}:{}\"", hostname, port));
|
|
137
|
-
}
|
|
138
|
-
return res;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
void set_nodes(node_list nodes)
|
|
142
|
-
{
|
|
143
|
-
nodes_ = std::move(nodes);
|
|
144
|
-
next_node_ = nodes_.begin();
|
|
145
|
-
exhausted_ = false;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
[[nodiscard]] std::pair<std::string, std::string> next_address()
|
|
149
|
-
{
|
|
150
|
-
if (exhausted_) {
|
|
151
|
-
restart();
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
auto address = *next_node_;
|
|
155
|
-
if (++next_node_ == nodes_.end()) {
|
|
156
|
-
exhausted_ = true;
|
|
157
|
-
}
|
|
158
|
-
return address;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
[[nodiscard]] bool exhausted() const
|
|
162
|
-
{
|
|
163
|
-
return exhausted_;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
void restart()
|
|
167
|
-
{
|
|
168
|
-
exhausted_ = false;
|
|
169
|
-
next_node_ = nodes_.begin();
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
[[nodiscard]] const couchbase::core::cluster_options& options() const
|
|
173
|
-
{
|
|
174
|
-
return options_;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
[[nodiscard]] couchbase::core::cluster_options& options()
|
|
178
|
-
{
|
|
179
|
-
return options_;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
[[nodiscard]] const couchbase::core::cluster_credentials& credentials() const
|
|
183
|
-
{
|
|
184
|
-
return credentials_;
|
|
185
|
-
}
|
|
72
|
+
void restart();
|
|
186
73
|
|
|
74
|
+
[[nodiscard]] const couchbase::core::cluster_options& options() const;
|
|
75
|
+
[[nodiscard]] couchbase::core::cluster_options& options();
|
|
76
|
+
[[nodiscard]] const couchbase::core::cluster_credentials& credentials() const;
|
|
187
77
|
[[nodiscard]] auto to_json() const -> std::string;
|
|
188
78
|
|
|
189
79
|
private:
|
|
@@ -31,9 +31,9 @@ class cluster_map_change_notification_request_body
|
|
|
31
31
|
static const inline server_opcode opcode = server_opcode::cluster_map_change_notification;
|
|
32
32
|
|
|
33
33
|
private:
|
|
34
|
-
std::uint32_t protocol_revision_;
|
|
35
|
-
std::string bucket_;
|
|
36
|
-
std::optional<topology::configuration> config_;
|
|
34
|
+
std::uint32_t protocol_revision_{};
|
|
35
|
+
std::string bucket_{};
|
|
36
|
+
std::optional<topology::configuration> config_{};
|
|
37
37
|
|
|
38
38
|
public:
|
|
39
39
|
[[nodiscard]] std::uint32_t protocol_revision() const
|
|
@@ -88,6 +88,11 @@ class hello_request_body
|
|
|
88
88
|
features_.emplace_back(hello_feature::clustermap_change_notification);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
void enable_deduplicate_not_my_vbucket_clustermap()
|
|
92
|
+
{
|
|
93
|
+
features_.emplace_back(hello_feature::deduplicate_not_my_vbucket_clustermap);
|
|
94
|
+
}
|
|
95
|
+
|
|
91
96
|
void enable_compression()
|
|
92
97
|
{
|
|
93
98
|
features_.emplace_back(hello_feature::snappy);
|
|
@@ -34,10 +34,10 @@ class observe_seqno_response_body
|
|
|
34
34
|
static const inline client_opcode opcode = client_opcode::observe_seqno;
|
|
35
35
|
|
|
36
36
|
private:
|
|
37
|
-
std::uint16_t partition_id_;
|
|
38
|
-
std::uint64_t partition_uuid_;
|
|
39
|
-
std::uint64_t last_persisted_sequence_number_;
|
|
40
|
-
std::uint64_t current_sequence_number_;
|
|
37
|
+
std::uint16_t partition_id_{};
|
|
38
|
+
std::uint64_t partition_uuid_{};
|
|
39
|
+
std::uint64_t last_persisted_sequence_number_{};
|
|
40
|
+
std::uint64_t current_sequence_number_{};
|
|
41
41
|
std::optional<std::uint64_t> old_partition_uuid_{};
|
|
42
42
|
std::optional<std::uint64_t> last_received_sequence_number_{};
|
|
43
43
|
|
|
@@ -160,6 +160,11 @@ enum class hello_feature : std::uint16_t {
|
|
|
160
160
|
* Indicates support for subdoc lookup operations on replicas
|
|
161
161
|
*/
|
|
162
162
|
subdoc_replica_read = 0x1c,
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The server will not send configuration body to the connections, that already has seen it.
|
|
166
|
+
*/
|
|
167
|
+
deduplicate_not_my_vbucket_clustermap = 0x1e,
|
|
163
168
|
};
|
|
164
169
|
|
|
165
170
|
constexpr bool
|
|
@@ -191,6 +196,7 @@ is_valid_hello_feature(std::uint16_t code)
|
|
|
191
196
|
case hello_feature::replace_body_with_xattr:
|
|
192
197
|
case hello_feature::resource_units:
|
|
193
198
|
case hello_feature::subdoc_replica_read:
|
|
199
|
+
case hello_feature::deduplicate_not_my_vbucket_clustermap:
|
|
194
200
|
return true;
|
|
195
201
|
}
|
|
196
202
|
return false;
|