couchbase 3.0.3-universal-darwin-20 → 3.1.1-universal-darwin-20
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 -3
- data/ext/CMakeLists.txt +4 -2
- data/ext/build_config.hxx.in +1 -1
- data/ext/build_version.hxx.in +2 -2
- data/ext/couchbase/bucket.hxx +1 -1
- data/ext/couchbase/capabilities.hxx +1 -1
- data/ext/couchbase/cluster.hxx +1 -1
- data/ext/couchbase/cluster_options.hxx +4 -1
- data/ext/couchbase/collections_manifest.hxx +1 -1
- data/ext/couchbase/configuration.hxx +1 -1
- data/ext/couchbase/couchbase.cxx +743 -927
- data/ext/couchbase/diagnostics.hxx +3 -3
- data/ext/couchbase/document_id.hxx +1 -1
- data/ext/couchbase/error_context/analytics.hxx +1 -1
- data/ext/couchbase/error_context/http.hxx +1 -1
- data/ext/couchbase/error_context/key_value.hxx +1 -1
- data/ext/couchbase/error_context/query.hxx +1 -1
- data/ext/couchbase/error_context/search.hxx +1 -1
- data/ext/couchbase/error_context/view.hxx +1 -1
- data/ext/couchbase/error_map.hxx +1 -1
- data/ext/couchbase/errors.hxx +1 -1
- data/ext/couchbase/io/dns_client.hxx +1 -1
- data/ext/couchbase/io/dns_codec.hxx +1 -1
- data/ext/couchbase/io/dns_config.hxx +1 -1
- data/ext/couchbase/io/dns_message.hxx +1 -1
- data/ext/couchbase/io/http_command.hxx +1 -1
- data/ext/couchbase/io/http_context.hxx +1 -1
- data/ext/couchbase/io/http_message.hxx +1 -1
- data/ext/couchbase/io/http_parser.hxx +1 -1
- data/ext/couchbase/io/http_session.hxx +1 -1
- data/ext/couchbase/io/http_session_manager.hxx +1 -1
- data/ext/couchbase/io/mcbp_command.hxx +1 -1
- data/ext/couchbase/io/mcbp_context.hxx +1 -1
- data/ext/couchbase/io/mcbp_message.hxx +1 -1
- data/ext/couchbase/io/mcbp_parser.hxx +1 -1
- data/ext/couchbase/io/mcbp_session.hxx +10 -1
- data/ext/couchbase/io/query_cache.hxx +1 -1
- data/ext/couchbase/io/retry_action.hxx +1 -1
- data/ext/couchbase/io/retry_context.hxx +1 -1
- data/ext/couchbase/io/retry_orchestrator.hxx +1 -1
- data/ext/couchbase/io/retry_reason.hxx +1 -1
- data/ext/couchbase/io/retry_strategy.hxx +1 -1
- data/ext/couchbase/io/streams.hxx +1 -1
- data/ext/couchbase/mutation_token.hxx +1 -1
- data/ext/couchbase/operations.hxx +1 -1
- data/ext/couchbase/operations/analytics_dataset_create.hxx +1 -1
- data/ext/couchbase/operations/analytics_dataset_drop.hxx +1 -1
- data/ext/couchbase/operations/analytics_dataset_get_all.hxx +1 -1
- data/ext/couchbase/operations/analytics_dataverse_create.hxx +1 -1
- data/ext/couchbase/operations/analytics_dataverse_drop.hxx +1 -1
- data/ext/couchbase/operations/analytics_get_pending_mutations.hxx +1 -1
- data/ext/couchbase/operations/analytics_index_create.hxx +1 -1
- data/ext/couchbase/operations/analytics_index_drop.hxx +1 -1
- data/ext/couchbase/operations/analytics_index_get_all.hxx +1 -1
- data/ext/couchbase/operations/analytics_link_connect.hxx +1 -1
- data/ext/couchbase/operations/analytics_link_disconnect.hxx +1 -1
- data/ext/couchbase/operations/bucket_create.hxx +1 -1
- data/ext/couchbase/operations/bucket_drop.hxx +1 -1
- data/ext/couchbase/operations/bucket_flush.hxx +1 -1
- data/ext/couchbase/operations/bucket_get.hxx +1 -1
- data/ext/couchbase/operations/bucket_get_all.hxx +1 -1
- data/ext/couchbase/operations/bucket_update.hxx +1 -1
- data/ext/couchbase/operations/cluster_developer_preview_enable.hxx +1 -1
- data/ext/couchbase/operations/collection_create.hxx +13 -9
- data/ext/couchbase/operations/collection_drop.hxx +11 -7
- data/ext/couchbase/operations/collections_manifest_get.hxx +1 -1
- data/ext/couchbase/operations/design_document.hxx +1 -1
- data/ext/couchbase/operations/document_analytics.hxx +1 -1
- data/ext/couchbase/operations/document_append.hxx +1 -1
- data/ext/couchbase/operations/document_decrement.hxx +5 -1
- data/ext/couchbase/operations/document_exists.hxx +1 -1
- data/ext/couchbase/operations/document_get.hxx +1 -1
- data/ext/couchbase/operations/document_get_and_lock.hxx +1 -1
- data/ext/couchbase/operations/document_get_and_touch.hxx +1 -1
- data/ext/couchbase/operations/document_get_projected.hxx +1 -1
- data/ext/couchbase/operations/document_increment.hxx +5 -1
- data/ext/couchbase/operations/document_insert.hxx +1 -1
- data/ext/couchbase/operations/document_lookup_in.hxx +1 -1
- data/ext/couchbase/operations/document_mutate_in.hxx +5 -1
- data/ext/couchbase/operations/document_prepend.hxx +1 -1
- data/ext/couchbase/operations/document_query.hxx +9 -1
- data/ext/couchbase/operations/document_remove.hxx +1 -1
- data/ext/couchbase/operations/document_replace.hxx +5 -1
- data/ext/couchbase/operations/document_search.hxx +1 -1
- data/ext/couchbase/operations/document_touch.hxx +1 -1
- data/ext/couchbase/operations/document_unlock.hxx +1 -1
- data/ext/couchbase/operations/document_upsert.hxx +5 -1
- data/ext/couchbase/operations/document_view.hxx +1 -1
- data/ext/couchbase/operations/group_drop.hxx +1 -1
- data/ext/couchbase/operations/group_get.hxx +1 -1
- data/ext/couchbase/operations/group_get_all.hxx +1 -1
- data/ext/couchbase/operations/group_upsert.hxx +1 -1
- data/ext/couchbase/operations/http_noop.hxx +1 -1
- data/ext/couchbase/operations/mcbp_noop.hxx +1 -1
- data/ext/couchbase/operations/query_index_build_deferred.hxx +1 -1
- data/ext/couchbase/operations/query_index_create.hxx +1 -1
- data/ext/couchbase/operations/query_index_drop.hxx +1 -1
- data/ext/couchbase/operations/query_index_get_all.hxx +1 -1
- data/ext/couchbase/operations/rbac.hxx +1 -1
- data/ext/couchbase/operations/role_get_all.hxx +1 -1
- data/ext/couchbase/operations/scope_create.hxx +9 -8
- data/ext/couchbase/operations/scope_drop.hxx +9 -6
- data/ext/couchbase/operations/scope_get_all.hxx +2 -2
- data/ext/couchbase/operations/search_get_stats.hxx +1 -1
- data/ext/couchbase/operations/search_index.hxx +1 -1
- data/ext/couchbase/operations/search_index_analyze_document.hxx +1 -1
- data/ext/couchbase/operations/search_index_control_ingest.hxx +1 -1
- data/ext/couchbase/operations/search_index_control_plan_freeze.hxx +1 -1
- data/ext/couchbase/operations/search_index_control_query.hxx +1 -1
- data/ext/couchbase/operations/search_index_drop.hxx +1 -1
- data/ext/couchbase/operations/search_index_get.hxx +1 -1
- data/ext/couchbase/operations/search_index_get_all.hxx +1 -1
- data/ext/couchbase/operations/search_index_get_documents_count.hxx +1 -1
- data/ext/couchbase/operations/search_index_get_stats.hxx +1 -1
- data/ext/couchbase/operations/search_index_upsert.hxx +1 -1
- data/ext/couchbase/operations/user_drop.hxx +1 -1
- data/ext/couchbase/operations/user_get.hxx +1 -1
- data/ext/couchbase/operations/user_get_all.hxx +1 -1
- data/ext/couchbase/operations/user_upsert.hxx +1 -1
- data/ext/couchbase/operations/view_index_drop.hxx +1 -1
- data/ext/couchbase/operations/view_index_get.hxx +1 -1
- data/ext/couchbase/operations/view_index_get_all.hxx +1 -1
- data/ext/couchbase/operations/view_index_upsert.hxx +1 -1
- data/ext/couchbase/origin.hxx +1 -1
- data/ext/couchbase/protocol/client_opcode.hxx +6 -1
- data/ext/couchbase/protocol/client_request.hxx +1 -1
- data/ext/couchbase/protocol/client_response.hxx +1 -1
- data/ext/couchbase/protocol/cmd_append.hxx +1 -1
- data/ext/couchbase/protocol/cmd_cluster_map_change_notification.hxx +1 -1
- data/ext/couchbase/protocol/cmd_decrement.hxx +19 -9
- data/ext/couchbase/protocol/cmd_exists.hxx +1 -1
- data/ext/couchbase/protocol/cmd_get.hxx +1 -1
- data/ext/couchbase/protocol/cmd_get_and_lock.hxx +1 -1
- data/ext/couchbase/protocol/cmd_get_and_touch.hxx +1 -1
- data/ext/couchbase/protocol/cmd_get_cluster_config.hxx +1 -1
- data/ext/couchbase/protocol/cmd_get_collection_id.hxx +7 -7
- data/ext/couchbase/protocol/cmd_get_collections_manifest.hxx +1 -1
- data/ext/couchbase/protocol/cmd_get_error_map.hxx +1 -1
- data/ext/couchbase/protocol/cmd_hello.hxx +17 -4
- data/ext/couchbase/protocol/cmd_increment.hxx +19 -9
- data/ext/couchbase/protocol/cmd_info.hxx +1 -1
- data/ext/couchbase/protocol/cmd_insert.hxx +1 -1
- data/ext/couchbase/protocol/cmd_lookup_in.hxx +1 -1
- data/ext/couchbase/protocol/cmd_mutate_in.hxx +18 -9
- data/ext/couchbase/protocol/cmd_noop.hxx +1 -1
- data/ext/couchbase/protocol/cmd_prepend.hxx +1 -1
- data/ext/couchbase/protocol/cmd_remove.hxx +1 -1
- data/ext/couchbase/protocol/cmd_replace.hxx +17 -8
- data/ext/couchbase/protocol/cmd_sasl_auth.hxx +1 -1
- data/ext/couchbase/protocol/cmd_sasl_list_mechs.hxx +1 -1
- data/ext/couchbase/protocol/cmd_sasl_step.hxx +1 -1
- data/ext/couchbase/protocol/cmd_select_bucket.hxx +1 -1
- data/ext/couchbase/protocol/cmd_touch.hxx +1 -1
- data/ext/couchbase/protocol/cmd_unlock.hxx +1 -1
- data/ext/couchbase/protocol/cmd_upsert.hxx +17 -8
- data/ext/couchbase/protocol/datatype.hxx +1 -1
- data/ext/couchbase/protocol/durability_level.hxx +1 -1
- data/ext/couchbase/protocol/enhanced_error_info.hxx +1 -1
- data/ext/couchbase/protocol/frame_info_id.hxx +2 -2
- data/ext/couchbase/protocol/hello_feature.hxx +1 -1
- data/ext/couchbase/protocol/magic.hxx +1 -1
- data/ext/couchbase/protocol/server_opcode.hxx +1 -1
- data/ext/couchbase/protocol/server_request.hxx +1 -1
- data/ext/couchbase/protocol/status.hxx +1 -1
- data/ext/couchbase/service_type.hxx +1 -1
- data/ext/couchbase/timeout_defaults.hxx +1 -1
- data/ext/couchbase/utils/byteswap.hxx +1 -1
- data/ext/couchbase/utils/connection_string.hxx +28 -1
- data/ext/couchbase/version.hxx +2 -2
- data/ext/extconf.rb +1 -1
- data/ext/test/test_helper.hxx +1 -1
- data/ext/test/test_helper_native.hxx +1 -1
- data/ext/test/test_helper_ruby.hxx +1 -1
- data/ext/test/test_native_binary_operations.cxx +1 -1
- data/ext/test/test_native_diagnostics.cxx +1 -1
- data/ext/test/test_native_trivial_crud.cxx +1 -1
- data/ext/test/test_ruby_trivial_crud.cxx +1 -1
- data/ext/test/test_ruby_trivial_query.cxx +1 -1
- data/lib/active_support/cache/couchbase_store.rb +2 -1
- data/lib/couchbase.rb +1 -1
- data/lib/couchbase/analytics_options.rb +1 -1
- data/lib/couchbase/authenticator.rb +1 -1
- data/lib/couchbase/binary_collection.rb +1 -1
- data/lib/couchbase/binary_collection_options.rb +1 -1
- data/lib/couchbase/bucket.rb +1 -1
- data/lib/couchbase/cluster.rb +2 -2
- data/lib/couchbase/collection.rb +1 -1
- data/lib/couchbase/collection_options.rb +25 -19
- data/lib/couchbase/configuration.rb +1 -1
- data/lib/couchbase/datastructures.rb +1 -1
- data/lib/couchbase/datastructures/couchbase_list.rb +1 -1
- data/lib/couchbase/datastructures/couchbase_map.rb +1 -1
- data/lib/couchbase/datastructures/couchbase_queue.rb +1 -1
- data/lib/couchbase/datastructures/couchbase_set.rb +1 -1
- data/lib/couchbase/diagnostics.rb +1 -1
- data/lib/couchbase/errors.rb +1 -1
- data/lib/couchbase/json_transcoder.rb +1 -1
- data/lib/couchbase/libcouchbase.bundle +0 -0
- data/lib/couchbase/logger.rb +1 -1
- data/lib/couchbase/management.rb +1 -1
- data/lib/couchbase/management/analytics_index_manager.rb +1 -1
- data/lib/couchbase/management/bucket_manager.rb +1 -1
- data/lib/couchbase/management/collection_manager.rb +8 -1
- data/lib/couchbase/management/query_index_manager.rb +1 -1
- data/lib/couchbase/management/search_index_manager.rb +1 -1
- data/lib/couchbase/management/user_manager.rb +1 -1
- data/lib/couchbase/management/view_index_manager.rb +1 -1
- data/lib/couchbase/mutation_state.rb +1 -1
- data/lib/couchbase/options.rb +49 -4
- data/lib/couchbase/query_options.rb +1 -1
- data/lib/couchbase/railtie.rb +1 -1
- data/lib/couchbase/scope.rb +7 -6
- data/lib/couchbase/search_options.rb +1 -1
- data/lib/couchbase/subdoc.rb +2 -2
- data/lib/couchbase/utils.rb +1 -1
- data/lib/couchbase/utils/time.rb +1 -1
- data/lib/couchbase/version.rb +9 -9
- data/lib/couchbase/view_options.rb +1 -1
- data/lib/rails/generators/couchbase/config/config_generator.rb +1 -1
- metadata +5 -5
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
data/ext/couchbase/origin.hxx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -233,6 +233,7 @@ enum class client_opcode : uint8_t {
|
|
233
233
|
enum class subdoc_opcode : uint8_t {
|
234
234
|
get_doc = 0x00,
|
235
235
|
set_doc = 0x01,
|
236
|
+
remove_doc = 0x04,
|
236
237
|
get = 0xc5,
|
237
238
|
exists = 0xc6,
|
238
239
|
dict_add = 0xc7,
|
@@ -345,6 +346,7 @@ is_valid_subdoc_opcode(uint8_t code)
|
|
345
346
|
case subdoc_opcode::get_count:
|
346
347
|
case subdoc_opcode::get_doc:
|
347
348
|
case subdoc_opcode::set_doc:
|
349
|
+
case subdoc_opcode::remove_doc:
|
348
350
|
case subdoc_opcode::replace_body_with_xattr:
|
349
351
|
return true;
|
350
352
|
}
|
@@ -626,6 +628,9 @@ struct fmt::formatter<couchbase::protocol::subdoc_opcode> : formatter<string_vie
|
|
626
628
|
case couchbase::protocol::subdoc_opcode::replace_body_with_xattr:
|
627
629
|
name = "replace_body_with_xattr (0xd3)";
|
628
630
|
break;
|
631
|
+
case couchbase::protocol::subdoc_opcode::remove_doc:
|
632
|
+
name = "remove_doc (0x04)";
|
633
|
+
break;
|
629
634
|
}
|
630
635
|
return formatter<string_view>::format(name, ctx);
|
631
636
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -48,7 +48,7 @@ class decrement_response_body
|
|
48
48
|
bool parse(protocol::status status,
|
49
49
|
const header_buffer& header,
|
50
50
|
std::uint8_t framing_extras_size,
|
51
|
-
std::uint16_t
|
51
|
+
std::uint16_t key_size,
|
52
52
|
std::uint8_t extras_size,
|
53
53
|
const std::vector<uint8_t>& body,
|
54
54
|
const cmd_info&)
|
@@ -66,6 +66,7 @@ class decrement_response_body
|
|
66
66
|
token_.sequence_number = utils::byte_swap_64(token_.sequence_number);
|
67
67
|
offset += 8;
|
68
68
|
}
|
69
|
+
offset += key_size;
|
69
70
|
memcpy(&content_, body.data() + offset, sizeof(content_));
|
70
71
|
content_ = utils::byte_swap_64(content_);
|
71
72
|
return true;
|
@@ -119,19 +120,28 @@ class decrement_request_body
|
|
119
120
|
return;
|
120
121
|
}
|
121
122
|
auto frame_id = static_cast<uint8_t>(protocol::request_frame_info_id::durability_requirement);
|
123
|
+
auto extras_size = framing_extras_.size();
|
122
124
|
if (timeout) {
|
123
|
-
framing_extras_.resize(4);
|
124
|
-
framing_extras_[0] = static_cast<std::uint8_t>((static_cast<std::uint32_t>(frame_id) << 4U) | 3U);
|
125
|
-
framing_extras_[1] = static_cast<std::uint8_t>(level);
|
125
|
+
framing_extras_.resize(extras_size + 4);
|
126
|
+
framing_extras_[extras_size + 0] = static_cast<std::uint8_t>((static_cast<std::uint32_t>(frame_id) << 4U) | 3U);
|
127
|
+
framing_extras_[extras_size + 1] = static_cast<std::uint8_t>(level);
|
126
128
|
uint16_t val = htons(*timeout);
|
127
|
-
memcpy(framing_extras_.data() + 2, &val, sizeof(val));
|
129
|
+
memcpy(framing_extras_.data() + extras_size + 2, &val, sizeof(val));
|
128
130
|
} else {
|
129
|
-
framing_extras_.resize(2);
|
130
|
-
framing_extras_[0] = static_cast<std::uint8_t>(static_cast<std::uint32_t>(frame_id) << 4U | 1U);
|
131
|
-
framing_extras_[1] = static_cast<std::uint8_t>(level);
|
131
|
+
framing_extras_.resize(extras_size + 2);
|
132
|
+
framing_extras_[extras_size + 0] = static_cast<std::uint8_t>(static_cast<std::uint32_t>(frame_id) << 4U | 1U);
|
133
|
+
framing_extras_[extras_size + 1] = static_cast<std::uint8_t>(level);
|
132
134
|
}
|
133
135
|
}
|
134
136
|
|
137
|
+
void preserve_expiry()
|
138
|
+
{
|
139
|
+
auto frame_id = static_cast<uint8_t>(protocol::request_frame_info_id::preserve_ttl);
|
140
|
+
auto extras_size = framing_extras_.size();
|
141
|
+
framing_extras_.resize(extras_size + 1);
|
142
|
+
framing_extras_[extras_size + 0] = static_cast<std::uint8_t>(static_cast<std::uint32_t>(frame_id) << 4U | 0U);
|
143
|
+
}
|
144
|
+
|
135
145
|
const std::string& key()
|
136
146
|
{
|
137
147
|
return key_;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -77,17 +77,18 @@ class get_collection_id_request_body
|
|
77
77
|
static const inline client_opcode opcode = client_opcode::get_collection_id;
|
78
78
|
|
79
79
|
private:
|
80
|
-
std::
|
80
|
+
std::vector<std::uint8_t> value_{};
|
81
81
|
|
82
82
|
public:
|
83
83
|
void collection_path(const std::string& path)
|
84
84
|
{
|
85
|
-
|
85
|
+
value_.assign(path.begin(), path.end());
|
86
86
|
}
|
87
87
|
|
88
88
|
const std::string& key()
|
89
89
|
{
|
90
|
-
|
90
|
+
static std::string empty;
|
91
|
+
return empty;
|
91
92
|
}
|
92
93
|
|
93
94
|
const std::vector<std::uint8_t>& framing_extras()
|
@@ -104,13 +105,12 @@ class get_collection_id_request_body
|
|
104
105
|
|
105
106
|
const std::vector<std::uint8_t>& value()
|
106
107
|
{
|
107
|
-
|
108
|
-
return empty;
|
108
|
+
return value_;
|
109
109
|
}
|
110
110
|
|
111
111
|
std::size_t size()
|
112
112
|
{
|
113
|
-
return
|
113
|
+
return value_.size();
|
114
114
|
}
|
115
115
|
};
|
116
116
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -80,17 +80,15 @@ class hello_request_body
|
|
80
80
|
hello_feature::xattr,
|
81
81
|
hello_feature::xerror,
|
82
82
|
hello_feature::select_bucket,
|
83
|
-
hello_feature::snappy,
|
84
83
|
hello_feature::json,
|
85
84
|
hello_feature::duplex,
|
86
|
-
hello_feature::clustermap_change_notification,
|
87
|
-
hello_feature::unordered_execution,
|
88
85
|
hello_feature::alt_request_support,
|
89
86
|
hello_feature::tracing,
|
90
87
|
hello_feature::sync_replication,
|
91
88
|
hello_feature::vattr,
|
92
89
|
hello_feature::collections,
|
93
90
|
hello_feature::subdoc_create_as_deleted,
|
91
|
+
hello_feature::preserve_ttl,
|
94
92
|
};
|
95
93
|
std::vector<std::uint8_t> value_;
|
96
94
|
|
@@ -105,6 +103,21 @@ class hello_request_body
|
|
105
103
|
return key_;
|
106
104
|
}
|
107
105
|
|
106
|
+
void enable_unordered_execution()
|
107
|
+
{
|
108
|
+
features_.emplace_back(hello_feature::unordered_execution);
|
109
|
+
}
|
110
|
+
|
111
|
+
void enable_clustermap_change_notification()
|
112
|
+
{
|
113
|
+
features_.emplace_back(hello_feature::clustermap_change_notification);
|
114
|
+
}
|
115
|
+
|
116
|
+
void enable_compression()
|
117
|
+
{
|
118
|
+
features_.emplace_back(hello_feature::snappy);
|
119
|
+
}
|
120
|
+
|
108
121
|
[[nodiscard]] const std::vector<hello_feature>& features() const
|
109
122
|
{
|
110
123
|
return features_;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -48,7 +48,7 @@ class increment_response_body
|
|
48
48
|
bool parse(protocol::status status,
|
49
49
|
const header_buffer& header,
|
50
50
|
std::uint8_t framing_extras_size,
|
51
|
-
std::uint16_t
|
51
|
+
std::uint16_t key_size,
|
52
52
|
std::uint8_t extras_size,
|
53
53
|
const std::vector<uint8_t>& body,
|
54
54
|
const cmd_info&)
|
@@ -66,6 +66,7 @@ class increment_response_body
|
|
66
66
|
token_.sequence_number = utils::byte_swap_64(token_.sequence_number);
|
67
67
|
offset += 8;
|
68
68
|
}
|
69
|
+
offset += key_size;
|
69
70
|
memcpy(&content_, body.data() + offset, sizeof(content_));
|
70
71
|
content_ = utils::byte_swap_64(content_);
|
71
72
|
return true;
|
@@ -119,19 +120,28 @@ class increment_request_body
|
|
119
120
|
return;
|
120
121
|
}
|
121
122
|
auto frame_id = static_cast<uint8_t>(protocol::request_frame_info_id::durability_requirement);
|
123
|
+
auto extras_size = framing_extras_.size();
|
122
124
|
if (timeout) {
|
123
|
-
framing_extras_.resize(4);
|
124
|
-
framing_extras_[0] = static_cast<std::uint8_t>((static_cast<std::uint32_t>(frame_id) << 4U) | 3U);
|
125
|
-
framing_extras_[1] = static_cast<std::uint8_t>(level);
|
125
|
+
framing_extras_.resize(extras_size + 4);
|
126
|
+
framing_extras_[extras_size + 0] = static_cast<std::uint8_t>((static_cast<std::uint32_t>(frame_id) << 4U) | 3U);
|
127
|
+
framing_extras_[extras_size + 1] = static_cast<std::uint8_t>(level);
|
126
128
|
uint16_t val = htons(*timeout);
|
127
|
-
memcpy(framing_extras_.data() + 2, &val, sizeof(val));
|
129
|
+
memcpy(framing_extras_.data() + extras_size + 2, &val, sizeof(val));
|
128
130
|
} else {
|
129
|
-
framing_extras_.resize(2);
|
130
|
-
framing_extras_[0] = static_cast<std::uint8_t>(static_cast<std::uint32_t>(frame_id) << 4U | 1U);
|
131
|
-
framing_extras_[1] = static_cast<std::uint8_t>(level);
|
131
|
+
framing_extras_.resize(extras_size + 2);
|
132
|
+
framing_extras_[extras_size + 0] = static_cast<std::uint8_t>(static_cast<std::uint32_t>(frame_id) << 4U | 1U);
|
133
|
+
framing_extras_[extras_size + 1] = static_cast<std::uint8_t>(level);
|
132
134
|
}
|
133
135
|
}
|
134
136
|
|
137
|
+
void preserve_expiry()
|
138
|
+
{
|
139
|
+
auto frame_id = static_cast<uint8_t>(protocol::request_frame_info_id::preserve_ttl);
|
140
|
+
auto extras_size = framing_extras_.size();
|
141
|
+
framing_extras_.resize(extras_size + 1);
|
142
|
+
framing_extras_[extras_size + 0] = static_cast<std::uint8_t>(static_cast<std::uint32_t>(frame_id) << 4U | 0U);
|
143
|
+
}
|
144
|
+
|
135
145
|
const std::string& key()
|
136
146
|
{
|
137
147
|
return key_;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
4
|
*
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
* you may not use this file except in compliance with the License.
|
@@ -224,7 +224,7 @@ class mutate_in_request_body
|
|
224
224
|
|
225
225
|
void add_spec(subdoc_opcode operation, bool xattr, const std::string& path)
|
226
226
|
{
|
227
|
-
Expects(operation == protocol::subdoc_opcode::remove);
|
227
|
+
Expects(operation == protocol::subdoc_opcode::remove || operation == protocol::subdoc_opcode::remove_doc);
|
228
228
|
add_spec(static_cast<std::uint8_t>(operation), build_path_flags(xattr, false, false), path, "");
|
229
229
|
}
|
230
230
|
|
@@ -305,19 +305,28 @@ class mutate_in_request_body
|
|
305
305
|
return;
|
306
306
|
}
|
307
307
|
auto frame_id = static_cast<uint8_t>(protocol::request_frame_info_id::durability_requirement);
|
308
|
+
auto extras_size = framing_extras_.size();
|
308
309
|
if (timeout) {
|
309
|
-
framing_extras_.resize(4);
|
310
|
-
framing_extras_[0] = static_cast<std::uint8_t>((static_cast<std::uint32_t>(frame_id) << 4U) | 3U);
|
311
|
-
framing_extras_[1] = static_cast<std::uint8_t>(level);
|
310
|
+
framing_extras_.resize(extras_size + 4);
|
311
|
+
framing_extras_[extras_size + 0] = static_cast<std::uint8_t>((static_cast<std::uint32_t>(frame_id) << 4U) | 3U);
|
312
|
+
framing_extras_[extras_size + 1] = static_cast<std::uint8_t>(level);
|
312
313
|
uint16_t val = htons(*timeout);
|
313
|
-
memcpy(framing_extras_.data() + 2, &val, sizeof(val));
|
314
|
+
memcpy(framing_extras_.data() + extras_size + 2, &val, sizeof(val));
|
314
315
|
} else {
|
315
|
-
framing_extras_.resize(2);
|
316
|
-
framing_extras_[0] = static_cast<std::uint8_t>(static_cast<std::uint32_t>(frame_id) << 4U | 1U);
|
317
|
-
framing_extras_[1] = static_cast<std::uint8_t>(level);
|
316
|
+
framing_extras_.resize(extras_size + 2);
|
317
|
+
framing_extras_[extras_size + 0] = static_cast<std::uint8_t>(static_cast<std::uint32_t>(frame_id) << 4U | 1U);
|
318
|
+
framing_extras_[extras_size + 1] = static_cast<std::uint8_t>(level);
|
318
319
|
}
|
319
320
|
}
|
320
321
|
|
322
|
+
void preserve_expiry()
|
323
|
+
{
|
324
|
+
auto frame_id = static_cast<uint8_t>(protocol::request_frame_info_id::preserve_ttl);
|
325
|
+
auto extras_size = framing_extras_.size();
|
326
|
+
framing_extras_.resize(extras_size + 1);
|
327
|
+
framing_extras_[extras_size + 0] = static_cast<std::uint8_t>(static_cast<std::uint32_t>(frame_id) << 4U | 0U);
|
328
|
+
}
|
329
|
+
|
321
330
|
const std::string& key()
|
322
331
|
{
|
323
332
|
return key_;
|