couchbase 3.5.6 → 3.6.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.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/ext/cache/extconf_include.rb +3 -3
  4. data/ext/cache/mozilla-ca-bundle.crt +3 -165
  5. data/ext/cache/mozilla-ca-bundle.sha256 +1 -1
  6. data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/CMakeLists.txt +14 -10
  7. data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy.cc +7 -4
  8. data/ext/couchbase/CMakeLists.txt +12 -1
  9. data/ext/couchbase/cmake/Profiler.cmake +15 -0
  10. data/ext/couchbase/cmake/ThirdPartyDependencies.cmake +2 -2
  11. data/ext/couchbase/cmake/couchbase_cxx_client.pc.in +1 -1
  12. data/ext/couchbase/core/app_telemetry_address.cxx +55 -0
  13. data/ext/couchbase/core/app_telemetry_address.hxx +39 -0
  14. data/ext/couchbase/core/app_telemetry_meter.cxx +753 -0
  15. data/ext/couchbase/core/app_telemetry_meter.hxx +198 -0
  16. data/ext/couchbase/core/app_telemetry_reporter.cxx +895 -0
  17. data/ext/couchbase/core/app_telemetry_reporter.hxx +59 -0
  18. data/ext/couchbase/core/bucket.cxx +77 -35
  19. data/ext/couchbase/core/bucket.hxx +17 -10
  20. data/ext/couchbase/core/cluster.cxx +54 -16
  21. data/ext/couchbase/core/cluster_credentials.cxx +27 -0
  22. data/ext/couchbase/core/cluster_credentials.hxx +36 -0
  23. data/ext/couchbase/core/cluster_options.hxx +12 -0
  24. data/ext/couchbase/core/collections_component.cxx +7 -5
  25. data/ext/couchbase/core/http_component.cxx +6 -0
  26. data/ext/couchbase/core/impl/binary_collection.cxx +4 -0
  27. data/ext/couchbase/core/impl/bucket_manager.cxx +2 -0
  28. data/ext/couchbase/core/impl/cluster.cxx +9 -0
  29. data/ext/couchbase/core/impl/collection.cxx +2 -0
  30. data/ext/couchbase/core/impl/error.cxx +1 -0
  31. data/ext/couchbase/core/impl/logger.cxx +51 -0
  32. data/ext/couchbase/core/impl/replica_utils.cxx +1 -1
  33. data/ext/couchbase/core/impl/transaction_get_multi_replicas_from_preferred_server_group_spec.cxx +32 -0
  34. data/ext/couchbase/core/impl/transaction_get_multi_spec.cxx +30 -0
  35. data/ext/couchbase/core/impl/transaction_op_error_category.cxx +2 -0
  36. data/ext/couchbase/core/io/config_tracker.cxx +6 -6
  37. data/ext/couchbase/core/io/http_command.hxx +35 -11
  38. data/ext/couchbase/core/io/http_session.cxx +10 -0
  39. data/ext/couchbase/core/io/http_session.hxx +4 -0
  40. data/ext/couchbase/core/io/http_session_manager.hxx +83 -34
  41. data/ext/couchbase/core/io/mcbp_command.hxx +41 -2
  42. data/ext/couchbase/core/io/mcbp_session.cxx +52 -19
  43. data/ext/couchbase/core/io/mcbp_session.hxx +3 -0
  44. data/ext/couchbase/core/logger/logger.cxx +46 -0
  45. data/ext/couchbase/core/logger/logger.hxx +41 -1
  46. data/ext/couchbase/core/management/bucket_settings.hxx +1 -0
  47. data/ext/couchbase/core/management/bucket_settings_json.hxx +4 -0
  48. data/ext/couchbase/core/meta/features.hxx +32 -0
  49. data/ext/couchbase/core/operations/document_analytics.cxx +9 -9
  50. data/ext/couchbase/core/operations/document_append.cxx +1 -0
  51. data/ext/couchbase/core/operations/document_append.hxx +1 -0
  52. data/ext/couchbase/core/operations/document_get_all_replicas.hxx +10 -2
  53. data/ext/couchbase/core/operations/document_lookup_in.cxx +4 -0
  54. data/ext/couchbase/core/operations/document_lookup_in_all_replicas.hxx +14 -2
  55. data/ext/couchbase/core/operations/document_lookup_in_any_replica.hxx +4 -0
  56. data/ext/couchbase/core/operations/document_mutate_in.cxx +4 -0
  57. data/ext/couchbase/core/operations/document_mutate_in.hxx +1 -0
  58. data/ext/couchbase/core/operations/document_prepend.cxx +1 -0
  59. data/ext/couchbase/core/operations/document_prepend.hxx +1 -0
  60. data/ext/couchbase/core/operations/document_query.cxx +12 -10
  61. data/ext/couchbase/core/operations/http_noop.cxx +1 -0
  62. data/ext/couchbase/core/operations/management/bucket_create.cxx +3 -0
  63. data/ext/couchbase/core/operations/management/bucket_update.cxx +3 -0
  64. data/ext/couchbase/core/origin.cxx +0 -5
  65. data/ext/couchbase/core/origin.hxx +2 -11
  66. data/ext/couchbase/core/platform/random.cc +6 -3
  67. data/ext/couchbase/core/platform/random.h +2 -2
  68. data/ext/couchbase/core/protocol/cmd_mutate_in.hxx +9 -0
  69. data/ext/couchbase/core/timeout_defaults.hxx +4 -0
  70. data/ext/couchbase/core/topology/configuration.cxx +10 -13
  71. data/ext/couchbase/core/topology/configuration.hxx +14 -15
  72. data/ext/couchbase/core/topology/configuration_json.hxx +6 -0
  73. data/ext/couchbase/core/transactions/async_attempt_context.hxx +22 -2
  74. data/ext/couchbase/core/transactions/attempt_context.hxx +25 -7
  75. data/ext/couchbase/core/transactions/attempt_context_impl.cxx +688 -238
  76. data/ext/couchbase/core/transactions/attempt_context_impl.hxx +91 -12
  77. data/ext/couchbase/core/transactions/exceptions.cxx +5 -0
  78. data/ext/couchbase/core/transactions/exceptions.hxx +20 -0
  79. data/ext/couchbase/core/transactions/exceptions_fmt.hxx +3 -0
  80. data/ext/couchbase/core/transactions/forward_compat.cxx +71 -6
  81. data/ext/couchbase/core/transactions/forward_compat.hxx +45 -59
  82. data/ext/couchbase/core/transactions/get_multi_orchestrator.cxx +616 -0
  83. data/ext/couchbase/core/transactions/get_multi_orchestrator.hxx +61 -0
  84. data/ext/couchbase/core/transactions/internal/doc_record.cxx +8 -0
  85. data/ext/couchbase/core/transactions/internal/doc_record.hxx +16 -5
  86. data/ext/couchbase/core/transactions/internal/exceptions_internal.hxx +12 -0
  87. data/ext/couchbase/core/transactions/internal/transaction_context.hxx +13 -0
  88. data/ext/couchbase/core/transactions/internal/transaction_fields.hxx +1 -0
  89. data/ext/couchbase/core/transactions/staged_mutation.cxx +277 -96
  90. data/ext/couchbase/core/transactions/staged_mutation.hxx +28 -76
  91. data/ext/couchbase/core/transactions/transaction_context.cxx +33 -0
  92. data/ext/couchbase/core/transactions/transaction_get_multi_mode.hxx +28 -0
  93. data/ext/couchbase/core/transactions/transaction_get_multi_replicas_from_preferred_server_group_mode.hxx +27 -0
  94. data/ext/couchbase/core/transactions/transaction_get_multi_replicas_from_preferred_server_group_result.hxx +71 -0
  95. data/ext/couchbase/core/transactions/transaction_get_multi_result.hxx +66 -0
  96. data/ext/couchbase/core/transactions/transaction_links.hxx +10 -0
  97. data/ext/couchbase/core/transactions/transactions.cxx +8 -3
  98. data/ext/couchbase/core/utils/connection_string.cxx +4 -0
  99. data/ext/couchbase/core/utils/url_codec.cxx +26 -0
  100. data/ext/couchbase/core/utils/url_codec.hxx +11 -0
  101. data/ext/couchbase/core/websocket_codec.cxx +647 -0
  102. data/ext/couchbase/core/websocket_codec.hxx +77 -0
  103. data/ext/couchbase/couchbase/analytics_options.hxx +70 -6
  104. data/ext/couchbase/couchbase/application_telemetry_options.hxx +124 -0
  105. data/ext/couchbase/couchbase/cluster_options.hxx +17 -0
  106. data/ext/couchbase/couchbase/error_codes.hxx +1 -0
  107. data/ext/couchbase/couchbase/logger.hxx +16 -0
  108. data/ext/couchbase/couchbase/management/bucket_settings.hxx +1 -0
  109. data/ext/couchbase/couchbase/query_options.hxx +70 -6
  110. data/ext/couchbase/couchbase/transactions/async_attempt_context.hxx +29 -5
  111. data/ext/couchbase/couchbase/transactions/attempt_context.hxx +24 -7
  112. data/ext/couchbase/couchbase/transactions/transaction_get_multi_mode.hxx +47 -0
  113. data/ext/couchbase/couchbase/transactions/transaction_get_multi_options.hxx +44 -0
  114. data/ext/couchbase/couchbase/transactions/transaction_get_multi_replicas_from_preferred_server_group_mode.hxx +46 -0
  115. data/ext/couchbase/couchbase/transactions/transaction_get_multi_replicas_from_preferred_server_group_options.hxx +48 -0
  116. data/ext/couchbase/couchbase/transactions/transaction_get_multi_replicas_from_preferred_server_group_result.hxx +109 -0
  117. data/ext/couchbase/couchbase/transactions/transaction_get_multi_replicas_from_preferred_server_group_spec.hxx +47 -0
  118. data/ext/couchbase/couchbase/transactions/transaction_get_multi_result.hxx +102 -0
  119. data/ext/couchbase/couchbase/transactions/transaction_get_multi_spec.hxx +45 -0
  120. data/ext/extconf.rb +6 -0
  121. data/ext/rcb_buckets.cxx +26 -0
  122. data/lib/active_support/cache/couchbase_store.rb +1 -1
  123. data/lib/couchbase/cluster.rb +1 -1
  124. data/lib/couchbase/collection.rb +1 -1
  125. data/lib/couchbase/collection_options.rb +2 -2
  126. data/lib/couchbase/management/analytics_index_manager.rb +4 -4
  127. data/lib/couchbase/management/bucket_manager.rb +8 -2
  128. data/lib/couchbase/protostellar/cluster.rb +2 -2
  129. data/lib/couchbase/protostellar/collection.rb +1 -1
  130. data/lib/couchbase/protostellar/management/collection_query_index_manager.rb +1 -1
  131. data/lib/couchbase/protostellar/request_generator/admin/bucket.rb +4 -4
  132. data/lib/couchbase/protostellar/request_generator/admin/collection.rb +6 -6
  133. data/lib/couchbase/protostellar/request_generator/admin/query.rb +13 -13
  134. data/lib/couchbase/protostellar/request_generator/kv.rb +25 -25
  135. data/lib/couchbase/protostellar/request_generator/query.rb +4 -4
  136. data/lib/couchbase/protostellar/request_generator/search.rb +25 -25
  137. data/lib/couchbase/protostellar/response_converter/search.rb +1 -1
  138. data/lib/couchbase/protostellar/retry/reason.rb +1 -1
  139. data/lib/couchbase/protostellar/timeouts.rb +1 -1
  140. data/lib/couchbase/scope.rb +1 -1
  141. data/lib/couchbase/transcoder_flags.rb +1 -1
  142. data/lib/couchbase/utils/stdlib_logger_adapter.rb +1 -1
  143. data/lib/couchbase/version.rb +1 -1
  144. metadata +47 -19
  145. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/COPYING +0 -0
  146. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/cmake/SnappyConfig.cmake.in +0 -0
  147. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/cmake/config.h.in +0 -0
  148. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-c.cc +0 -0
  149. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-c.h +0 -0
  150. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-internal.h +0 -0
  151. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-sinksource.cc +0 -0
  152. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-sinksource.h +0 -0
  153. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-stubs-internal.cc +0 -0
  154. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-stubs-internal.h +0 -0
  155. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-stubs-public.h.in +0 -0
  156. /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy.h +0 -0
