couchbase 3.1.1 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/ext/CMakeLists.txt +3 -1
- data/ext/build_version.hxx.in +1 -1
- data/ext/cmake/Testing.cmake +1 -0
- data/ext/cmake/ThirdPartyDependencies.cmake +6 -0
- data/ext/cmake/VersionInfo.cmake +3 -0
- data/ext/couchbase/bucket.hxx +47 -28
- data/ext/couchbase/cbsasl/client.h +1 -1
- data/ext/couchbase/cbsasl/context.cc +1 -1
- data/ext/couchbase/cbsasl/context.h +3 -3
- data/ext/couchbase/cbsasl/mechanism.cc +5 -8
- data/ext/couchbase/cbsasl/mechanism.h +1 -4
- data/ext/couchbase/cbsasl/plain/plain.cc +1 -1
- data/ext/couchbase/cbsasl/scram-sha/scram-sha.cc +30 -36
- data/ext/couchbase/cluster.hxx +40 -22
- data/ext/couchbase/cluster_options.hxx +7 -1
- data/ext/couchbase/configuration.hxx +37 -16
- data/ext/couchbase/couchbase.cxx +1145 -291
- data/ext/couchbase/error_map.hxx +1 -1
- data/ext/couchbase/errors.hxx +25 -17
- data/ext/couchbase/io/dns_client.hxx +3 -3
- data/ext/couchbase/io/dns_codec.hxx +4 -5
- data/ext/couchbase/io/dns_config.hxx +5 -6
- data/ext/couchbase/io/dns_message.hxx +3 -3
- data/ext/couchbase/io/http_command.hxx +70 -35
- data/ext/couchbase/io/http_session.hxx +4 -3
- data/ext/couchbase/io/http_session_manager.hxx +28 -19
- data/ext/couchbase/io/mcbp_command.hxx +51 -19
- data/ext/couchbase/io/mcbp_context.hxx +1 -1
- data/ext/couchbase/io/mcbp_parser.hxx +4 -4
- data/ext/couchbase/io/mcbp_session.hxx +91 -101
- data/ext/couchbase/io/query_cache.hxx +2 -2
- data/ext/couchbase/io/retry_orchestrator.hxx +2 -4
- data/ext/couchbase/io/retry_reason.hxx +2 -2
- data/ext/couchbase/io/retry_strategy.hxx +1 -6
- data/ext/couchbase/io/streams.hxx +7 -7
- data/ext/couchbase/metrics/logging_meter.hxx +228 -0
- data/ext/couchbase/metrics/logging_meter_options.hxx +28 -0
- data/ext/couchbase/metrics/meter.hxx +49 -0
- data/ext/couchbase/metrics/noop_meter.hxx +43 -0
- data/ext/couchbase/operations/analytics_dataset_create.hxx +16 -12
- data/ext/couchbase/operations/analytics_dataset_drop.hxx +11 -11
- data/ext/couchbase/operations/analytics_dataset_get_all.hxx +6 -6
- data/ext/couchbase/operations/analytics_dataverse_create.hxx +10 -11
- data/ext/couchbase/operations/analytics_dataverse_drop.hxx +10 -11
- data/ext/couchbase/operations/analytics_get_pending_mutations.hxx +9 -11
- data/ext/couchbase/operations/analytics_index_create.hxx +14 -13
- data/ext/couchbase/operations/analytics_index_drop.hxx +18 -12
- data/ext/couchbase/operations/analytics_index_get_all.hxx +8 -6
- data/ext/couchbase/operations/analytics_link.hxx +39 -0
- data/ext/couchbase/operations/analytics_link_azure_blob_external.hxx +145 -0
- data/ext/couchbase/operations/analytics_link_connect.hxx +14 -12
- data/ext/couchbase/operations/analytics_link_couchbase_remote.hxx +220 -0
- data/ext/couchbase/operations/analytics_link_create.hxx +128 -0
- data/ext/couchbase/operations/analytics_link_disconnect.hxx +11 -12
- data/ext/couchbase/operations/analytics_link_drop.hxx +130 -0
- data/ext/couchbase/operations/analytics_link_get_all.hxx +160 -0
- data/ext/couchbase/operations/analytics_link_replace.hxx +128 -0
- data/ext/couchbase/operations/analytics_link_s3_external.hxx +122 -0
- data/ext/couchbase/operations/bucket_create.hxx +8 -8
- data/ext/couchbase/operations/bucket_drop.hxx +5 -5
- data/ext/couchbase/operations/bucket_flush.hxx +5 -5
- data/ext/couchbase/operations/bucket_get.hxx +7 -7
- data/ext/couchbase/operations/bucket_get_all.hxx +7 -5
- data/ext/couchbase/operations/bucket_settings.hxx +40 -49
- data/ext/couchbase/operations/bucket_update.hxx +8 -8
- data/ext/couchbase/operations/cluster_developer_preview_enable.hxx +7 -7
- data/ext/couchbase/operations/collection_create.hxx +11 -11
- data/ext/couchbase/operations/collection_drop.hxx +12 -10
- data/ext/couchbase/operations/collections_manifest_get.hxx +3 -3
- data/ext/couchbase/operations/design_document.hxx +2 -2
- data/ext/couchbase/operations/document_analytics.hxx +29 -36
- data/ext/couchbase/operations/document_append.hxx +3 -3
- data/ext/couchbase/operations/document_decrement.hxx +3 -3
- data/ext/couchbase/operations/document_exists.hxx +2 -2
- data/ext/couchbase/operations/document_get.hxx +3 -3
- data/ext/couchbase/operations/document_get_and_lock.hxx +5 -3
- data/ext/couchbase/operations/document_get_and_touch.hxx +5 -3
- data/ext/couchbase/operations/document_get_projected.hxx +10 -11
- data/ext/couchbase/operations/document_increment.hxx +3 -3
- data/ext/couchbase/operations/document_insert.hxx +3 -3
- data/ext/couchbase/operations/document_lookup_in.hxx +12 -18
- data/ext/couchbase/operations/document_mutate_in.hxx +13 -18
- data/ext/couchbase/operations/document_prepend.hxx +3 -3
- data/ext/couchbase/operations/document_query.hxx +39 -41
- data/ext/couchbase/operations/document_remove.hxx +3 -3
- data/ext/couchbase/operations/document_replace.hxx +3 -3
- data/ext/couchbase/operations/document_search.hxx +56 -61
- data/ext/couchbase/operations/document_touch.hxx +3 -3
- data/ext/couchbase/operations/document_unlock.hxx +3 -3
- data/ext/couchbase/operations/document_upsert.hxx +3 -3
- data/ext/couchbase/operations/document_view.hxx +23 -23
- data/ext/couchbase/operations/group_drop.hxx +5 -5
- data/ext/couchbase/operations/group_get.hxx +7 -7
- data/ext/couchbase/operations/group_get_all.hxx +6 -6
- data/ext/couchbase/operations/group_upsert.hxx +11 -11
- data/ext/couchbase/operations/http_noop.hxx +6 -6
- data/ext/couchbase/operations/mcbp_noop.hxx +3 -3
- data/ext/couchbase/operations/query_index_build_deferred.hxx +6 -6
- data/ext/couchbase/operations/query_index_create.hxx +10 -8
- data/ext/couchbase/operations/query_index_drop.hxx +8 -8
- data/ext/couchbase/operations/query_index_get_all.hxx +43 -39
- data/ext/couchbase/operations/rbac.hxx +40 -63
- data/ext/couchbase/operations/role_get_all.hxx +6 -6
- data/ext/couchbase/operations/scope_create.hxx +10 -10
- data/ext/couchbase/operations/scope_drop.hxx +9 -9
- data/ext/couchbase/operations/scope_get_all.hxx +8 -8
- data/ext/couchbase/operations/search_get_stats.hxx +5 -3
- data/ext/couchbase/operations/search_index.hxx +6 -15
- data/ext/couchbase/operations/search_index_analyze_document.hxx +11 -11
- data/ext/couchbase/operations/search_index_control_ingest.hxx +9 -9
- data/ext/couchbase/operations/search_index_control_plan_freeze.hxx +9 -9
- data/ext/couchbase/operations/search_index_control_query.hxx +9 -9
- data/ext/couchbase/operations/search_index_drop.hxx +11 -9
- data/ext/couchbase/operations/search_index_get.hxx +11 -9
- data/ext/couchbase/operations/search_index_get_all.hxx +11 -11
- data/ext/couchbase/operations/search_index_get_documents_count.hxx +10 -10
- data/ext/couchbase/operations/search_index_get_stats.hxx +10 -8
- data/ext/couchbase/operations/search_index_upsert.hxx +12 -10
- data/ext/couchbase/operations/user_drop.hxx +5 -5
- data/ext/couchbase/operations/user_get.hxx +7 -7
- data/ext/couchbase/operations/user_get_all.hxx +6 -6
- data/ext/couchbase/operations/user_upsert.hxx +9 -9
- data/ext/couchbase/operations/view_index_drop.hxx +10 -10
- data/ext/couchbase/operations/view_index_get.hxx +13 -15
- data/ext/couchbase/operations/view_index_get_all.hxx +17 -20
- data/ext/couchbase/operations/view_index_upsert.hxx +9 -7
- data/ext/couchbase/operations.hxx +4 -0
- data/ext/couchbase/origin.hxx +14 -10
- data/ext/couchbase/platform/backtrace.c +1 -1
- data/ext/couchbase/platform/base64.cc +5 -5
- data/ext/couchbase/platform/base64.h +2 -5
- data/ext/couchbase/protocol/client_opcode.hxx +7 -4
- data/ext/couchbase/protocol/client_request.hxx +2 -2
- data/ext/couchbase/protocol/client_response.hxx +41 -16
- data/ext/couchbase/protocol/cmd_append.hxx +17 -16
- data/ext/couchbase/protocol/cmd_cluster_map_change_notification.hxx +4 -4
- data/ext/couchbase/protocol/cmd_decrement.hxx +10 -11
- data/ext/couchbase/protocol/cmd_exists.hxx +12 -15
- data/ext/couchbase/protocol/cmd_get.hxx +11 -14
- data/ext/couchbase/protocol/cmd_get_and_lock.hxx +10 -12
- data/ext/couchbase/protocol/cmd_get_and_touch.hxx +10 -12
- data/ext/couchbase/protocol/cmd_get_cluster_config.hxx +13 -18
- data/ext/couchbase/protocol/cmd_get_collection_id.hxx +12 -15
- data/ext/couchbase/protocol/cmd_get_collections_manifest.hxx +12 -16
- data/ext/couchbase/protocol/cmd_get_error_map.hxx +14 -17
- data/ext/couchbase/protocol/cmd_hello.hxx +8 -10
- data/ext/couchbase/protocol/cmd_increment.hxx +9 -10
- data/ext/couchbase/protocol/cmd_insert.hxx +9 -9
- data/ext/couchbase/protocol/cmd_lookup_in.hxx +12 -13
- data/ext/couchbase/protocol/cmd_mutate_in.hxx +11 -11
- data/ext/couchbase/protocol/cmd_noop.hxx +16 -20
- data/ext/couchbase/protocol/cmd_prepend.hxx +9 -10
- data/ext/couchbase/protocol/cmd_remove.hxx +10 -13
- data/ext/couchbase/protocol/cmd_replace.hxx +7 -7
- data/ext/couchbase/protocol/cmd_sasl_auth.hxx +8 -10
- data/ext/couchbase/protocol/cmd_sasl_list_mechs.hxx +10 -15
- data/ext/couchbase/protocol/cmd_sasl_step.hxx +10 -12
- data/ext/couchbase/protocol/cmd_select_bucket.hxx +14 -18
- data/ext/couchbase/protocol/cmd_touch.hxx +8 -11
- data/ext/couchbase/protocol/cmd_unlock.hxx +10 -14
- data/ext/couchbase/protocol/cmd_upsert.hxx +8 -8
- data/ext/couchbase/protocol/datatype.hxx +3 -3
- data/ext/couchbase/protocol/durability_level.hxx +2 -2
- data/ext/couchbase/protocol/frame_info_id.hxx +4 -4
- data/ext/couchbase/protocol/hello_feature.hxx +2 -2
- data/ext/couchbase/protocol/magic.hxx +2 -2
- data/ext/couchbase/protocol/server_opcode.hxx +2 -2
- data/ext/couchbase/protocol/server_request.hxx +1 -1
- data/ext/couchbase/protocol/status.hxx +4 -7
- data/ext/couchbase/protocol/unsigned_leb128.h +5 -20
- data/ext/couchbase/service_type.hxx +4 -4
- data/ext/couchbase/tracing/constants.hxx +261 -0
- data/ext/couchbase/tracing/noop_tracer.hxx +50 -0
- data/ext/couchbase/tracing/request_tracer.hxx +77 -0
- data/ext/couchbase/tracing/threshold_logging_options.hxx +64 -0
- data/ext/couchbase/tracing/threshold_logging_tracer.hxx +366 -0
- data/ext/couchbase/utils/byteswap.hxx +1 -1
- data/ext/couchbase/utils/connection_string.hxx +21 -1
- data/ext/couchbase/utils/name_codec.hxx +41 -0
- data/ext/couchbase/utils/url_codec.hxx +236 -0
- data/ext/couchbase/version.hxx +1 -1
- data/ext/test/CMakeLists.txt +1 -0
- data/ext/test/test_native_trivial_query.cxx +60 -0
- data/ext/third_party/hdr_histogram_c/CMakeLists.txt +84 -0
- data/ext/third_party/hdr_histogram_c/COPYING.txt +121 -0
- data/ext/third_party/hdr_histogram_c/LICENSE.txt +41 -0
- data/ext/third_party/hdr_histogram_c/config.cmake.in +6 -0
- data/ext/third_party/hdr_histogram_c/src/CMakeLists.txt +83 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_atomic.h +146 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_encoding.c +322 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_encoding.h +79 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_endian.h +116 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_histogram.c +1196 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_histogram.h +516 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_histogram_log.c +1290 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_histogram_log.h +236 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_histogram_log_no_op.c +171 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_interval_recorder.c +227 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_interval_recorder.h +109 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_malloc.h +19 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_tests.h +22 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_thread.c +108 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_thread.h +55 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_time.c +98 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_time.h +49 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_writer_reader_phaser.c +143 -0
- data/ext/third_party/hdr_histogram_c/src/hdr_writer_reader_phaser.h +51 -0
- data/lib/couchbase/cluster.rb +1 -0
- data/lib/couchbase/errors.rb +3 -0
- data/lib/couchbase/management/analytics_index_manager.rb +920 -226
- data/lib/couchbase/management/bucket_manager.rb +207 -69
- data/lib/couchbase/management/collection_manager.rb +173 -61
- data/lib/couchbase/management/query_index_manager.rb +357 -169
- data/lib/couchbase/options.rb +75 -3
- data/lib/couchbase/scope.rb +102 -0
- data/lib/couchbase/utils/time.rb +4 -0
- data/lib/couchbase/version.rb +6 -6
- metadata +50 -7
@@ -37,7 +37,7 @@ class insert_response_body
|
|
37
37
|
mutation_token token_;
|
38
38
|
|
39
39
|
public:
|
40
|
-
mutation_token& token()
|
40
|
+
[[nodiscard]] const mutation_token& token() const
|
41
41
|
{
|
42
42
|
return token_;
|
43
43
|
}
|
@@ -45,10 +45,10 @@ class insert_response_body
|
|
45
45
|
bool parse(protocol::status status,
|
46
46
|
const header_buffer& header,
|
47
47
|
std::uint8_t framing_extras_size,
|
48
|
-
std::uint16_t
|
48
|
+
std::uint16_t /* key_size */,
|
49
49
|
std::uint8_t extras_size,
|
50
50
|
const std::vector<uint8_t>& body,
|
51
|
-
const cmd_info&)
|
51
|
+
const cmd_info& /* info */)
|
52
52
|
{
|
53
53
|
Expects(header[1] == static_cast<uint8_t>(opcode));
|
54
54
|
if (status == protocol::status::success) {
|
@@ -110,7 +110,7 @@ class insert_request_body
|
|
110
110
|
}
|
111
111
|
}
|
112
112
|
|
113
|
-
void content(const std::
|
113
|
+
void content(const std::string_view& content)
|
114
114
|
{
|
115
115
|
content_ = { content.begin(), content.end() };
|
116
116
|
}
|
@@ -125,17 +125,17 @@ class insert_request_body
|
|
125
125
|
expiry_ = value;
|
126
126
|
}
|
127
127
|
|
128
|
-
const std::string& key()
|
128
|
+
[[nodiscard]] const std::string& key() const
|
129
129
|
{
|
130
130
|
return key_;
|
131
131
|
}
|
132
132
|
|
133
|
-
const std::vector<std::uint8_t>& framing_extras()
|
133
|
+
[[nodiscard]] const std::vector<std::uint8_t>& framing_extras() const
|
134
134
|
{
|
135
135
|
return framing_extras_;
|
136
136
|
}
|
137
137
|
|
138
|
-
const std::vector<std::uint8_t>& extras()
|
138
|
+
[[nodiscard]] const std::vector<std::uint8_t>& extras()
|
139
139
|
{
|
140
140
|
if (extras_.empty()) {
|
141
141
|
fill_extention();
|
@@ -143,12 +143,12 @@ class insert_request_body
|
|
143
143
|
return extras_;
|
144
144
|
}
|
145
145
|
|
146
|
-
const std::vector<std::uint8_t>& value()
|
146
|
+
[[nodiscard]] const std::vector<std::uint8_t>& value() const
|
147
147
|
{
|
148
148
|
return content_;
|
149
149
|
}
|
150
150
|
|
151
|
-
std::size_t size()
|
151
|
+
[[nodiscard]] std::size_t size()
|
152
152
|
{
|
153
153
|
if (extras_.empty()) {
|
154
154
|
fill_extention();
|
@@ -19,8 +19,8 @@
|
|
19
19
|
|
20
20
|
#include <protocol/unsigned_leb128.h>
|
21
21
|
|
22
|
-
#include <protocol/client_opcode.hxx>
|
23
22
|
#include <document_id.hxx>
|
23
|
+
#include <protocol/client_opcode.hxx>
|
24
24
|
|
25
25
|
namespace couchbase::protocol
|
26
26
|
{
|
@@ -31,7 +31,7 @@ class lookup_in_response_body
|
|
31
31
|
static const inline client_opcode opcode = client_opcode::subdoc_multi_lookup;
|
32
32
|
|
33
33
|
struct lookup_in_field {
|
34
|
-
protocol::status status;
|
34
|
+
protocol::status status{};
|
35
35
|
std::string value;
|
36
36
|
};
|
37
37
|
|
@@ -39,7 +39,7 @@ class lookup_in_response_body
|
|
39
39
|
std::vector<lookup_in_field> fields_;
|
40
40
|
|
41
41
|
public:
|
42
|
-
std::vector<lookup_in_field>& fields()
|
42
|
+
[[nodiscard]] const std::vector<lookup_in_field>& fields() const
|
43
43
|
{
|
44
44
|
return fields_;
|
45
45
|
}
|
@@ -50,7 +50,7 @@ class lookup_in_response_body
|
|
50
50
|
std::uint16_t key_size,
|
51
51
|
std::uint8_t extras_size,
|
52
52
|
const std::vector<uint8_t>& body,
|
53
|
-
const cmd_info&)
|
53
|
+
const cmd_info& /* info */)
|
54
54
|
{
|
55
55
|
Expects(header[1] == static_cast<uint8_t>(opcode));
|
56
56
|
if (status == protocol::status::success || status == protocol::status::subdoc_multi_path_failure ||
|
@@ -65,7 +65,7 @@ class lookup_in_response_body
|
|
65
65
|
memcpy(&entry_status, body.data() + offset, sizeof(entry_status));
|
66
66
|
entry_status = ntohs(entry_status);
|
67
67
|
Expects(is_valid_status(entry_status));
|
68
|
-
field.status =
|
68
|
+
field.status = protocol::status(entry_status);
|
69
69
|
offset += static_cast<offset_type>(sizeof(entry_status));
|
70
70
|
|
71
71
|
std::uint32_t entry_size = 0;
|
@@ -156,18 +156,17 @@ class lookup_in_request_body
|
|
156
156
|
specs_ = specs;
|
157
157
|
}
|
158
158
|
|
159
|
-
const std::string& key()
|
159
|
+
[[nodiscard]] const std::string& key() const
|
160
160
|
{
|
161
161
|
return key_;
|
162
162
|
}
|
163
163
|
|
164
|
-
const std::vector<std::uint8_t>& framing_extras()
|
164
|
+
[[nodiscard]] const std::vector<std::uint8_t>& framing_extras() const
|
165
165
|
{
|
166
|
-
|
167
|
-
return empty;
|
166
|
+
return empty_buffer;
|
168
167
|
}
|
169
168
|
|
170
|
-
const std::vector<std::uint8_t>& extras()
|
169
|
+
[[nodiscard]] const std::vector<std::uint8_t>& extras()
|
171
170
|
{
|
172
171
|
if (extras_.empty()) {
|
173
172
|
fill_extention();
|
@@ -175,7 +174,7 @@ class lookup_in_request_body
|
|
175
174
|
return extras_;
|
176
175
|
}
|
177
176
|
|
178
|
-
const std::vector<std::uint8_t>& value()
|
177
|
+
[[nodiscard]] const std::vector<std::uint8_t>& value()
|
179
178
|
{
|
180
179
|
if (value_.empty()) {
|
181
180
|
fill_value();
|
@@ -183,7 +182,7 @@ class lookup_in_request_body
|
|
183
182
|
return value_;
|
184
183
|
}
|
185
184
|
|
186
|
-
std::size_t size()
|
185
|
+
[[nodiscard]] std::size_t size()
|
187
186
|
{
|
188
187
|
if (extras_.empty()) {
|
189
188
|
fill_extention();
|
@@ -206,7 +205,7 @@ class lookup_in_request_body
|
|
206
205
|
void fill_value()
|
207
206
|
{
|
208
207
|
size_t value_size = 0;
|
209
|
-
for (auto& spec : specs_.entries) {
|
208
|
+
for (const auto& spec : specs_.entries) {
|
210
209
|
value_size += sizeof(spec.opcode) + sizeof(spec.flags) + sizeof(std::uint16_t) + spec.path.size();
|
211
210
|
}
|
212
211
|
Expects(value_size > 0);
|
@@ -19,8 +19,8 @@
|
|
19
19
|
|
20
20
|
#include <protocol/unsigned_leb128.h>
|
21
21
|
|
22
|
-
#include <protocol/client_opcode.hxx>
|
23
22
|
#include <document_id.hxx>
|
23
|
+
#include <protocol/client_opcode.hxx>
|
24
24
|
|
25
25
|
namespace couchbase::protocol
|
26
26
|
{
|
@@ -41,12 +41,12 @@ class mutate_in_response_body
|
|
41
41
|
mutation_token token_;
|
42
42
|
|
43
43
|
public:
|
44
|
-
std::vector<mutate_in_field>& fields()
|
44
|
+
[[nodiscard]] const std::vector<mutate_in_field>& fields() const
|
45
45
|
{
|
46
46
|
return fields_;
|
47
47
|
}
|
48
48
|
|
49
|
-
mutation_token& token()
|
49
|
+
[[nodiscard]] const mutation_token& token() const
|
50
50
|
{
|
51
51
|
return token_;
|
52
52
|
}
|
@@ -57,7 +57,7 @@ class mutate_in_response_body
|
|
57
57
|
std::uint16_t key_size,
|
58
58
|
std::uint8_t extras_size,
|
59
59
|
const std::vector<uint8_t>& body,
|
60
|
-
const cmd_info&)
|
60
|
+
const cmd_info& /* info */)
|
61
61
|
{
|
62
62
|
Expects(header[1] == static_cast<uint8_t>(opcode));
|
63
63
|
if (status == protocol::status::success || status == protocol::status::subdoc_multi_path_failure) {
|
@@ -86,7 +86,7 @@ class mutate_in_response_body
|
|
86
86
|
memcpy(&entry_status, body.data() + offset, sizeof(entry_status));
|
87
87
|
entry_status = ntohs(entry_status);
|
88
88
|
Expects(is_valid_status(entry_status));
|
89
|
-
field.status =
|
89
|
+
field.status = protocol::status(entry_status);
|
90
90
|
offset += static_cast<offset_type>(sizeof(entry_status));
|
91
91
|
|
92
92
|
if (field.status == protocol::status::success) {
|
@@ -327,17 +327,17 @@ class mutate_in_request_body
|
|
327
327
|
framing_extras_[extras_size + 0] = static_cast<std::uint8_t>(static_cast<std::uint32_t>(frame_id) << 4U | 0U);
|
328
328
|
}
|
329
329
|
|
330
|
-
const std::string& key()
|
330
|
+
[[nodiscard]] const std::string& key() const
|
331
331
|
{
|
332
332
|
return key_;
|
333
333
|
}
|
334
334
|
|
335
|
-
const std::vector<std::uint8_t>& framing_extras()
|
335
|
+
[[nodiscard]] const std::vector<std::uint8_t>& framing_extras() const
|
336
336
|
{
|
337
337
|
return framing_extras_;
|
338
338
|
}
|
339
339
|
|
340
|
-
const std::vector<std::uint8_t>& extras()
|
340
|
+
[[nodiscard]] const std::vector<std::uint8_t>& extras()
|
341
341
|
{
|
342
342
|
if (extras_.empty()) {
|
343
343
|
fill_extention();
|
@@ -345,7 +345,7 @@ class mutate_in_request_body
|
|
345
345
|
return extras_;
|
346
346
|
}
|
347
347
|
|
348
|
-
const std::vector<std::uint8_t>& value()
|
348
|
+
[[nodiscard]] const std::vector<std::uint8_t>& value()
|
349
349
|
{
|
350
350
|
if (value_.empty()) {
|
351
351
|
fill_value();
|
@@ -353,7 +353,7 @@ class mutate_in_request_body
|
|
353
353
|
return value_;
|
354
354
|
}
|
355
355
|
|
356
|
-
std::size_t size()
|
356
|
+
[[nodiscard]] std::size_t size()
|
357
357
|
{
|
358
358
|
if (extras_.empty()) {
|
359
359
|
fill_extention();
|
@@ -382,7 +382,7 @@ class mutate_in_request_body
|
|
382
382
|
void fill_value()
|
383
383
|
{
|
384
384
|
size_t value_size = 0;
|
385
|
-
for (auto& spec : specs_.entries) {
|
385
|
+
for (const auto& spec : specs_.entries) {
|
386
386
|
value_size += sizeof(spec.opcode) + sizeof(spec.flags) + sizeof(std::uint16_t) + spec.path.size() + sizeof(std::uint32_t) +
|
387
387
|
spec.param.size();
|
388
388
|
}
|
@@ -19,8 +19,8 @@
|
|
19
19
|
|
20
20
|
#include <protocol/unsigned_leb128.h>
|
21
21
|
|
22
|
-
#include <protocol/client_opcode.hxx>
|
23
22
|
#include <document_id.hxx>
|
23
|
+
#include <protocol/client_opcode.hxx>
|
24
24
|
|
25
25
|
namespace couchbase::protocol
|
26
26
|
{
|
@@ -30,13 +30,13 @@ class mcbp_noop_response_body
|
|
30
30
|
public:
|
31
31
|
static const inline client_opcode opcode = client_opcode::noop;
|
32
32
|
|
33
|
-
bool parse(protocol::status
|
33
|
+
bool parse(protocol::status /* status */,
|
34
34
|
const header_buffer& header,
|
35
|
-
std::uint8_t
|
36
|
-
std::uint16_t
|
37
|
-
std::uint8_t
|
38
|
-
const std::vector<uint8_t
|
39
|
-
const cmd_info&)
|
35
|
+
std::uint8_t /* framing_extras_size */,
|
36
|
+
std::uint16_t /* key_size */,
|
37
|
+
std::uint8_t /* extras_size */,
|
38
|
+
const std::vector<uint8_t>& /* body */,
|
39
|
+
const cmd_info& /* info */)
|
40
40
|
{
|
41
41
|
Expects(header[1] == static_cast<uint8_t>(opcode));
|
42
42
|
return false;
|
@@ -49,31 +49,27 @@ class mcbp_noop_request_body
|
|
49
49
|
using response_body_type = mcbp_noop_response_body;
|
50
50
|
static const inline client_opcode opcode = client_opcode::noop;
|
51
51
|
|
52
|
-
const std::string& key()
|
52
|
+
[[nodiscard]] const std::string& key() const
|
53
53
|
{
|
54
|
-
|
55
|
-
return empty;
|
54
|
+
return empty_string;
|
56
55
|
}
|
57
56
|
|
58
|
-
const std::vector<std::uint8_t>& framing_extras()
|
57
|
+
[[nodiscard]] const std::vector<std::uint8_t>& framing_extras() const
|
59
58
|
{
|
60
|
-
|
61
|
-
return empty;
|
59
|
+
return empty_buffer;
|
62
60
|
}
|
63
61
|
|
64
|
-
const std::vector<std::uint8_t>& extras()
|
62
|
+
[[nodiscard]] const std::vector<std::uint8_t>& extras() const
|
65
63
|
{
|
66
|
-
|
67
|
-
return empty;
|
64
|
+
return empty_buffer;
|
68
65
|
}
|
69
66
|
|
70
|
-
const std::vector<std::uint8_t>& value()
|
67
|
+
[[nodiscard]] const std::vector<std::uint8_t>& value() const
|
71
68
|
{
|
72
|
-
|
73
|
-
return empty;
|
69
|
+
return empty_buffer;
|
74
70
|
}
|
75
71
|
|
76
|
-
std::size_t size()
|
72
|
+
[[nodiscard]] std::size_t size() const
|
77
73
|
{
|
78
74
|
return 0;
|
79
75
|
}
|
@@ -39,7 +39,7 @@ class prepend_response_body
|
|
39
39
|
mutation_token token_;
|
40
40
|
|
41
41
|
public:
|
42
|
-
mutation_token& token()
|
42
|
+
[[nodiscard]] const mutation_token& token() const
|
43
43
|
{
|
44
44
|
return token_;
|
45
45
|
}
|
@@ -50,7 +50,7 @@ class prepend_response_body
|
|
50
50
|
std::uint16_t,
|
51
51
|
std::uint8_t extras_size,
|
52
52
|
const std::vector<uint8_t>& body,
|
53
|
-
const cmd_info&)
|
53
|
+
const cmd_info& /* info */)
|
54
54
|
{
|
55
55
|
Expects(header[1] == static_cast<uint8_t>(opcode));
|
56
56
|
if (status == protocol::status::success) {
|
@@ -110,33 +110,32 @@ class prepend_request_body
|
|
110
110
|
}
|
111
111
|
}
|
112
112
|
|
113
|
-
void content(const std::
|
113
|
+
void content(const std::string_view& content)
|
114
114
|
{
|
115
115
|
content_ = { content.begin(), content.end() };
|
116
116
|
}
|
117
117
|
|
118
|
-
const std::string& key()
|
118
|
+
[[nodiscard]] const std::string& key() const
|
119
119
|
{
|
120
120
|
return key_;
|
121
121
|
}
|
122
122
|
|
123
|
-
const std::vector<std::uint8_t>& framing_extras()
|
123
|
+
[[nodiscard]] const std::vector<std::uint8_t>& framing_extras() const
|
124
124
|
{
|
125
125
|
return framing_extras_;
|
126
126
|
}
|
127
127
|
|
128
|
-
const std::vector<std::uint8_t>& extras()
|
128
|
+
[[nodiscard]] const std::vector<std::uint8_t>& extras() const
|
129
129
|
{
|
130
|
-
|
131
|
-
return empty;
|
130
|
+
return empty_buffer;
|
132
131
|
}
|
133
132
|
|
134
|
-
const std::vector<std::uint8_t>& value()
|
133
|
+
[[nodiscard]] const std::vector<std::uint8_t>& value() const
|
135
134
|
{
|
136
135
|
return content_;
|
137
136
|
}
|
138
137
|
|
139
|
-
std::size_t size()
|
138
|
+
[[nodiscard]] std::size_t size() const
|
140
139
|
{
|
141
140
|
return framing_extras_.size() + key_.size() + content_.size();
|
142
141
|
}
|
@@ -19,8 +19,8 @@
|
|
19
19
|
|
20
20
|
#include <protocol/unsigned_leb128.h>
|
21
21
|
|
22
|
-
#include <protocol/client_opcode.hxx>
|
23
22
|
#include <document_id.hxx>
|
23
|
+
#include <protocol/client_opcode.hxx>
|
24
24
|
|
25
25
|
namespace couchbase::protocol
|
26
26
|
{
|
@@ -32,8 +32,7 @@ class remove_response_body
|
|
32
32
|
|
33
33
|
mutation_token token_;
|
34
34
|
|
35
|
-
|
36
|
-
mutation_token& token()
|
35
|
+
[[nodiscard]] const mutation_token& token() const
|
37
36
|
{
|
38
37
|
return token_;
|
39
38
|
}
|
@@ -44,7 +43,7 @@ class remove_response_body
|
|
44
43
|
std::uint16_t /* key_size */,
|
45
44
|
std::uint8_t extras_size,
|
46
45
|
const std::vector<uint8_t>& body,
|
47
|
-
const cmd_info&)
|
46
|
+
const cmd_info& /* info */)
|
48
47
|
{
|
49
48
|
Expects(header[1] == static_cast<uint8_t>(opcode));
|
50
49
|
if (status == protocol::status::success) {
|
@@ -103,29 +102,27 @@ class remove_request_body
|
|
103
102
|
}
|
104
103
|
}
|
105
104
|
|
106
|
-
const std::string& key()
|
105
|
+
[[nodiscard]] const std::string& key() const
|
107
106
|
{
|
108
107
|
return key_;
|
109
108
|
}
|
110
109
|
|
111
|
-
const std::vector<std::uint8_t>& framing_extras()
|
110
|
+
[[nodiscard]] const std::vector<std::uint8_t>& framing_extras() const
|
112
111
|
{
|
113
112
|
return framing_extras_;
|
114
113
|
}
|
115
114
|
|
116
|
-
const std::vector<std::uint8_t>& extras()
|
115
|
+
[[nodiscard]] const std::vector<std::uint8_t>& extras() const
|
117
116
|
{
|
118
|
-
|
119
|
-
return empty;
|
117
|
+
return empty_buffer;
|
120
118
|
}
|
121
119
|
|
122
|
-
const std::vector<std::uint8_t>& value()
|
120
|
+
[[nodiscard]] const std::vector<std::uint8_t>& value() const
|
123
121
|
{
|
124
|
-
|
125
|
-
return empty;
|
122
|
+
return empty_buffer;
|
126
123
|
}
|
127
124
|
|
128
|
-
std::size_t size()
|
125
|
+
[[nodiscard]] std::size_t size() const
|
129
126
|
{
|
130
127
|
return key_.size();
|
131
128
|
}
|
@@ -48,7 +48,7 @@ class replace_response_body
|
|
48
48
|
std::uint16_t,
|
49
49
|
std::uint8_t extras_size,
|
50
50
|
const std::vector<uint8_t>& body,
|
51
|
-
const cmd_info&)
|
51
|
+
const cmd_info& /* info */)
|
52
52
|
{
|
53
53
|
Expects(header[1] == static_cast<uint8_t>(opcode));
|
54
54
|
if (status == protocol::status::success) {
|
@@ -119,7 +119,7 @@ class replace_request_body
|
|
119
119
|
framing_extras_[extras_size + 0] = static_cast<std::uint8_t>(static_cast<std::uint32_t>(frame_id) << 4U | 0U);
|
120
120
|
}
|
121
121
|
|
122
|
-
void content(const std::
|
122
|
+
void content(const std::string_view& content)
|
123
123
|
{
|
124
124
|
content_ = { content.begin(), content.end() };
|
125
125
|
}
|
@@ -134,17 +134,17 @@ class replace_request_body
|
|
134
134
|
expiry_ = value;
|
135
135
|
}
|
136
136
|
|
137
|
-
const std::string& key()
|
137
|
+
[[nodiscard]] const std::string& key() const
|
138
138
|
{
|
139
139
|
return key_;
|
140
140
|
}
|
141
141
|
|
142
|
-
const std::vector<std::uint8_t>& framing_extras()
|
142
|
+
[[nodiscard]] const std::vector<std::uint8_t>& framing_extras() const
|
143
143
|
{
|
144
144
|
return framing_extras_;
|
145
145
|
}
|
146
146
|
|
147
|
-
const std::vector<std::uint8_t>& extras()
|
147
|
+
[[nodiscard]] const std::vector<std::uint8_t>& extras()
|
148
148
|
{
|
149
149
|
if (extras_.empty()) {
|
150
150
|
fill_extention();
|
@@ -152,12 +152,12 @@ class replace_request_body
|
|
152
152
|
return extras_;
|
153
153
|
}
|
154
154
|
|
155
|
-
const std::vector<std::uint8_t>& value()
|
155
|
+
[[nodiscard]] const std::vector<std::uint8_t>& value() const
|
156
156
|
{
|
157
157
|
return content_;
|
158
158
|
}
|
159
159
|
|
160
|
-
std::size_t size()
|
160
|
+
[[nodiscard]] std::size_t size()
|
161
161
|
{
|
162
162
|
if (extras_.empty()) {
|
163
163
|
fill_extention();
|