@@ -38,28 +38,33 @@ public:
38
38
  {
39
39
  }
40
40
 
41
- [[nodiscard]] const std::string& bucket_name() const
41
+ [[nodiscard]] auto bucket_name() const -> const std::string&
42
42
  {
43
43
  return id_.bucket();
44
44
  }
45
45
 
46
- [[nodiscard]] const std::string& id() const
46
+ [[nodiscard]] auto id() const -> const std::string&
47
47
  {
48
48
  return id_.key();
49
49
  }
50
50
 
51
- [[nodiscard]] const std::string& collection_name() const
51
+ [[nodiscard]] auto scope_name() const -> const std::string&
52
+ {
53
+ return id_.scope();
54
+ }
55
+
56
+ [[nodiscard]] auto collection_name() const -> const std::string&
52
57
  {
53
58
  return id_.collection();
54
59
  }
55
60
 
56
- [[nodiscard]] const core::document_id& document_id() const
61
+ [[nodiscard]] auto document_id() const -> const core::document_id&
57
62
  {
58
63
  return id_;
59
64
  }
60
65
 
61
66
  template<typename OStream>
62
- friend OStream& operator<<(OStream& os, const doc_record& dr)
67
+ friend auto operator<<(OStream& os, const doc_record& dr) -> OStream&
63
68
  {
64
69
  os << "doc_record{";
65
70
  os << "bucket: " << dr.id_.bucket() << ",";
@@ -70,7 +75,13 @@ public:
70
75
  return os;
71
76
  }
72
77
 
78
+ friend auto operator==(const doc_record& doc, const core::document_id& id) -> bool;
79
+
73
80
  private:
74
81
  core::document_id id_;
75
82
  };
83
+
84
+ auto
85
+ operator==(const doc_record& doc, const core::document_id& id) -> bool;
86
+
76
87
  } // namespace couchbase::core::transactions
@@ -137,6 +137,18 @@ public:
137
137
  , cause_(external_exception_from_error_class(ec))
138
138
  {
139
139
  }
140
+ explicit transaction_operation_failed(error_class ec,
141
+ std::optional<external_exception> cause,
142
+ const std::string& what)
143
+ : std::runtime_error(what)
144
+ , ec_(ec)
145
+ , retry_(false)
146
+ , rollback_(true)
147
+ , to_raise_(FAILED)
148
+ , cause_(cause.value_or(UNKNOWN) == UNKNOWN ? external_exception_from_error_class(ec)
149
+ : cause.value_or(UNKNOWN))
150
+ {
151
+ }
140
152
  explicit transaction_operation_failed(const client_error& client_err)
141
153
  : std::runtime_error(client_err.what())
142
154
  , ec_(client_err.ec())
@@ -101,6 +101,18 @@ public:
101
101
  void get_replica_from_preferred_server_group(const core::document_id& id,
102
102
  async_attempt_context::Callback&& cb);
103
103
 
104
+ void get_multi_replicas_from_preferred_server_group(
105
+ const std::vector<core::document_id>& ids,
106
+ transaction_get_multi_replicas_from_preferred_server_group_mode mode,
107
+ std::function<
108
+ void(std::exception_ptr,
109
+ std::optional<transaction_get_multi_replicas_from_preferred_server_group_result>)>&& cb);
110
+
111
+ void get_multi(
112
+ const std::vector<core::document_id>& ids,
113
+ transaction_get_multi_mode mode,
114
+ std::function<void(std::exception_ptr, std::optional<transaction_get_multi_result>)>&& cb);
115
+
104
116
  void get_optional(const core::document_id& id, async_attempt_context::Callback&& cb);
105
117
 
106
118
  void insert(const core::document_id& id,
@@ -133,6 +145,7 @@ public:
133
145
  void handle_error(const std::exception_ptr& err, txn_complete_callback&& callback);
134
146
 
135
147
  auto remaining() const -> std::chrono::nanoseconds;
148
+ [[nodiscard]] auto expiry_time() const -> std::chrono::steady_clock::time_point;
136
149
 
137
150
  private:
138
151
  transaction_context(transactions& txns,
@@ -62,6 +62,7 @@ static const std::string ATR_BUCKET_NAME = TRANSACTION_INTERFACE_PREFIX + "atr.b
62
62
  static const std::string ATR_COLL_NAME = TRANSACTION_INTERFACE_PREFIX + "atr.coll";
63
63
  static const std::string ATR_SCOPE_NAME = TRANSACTION_INTERFACE_PREFIX + "atr.scp";
64
64
  static const std::string STAGED_DATA = TRANSACTION_INTERFACE_PREFIX + "op.stgd";
65
+ static const std::string STAGED_BINARY_DATA = TRANSACTION_INTERFACE_PREFIX + "op.bin";
65
66
  static const std::string TYPE = TRANSACTION_INTERFACE_PREFIX + "op.type";
66
67
  static const std::string CRC32_OF_STAGING = TRANSACTION_INTERFACE_PREFIX + "op.crc32";
67
68
  static const std::string FORWARD_COMPAT = TRANSACTION_INTERFACE_PREFIX + "fc";