couchbase 3.0.0.alpha.5 → 3.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +12 -3
  3. data/README.md +4 -2
  4. data/Rakefile +1 -1
  5. data/couchbase.gemspec +17 -12
  6. data/ext/.idea/misc.xml +12 -0
  7. data/ext/CMakeLists.txt +10 -1
  8. data/ext/build_config.hxx.in +20 -0
  9. data/ext/build_version.hxx.in +1 -1
  10. data/ext/couchbase/bucket.hxx +90 -24
  11. data/ext/couchbase/cluster.hxx +125 -84
  12. data/ext/couchbase/cluster_options.hxx +53 -0
  13. data/ext/couchbase/configuration.hxx +220 -2
  14. data/ext/couchbase/couchbase.cxx +134 -127
  15. data/ext/couchbase/io/dns_client.hxx +3 -1
  16. data/ext/couchbase/io/http_command.hxx +91 -0
  17. data/ext/couchbase/io/http_session.hxx +58 -19
  18. data/ext/couchbase/io/http_session_manager.hxx +26 -31
  19. data/ext/couchbase/io/mcbp_command.hxx +180 -0
  20. data/ext/couchbase/io/mcbp_message.hxx +5 -0
  21. data/ext/couchbase/io/mcbp_session.hxx +213 -98
  22. data/ext/couchbase/io/streams.hxx +165 -0
  23. data/ext/couchbase/operations.hxx +1 -1
  24. data/ext/couchbase/operations/analytics_dataset_create.hxx +1 -1
  25. data/ext/couchbase/operations/bucket_create.hxx +4 -2
  26. data/ext/couchbase/operations/bucket_drop.hxx +4 -2
  27. data/ext/couchbase/operations/bucket_flush.hxx +4 -2
  28. data/ext/couchbase/operations/bucket_get.hxx +4 -2
  29. data/ext/couchbase/operations/bucket_get_all.hxx +4 -2
  30. data/ext/couchbase/operations/bucket_update.hxx +4 -2
  31. data/ext/couchbase/operations/cluster_developer_preview_enable.hxx +4 -2
  32. data/ext/couchbase/operations/collection_create.hxx +4 -2
  33. data/ext/couchbase/operations/collection_drop.hxx +4 -2
  34. data/ext/couchbase/operations/document_analytics.hxx +0 -4
  35. data/ext/couchbase/operations/document_decrement.hxx +6 -3
  36. data/ext/couchbase/operations/document_get.hxx +3 -0
  37. data/ext/couchbase/operations/document_get_and_lock.hxx +3 -0
  38. data/ext/couchbase/operations/document_get_and_touch.hxx +5 -2
  39. data/ext/couchbase/operations/document_get_projected.hxx +12 -9
  40. data/ext/couchbase/operations/document_increment.hxx +6 -3
  41. data/ext/couchbase/operations/document_insert.hxx +5 -2
  42. data/ext/couchbase/operations/document_lookup_in.hxx +3 -0
  43. data/ext/couchbase/operations/document_mutate_in.hxx +6 -3
  44. data/ext/couchbase/operations/document_remove.hxx +3 -0
  45. data/ext/couchbase/operations/document_replace.hxx +5 -2
  46. data/ext/couchbase/operations/document_search.hxx +6 -7
  47. data/ext/couchbase/operations/document_touch.hxx +5 -2
  48. data/ext/couchbase/operations/document_unlock.hxx +3 -0
  49. data/ext/couchbase/operations/document_upsert.hxx +5 -2
  50. data/ext/couchbase/operations/query_index_build_deferred.hxx +3 -3
  51. data/ext/couchbase/operations/query_index_create.hxx +3 -3
  52. data/ext/couchbase/operations/query_index_drop.hxx +3 -3
  53. data/ext/couchbase/operations/query_index_get_all.hxx +3 -3
  54. data/ext/couchbase/operations/scope_create.hxx +4 -2
  55. data/ext/couchbase/operations/scope_drop.hxx +4 -2
  56. data/ext/couchbase/operations/scope_get_all.hxx +4 -2
  57. data/ext/couchbase/operations/search_index_analyze_document.hxx +2 -2
  58. data/ext/couchbase/operations/search_index_control_ingest.hxx +2 -2
  59. data/ext/couchbase/operations/search_index_control_plan_freeze.hxx +2 -2
  60. data/ext/couchbase/operations/search_index_control_query.hxx +2 -2
  61. data/ext/couchbase/operations/search_index_drop.hxx +2 -2
  62. data/ext/couchbase/operations/search_index_get.hxx +2 -2
  63. data/ext/couchbase/operations/search_index_get_all.hxx +2 -2
  64. data/ext/couchbase/operations/search_index_get_documents_count.hxx +2 -2
  65. data/ext/couchbase/operations/search_index_upsert.hxx +2 -2
  66. data/ext/couchbase/origin.hxx +148 -0
  67. data/ext/couchbase/protocol/cmd_cluster_map_change_notification.hxx +1 -6
  68. data/ext/couchbase/protocol/cmd_decrement.hxx +5 -5
  69. data/ext/couchbase/protocol/cmd_get_and_touch.hxx +5 -5
  70. data/ext/couchbase/protocol/cmd_get_cluster_config.hxx +1 -6
  71. data/ext/couchbase/protocol/cmd_increment.hxx +5 -5
  72. data/ext/couchbase/protocol/cmd_info.hxx +0 -11
  73. data/ext/couchbase/protocol/cmd_insert.hxx +5 -5
  74. data/ext/couchbase/protocol/cmd_mutate_in.hxx +6 -6
  75. data/ext/couchbase/protocol/cmd_replace.hxx +5 -5
  76. data/ext/couchbase/protocol/cmd_touch.hxx +1 -1
  77. data/ext/couchbase/protocol/cmd_upsert.hxx +5 -5
  78. data/ext/couchbase/timeout_defaults.hxx +7 -0
  79. data/ext/couchbase/utils/connection_string.hxx +139 -0
  80. data/ext/extconf.rb +44 -11
  81. data/ext/test/main.cxx +93 -15
  82. data/ext/third_party/http_parser/Makefile +160 -0
  83. data/ext/third_party/json/Makefile +77 -0
  84. data/lib/couchbase/analytics_options.rb +18 -4
  85. data/lib/couchbase/binary_collection.rb +2 -2
  86. data/lib/couchbase/binary_collection_options.rb +2 -2
  87. data/lib/couchbase/bucket.rb +4 -4
  88. data/lib/couchbase/cluster.rb +60 -46
  89. data/lib/couchbase/collection.rb +13 -13
  90. data/lib/couchbase/collection_options.rb +15 -9
  91. data/{bin/console → lib/couchbase/datastructures.rb} +4 -7
  92. data/lib/couchbase/datastructures/couchbase_list.rb +171 -0
  93. data/lib/couchbase/datastructures/couchbase_map.rb +205 -0
  94. data/lib/couchbase/datastructures/couchbase_queue.rb +145 -0
  95. data/lib/couchbase/datastructures/couchbase_set.rb +138 -0
  96. data/lib/couchbase/errors.rb +66 -63
  97. data/lib/couchbase/management/user_manager.rb +1 -1
  98. data/lib/couchbase/mutation_state.rb +1 -0
  99. data/lib/couchbase/query_options.rb +25 -2
  100. data/lib/couchbase/scope.rb +0 -7
  101. data/lib/couchbase/search_options.rb +7 -0
  102. data/lib/couchbase/version.rb +1 -1
  103. data/lib/couchbase/view_options.rb +4 -3
  104. metadata +20 -82
  105. data/.github/workflows/tests-6.0.3.yml +0 -52
  106. data/.github/workflows/tests-dev-preview.yml +0 -55
  107. data/.github/workflows/tests.yml +0 -50
  108. data/.gitignore +0 -20
  109. data/.gitmodules +0 -21
  110. data/.idea/.gitignore +0 -5
  111. data/.idea/dictionaries/gem_terms.xml +0 -18
  112. data/.idea/inspectionProfiles/Project_Default.xml +0 -8
  113. data/.idea/vcs.xml +0 -13
  114. data/bin/check-cluster +0 -31
  115. data/bin/fetch-stats +0 -19
  116. data/bin/init-cluster +0 -82
  117. data/bin/jenkins/build-extension +0 -35
  118. data/bin/jenkins/install-dependencies +0 -47
  119. data/bin/jenkins/test-with-cbdyncluster +0 -58
  120. data/bin/setup +0 -24
  121. data/ext/couchbase/configuration_monitor.hxx +0 -93
  122. data/ext/couchbase/operations/command.hxx +0 -163
  123. data/rbi/couchbase.rbi +0 -79
@@ -36,7 +36,7 @@ struct query_index_get_all_response {
36
36
  std::vector<std::string> index_key{};
37
37
  std::optional<std::string> condition{};
38
38
  };
39
- uuid::uuid_t client_context_id;
39
+ std::string client_context_id;
40
40
  std::error_code ec;
41
41
  std::string status{};
42
42
  std::vector<query_index> indexes{};
@@ -49,7 +49,7 @@ struct query_index_get_all_request {
49
49
 
50
50
  static const inline service_type type = service_type::query;
51
51
 
52
- uuid::uuid_t client_context_id{ uuid::random() };
52
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
53
53
  std::string bucket_name;
54
54
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
55
55
 
@@ -61,7 +61,7 @@ struct query_index_get_all_request {
61
61
  fmt::format(
62
62
  R"(SELECT idx.* FROM system:indexes AS idx WHERE keyspace_id = "{}" AND `using`="gsi" ORDER BY is_primary DESC, name ASC)",
63
63
  bucket_name) },
64
- { "client_context_id", uuid::to_string(client_context_id) }
64
+ { "client_context_id", client_context_id }
65
65
  };
66
66
  encoded.method = "POST";
67
67
  encoded.path = "/query/service";
@@ -27,6 +27,7 @@ namespace couchbase::operations
27
27
  {
28
28
 
29
29
  struct scope_create_response {
30
+ std::string client_context_id;
30
31
  std::error_code ec;
31
32
  std::uint64_t uid{ 0 };
32
33
  };
@@ -41,6 +42,7 @@ struct scope_create_request {
41
42
  std::string bucket_name;
42
43
  std::string scope_name;
43
44
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
45
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
44
46
 
45
47
  void encode_to(encoded_request_type& encoded)
46
48
  {
@@ -52,9 +54,9 @@ struct scope_create_request {
52
54
  };
53
55
 
54
56
  scope_create_response
55
- make_response(std::error_code ec, scope_create_request&, scope_create_request::encoded_response_type encoded)
57
+ make_response(std::error_code ec, scope_create_request& request, scope_create_request::encoded_response_type encoded)
56
58
  {
57
- scope_create_response response{ ec };
59
+ scope_create_response response{ request.client_context_id, ec };
58
60
  if (!ec) {
59
61
  switch (encoded.status_code) {
60
62
  case 400:
@@ -27,6 +27,7 @@ namespace couchbase::operations
27
27
  {
28
28
 
29
29
  struct scope_drop_response {
30
+ std::string client_context_id;
30
31
  std::error_code ec;
31
32
  std::uint64_t uid{ 0 };
32
33
  };
@@ -41,6 +42,7 @@ struct scope_drop_request {
41
42
  std::string bucket_name;
42
43
  std::string scope_name;
43
44
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
45
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
44
46
 
45
47
  void encode_to(encoded_request_type& encoded)
46
48
  {
@@ -50,9 +52,9 @@ struct scope_drop_request {
50
52
  };
51
53
 
52
54
  scope_drop_response
53
- make_response(std::error_code ec, scope_drop_request&, scope_drop_request::encoded_response_type encoded)
55
+ make_response(std::error_code ec, scope_drop_request& request, scope_drop_request::encoded_response_type encoded)
54
56
  {
55
- scope_drop_response response{ ec };
57
+ scope_drop_response response{ request.client_context_id, ec };
56
58
  if (!ec) {
57
59
  switch (encoded.status_code) {
58
60
  case 400:
@@ -27,6 +27,7 @@ namespace couchbase::operations
27
27
  {
28
28
 
29
29
  struct scope_get_all_response {
30
+ std::string client_context_id;
30
31
  std::error_code ec;
31
32
  collections_manifest manifest{};
32
33
  };
@@ -40,6 +41,7 @@ struct scope_get_all_request {
40
41
 
41
42
  std::string bucket_name;
42
43
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
44
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
43
45
 
44
46
  void encode_to(encoded_request_type& encoded)
45
47
  {
@@ -49,9 +51,9 @@ struct scope_get_all_request {
49
51
  };
50
52
 
51
53
  scope_get_all_response
52
- make_response(std::error_code ec, scope_get_all_request&, scope_get_all_request::encoded_response_type encoded)
54
+ make_response(std::error_code ec, scope_get_all_request& request, scope_get_all_request::encoded_response_type encoded)
53
55
  {
54
- scope_get_all_response response{ ec };
56
+ scope_get_all_response response{ request.client_context_id, ec };
55
57
  if (!ec) {
56
58
  switch (encoded.status_code) {
57
59
  case 400:
@@ -24,7 +24,7 @@
24
24
  namespace couchbase::operations
25
25
  {
26
26
  struct search_index_analyze_document_response {
27
- uuid::uuid_t client_context_id;
27
+ std::string client_context_id;
28
28
  std::error_code ec;
29
29
  std::string status{};
30
30
  std::string error{};
@@ -38,7 +38,7 @@ struct search_index_analyze_document_request {
38
38
 
39
39
  static const inline service_type type = service_type::search;
40
40
 
41
- uuid::uuid_t client_context_id{ uuid::random() };
41
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
42
42
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
43
43
 
44
44
  std::string index_name;
@@ -24,7 +24,7 @@
24
24
  namespace couchbase::operations
25
25
  {
26
26
  struct search_index_control_ingest_response {
27
- uuid::uuid_t client_context_id;
27
+ std::string client_context_id;
28
28
  std::error_code ec;
29
29
  std::string status{};
30
30
  std::string error{};
@@ -37,7 +37,7 @@ struct search_index_control_ingest_request {
37
37
 
38
38
  static const inline service_type type = service_type::search;
39
39
 
40
- uuid::uuid_t client_context_id{ uuid::random() };
40
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
41
41
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
42
42
 
43
43
  std::string index_name;
@@ -24,7 +24,7 @@
24
24
  namespace couchbase::operations
25
25
  {
26
26
  struct search_index_control_plan_freeze_response {
27
- uuid::uuid_t client_context_id;
27
+ std::string client_context_id;
28
28
  std::error_code ec;
29
29
  std::string status{};
30
30
  std::string error{};
@@ -37,7 +37,7 @@ struct search_index_control_plan_freeze_request {
37
37
 
38
38
  static const inline service_type type = service_type::search;
39
39
 
40
- uuid::uuid_t client_context_id{ uuid::random() };
40
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
41
41
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
42
42
 
43
43
  std::string index_name;
@@ -24,7 +24,7 @@
24
24
  namespace couchbase::operations
25
25
  {
26
26
  struct search_index_control_query_response {
27
- uuid::uuid_t client_context_id;
27
+ std::string client_context_id;
28
28
  std::error_code ec;
29
29
  std::string status{};
30
30
  std::string error{};
@@ -37,7 +37,7 @@ struct search_index_control_query_request {
37
37
 
38
38
  static const inline service_type type = service_type::search;
39
39
 
40
- uuid::uuid_t client_context_id{ uuid::random() };
40
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
41
41
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
42
42
 
43
43
  std::string index_name;
@@ -24,7 +24,7 @@
24
24
  namespace couchbase::operations
25
25
  {
26
26
  struct search_index_drop_response {
27
- uuid::uuid_t client_context_id;
27
+ std::string client_context_id;
28
28
  std::error_code ec;
29
29
  std::string status{};
30
30
  std::string error{};
@@ -37,7 +37,7 @@ struct search_index_drop_request {
37
37
 
38
38
  static const inline service_type type = service_type::search;
39
39
 
40
- uuid::uuid_t client_context_id{ uuid::random() };
40
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
41
41
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
42
42
 
43
43
  std::string index_name;
@@ -25,7 +25,7 @@
25
25
  namespace couchbase::operations
26
26
  {
27
27
  struct search_index_get_response {
28
- uuid::uuid_t client_context_id;
28
+ std::string client_context_id;
29
29
  std::error_code ec;
30
30
  std::string status{};
31
31
  search_index index{};
@@ -39,7 +39,7 @@ struct search_index_get_request {
39
39
 
40
40
  static const inline service_type type = service_type::search;
41
41
 
42
- uuid::uuid_t client_context_id{ uuid::random() };
42
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
43
43
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
44
44
 
45
45
  std::string index_name;
@@ -25,7 +25,7 @@
25
25
  namespace couchbase::operations
26
26
  {
27
27
  struct search_index_get_all_response {
28
- uuid::uuid_t client_context_id;
28
+ std::string client_context_id;
29
29
  std::error_code ec;
30
30
  std::string status{};
31
31
  std::string impl_version{};
@@ -39,7 +39,7 @@ struct search_index_get_all_request {
39
39
 
40
40
  static const inline service_type type = service_type::search;
41
41
 
42
- uuid::uuid_t client_context_id{ uuid::random() };
42
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
43
43
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
44
44
 
45
45
  std::string index_name;
@@ -24,7 +24,7 @@
24
24
  namespace couchbase::operations
25
25
  {
26
26
  struct search_index_get_documents_count_response {
27
- uuid::uuid_t client_context_id;
27
+ std::string client_context_id;
28
28
  std::error_code ec;
29
29
  std::string status{};
30
30
  std::uint64_t count{ 0 };
@@ -38,7 +38,7 @@ struct search_index_get_documents_count_request {
38
38
 
39
39
  static const inline service_type type = service_type::search;
40
40
 
41
- uuid::uuid_t client_context_id{ uuid::random() };
41
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
42
42
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
43
43
 
44
44
  std::string index_name;
@@ -24,7 +24,7 @@
24
24
  namespace couchbase::operations
25
25
  {
26
26
  struct search_index_upsert_response {
27
- uuid::uuid_t client_context_id;
27
+ std::string client_context_id;
28
28
  std::error_code ec;
29
29
  std::string status{};
30
30
  std::string error{};
@@ -37,7 +37,7 @@ struct search_index_upsert_request {
37
37
 
38
38
  static const inline service_type type = service_type::search;
39
39
 
40
- uuid::uuid_t client_context_id{ uuid::random() };
40
+ std::string client_context_id{ uuid::to_string(uuid::random()) };
41
41
  std::chrono::milliseconds timeout{ timeout_defaults::management_timeout };
42
42
 
43
43
  search_index index;
@@ -0,0 +1,148 @@
1
+ /* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright 2020 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
+ #include <string>
21
+
22
+ #include <utils/connection_string.hxx>
23
+
24
+ namespace couchbase
25
+ {
26
+ struct origin {
27
+ using node_entry = std::pair<std::string, std::string>;
28
+ using node_list = std::vector<node_entry>;
29
+
30
+ origin() = default;
31
+
32
+ origin(origin&& other) = default;
33
+
34
+ origin(const origin& other)
35
+ : options_(other.options_)
36
+ , username_(other.username_)
37
+ , password_(other.password_)
38
+ , nodes_(other.nodes_)
39
+ , next_node_(nodes_.begin())
40
+ {
41
+ }
42
+
43
+ origin(std::string username, std::string password, const std::string& hostname, std::uint16_t port, const cluster_options& options)
44
+ : options_(options)
45
+ , username_(std::move(username))
46
+ , password_(std::move(password))
47
+ , nodes_{ { hostname, std::to_string(port) } }
48
+ , next_node_(nodes_.begin())
49
+ {
50
+ }
51
+
52
+ origin(std::string username, std::string password, const utils::connection_string& connstr)
53
+ : options_(connstr.options)
54
+ , username_(std::move(username))
55
+ , password_(std::move(password))
56
+ {
57
+ nodes_.reserve(connstr.bootstrap_nodes.size());
58
+ for (const auto& node : connstr.bootstrap_nodes) {
59
+ nodes_.emplace_back(
60
+ std::make_pair(node.address, node.port > 0 ? std::to_string(node.port) : std::to_string(connstr.default_port)));
61
+ }
62
+ next_node_ = nodes_.begin();
63
+ }
64
+
65
+ origin& operator=(const origin& other)
66
+ {
67
+ if (this != &other) {
68
+ options_ = other.options_;
69
+ username_ = other.username_;
70
+ password_ = other.password_;
71
+ nodes_ = other.nodes_;
72
+ next_node_ = nodes_.begin();
73
+ exhausted_ = false;
74
+ }
75
+ return *this;
76
+ }
77
+
78
+ [[nodiscard]] const std::string& get_username() const
79
+ {
80
+ return username_;
81
+ }
82
+
83
+ [[nodiscard]] const std::string& get_password() const
84
+ {
85
+ return password_;
86
+ }
87
+
88
+ [[nodiscard]] std::vector<std::string> get_nodes() const
89
+ {
90
+ std::vector<std::string> res;
91
+ res.reserve(nodes_.size());
92
+ for (const auto &node : nodes_) {
93
+ res.emplace_back(fmt::format("\"{}:{}\"", node.first, node.second));
94
+ }
95
+ return res;
96
+ }
97
+
98
+ void set_nodes(node_list nodes)
99
+ {
100
+ nodes_ = std::move(nodes);
101
+ next_node_ = nodes_.begin();
102
+ exhausted_ = false;
103
+ }
104
+
105
+ [[nodiscard]] std::pair<std::string, std::string> next_address()
106
+ {
107
+ if (exhausted_) {
108
+ restart();
109
+ }
110
+
111
+ auto address = *next_node_;
112
+ if (++next_node_ == nodes_.end()) {
113
+ exhausted_ = true;
114
+ }
115
+ return address;
116
+ }
117
+
118
+ [[nodiscard]] bool exhausted() const
119
+ {
120
+ return exhausted_;
121
+ }
122
+
123
+ void restart()
124
+ {
125
+ exhausted_ = false;
126
+ next_node_ = nodes_.begin();
127
+ }
128
+
129
+ [[nodiscard]] const couchbase::cluster_options& options() const
130
+ {
131
+ return options_;
132
+ }
133
+
134
+ [[nodiscard]] couchbase::cluster_options& options()
135
+ {
136
+ return options_;
137
+ }
138
+
139
+ private:
140
+ couchbase::cluster_options options_{};
141
+ std::string username_{};
142
+ std::string password_{};
143
+ node_list nodes_{};
144
+ node_list::iterator next_node_{};
145
+ bool exhausted_{ false };
146
+ };
147
+
148
+ } // namespace couchbase
@@ -53,7 +53,7 @@ class cluster_map_change_notification_request_body
53
53
  return config_;
54
54
  }
55
55
 
56
- bool parse(const header_buffer& header, const std::vector<uint8_t>& body, const cmd_info& info)
56
+ bool parse(const header_buffer& header, const std::vector<uint8_t>& body, const cmd_info&)
57
57
  {
58
58
  Expects(header[1] == static_cast<uint8_t>(opcode));
59
59
  using offset_type = std::vector<uint8_t>::difference_type;
@@ -69,11 +69,6 @@ class cluster_map_change_notification_request_body
69
69
  bucket_.assign(body.begin() + offset, body.begin() + offset + key_size);
70
70
  offset += key_size;
71
71
  config_ = tao::json::from_string<deduplicate_keys>(std::string(body.begin() + offset, body.end())).as<configuration>();
72
- for (auto& node : config_.nodes) {
73
- if (node.this_node && node.hostname.empty()) {
74
- node.hostname = info.remote_endpoint.address().to_string();
75
- }
76
- }
77
72
  return true;
78
73
  }
79
74
  };
@@ -85,7 +85,7 @@ class decrement_request_body
85
85
  std::vector<std::uint8_t> framing_extras_{};
86
86
  std::uint64_t delta_{ 1 };
87
87
  std::uint64_t initial_value_{ 0 };
88
- std::uint32_t expiration_{ 0 };
88
+ std::uint32_t expiry_{ 0 };
89
89
  std::vector<std::uint8_t> extras_{};
90
90
 
91
91
  public:
@@ -108,9 +108,9 @@ class decrement_request_body
108
108
  initial_value_ = value;
109
109
  }
110
110
 
111
- void expiration(std::uint32_t value)
111
+ void expiry(std::uint32_t value)
112
112
  {
113
- expiration_ = value;
113
+ expiry_ = value;
114
114
  }
115
115
 
116
116
  void durability(protocol::durability_level level, std::optional<std::uint16_t> timeout)
@@ -167,7 +167,7 @@ class decrement_request_body
167
167
  private:
168
168
  void fill_extras()
169
169
  {
170
- extras_.resize(sizeof(delta_) + sizeof(initial_value_) + sizeof(expiration_));
170
+ extras_.resize(sizeof(delta_) + sizeof(initial_value_) + sizeof(expiry_));
171
171
  using offset_type = std::vector<uint8_t>::difference_type;
172
172
  offset_type offset = 0;
173
173
 
@@ -179,7 +179,7 @@ class decrement_request_body
179
179
  memcpy(extras_.data() + offset, &num, sizeof(num));
180
180
  offset += static_cast<offset_type>(sizeof(delta_));
181
181
 
182
- std::uint32_t ttl = htonl(expiration_);
182
+ std::uint32_t ttl = htonl(expiry_);
183
183
  memcpy(extras_.data() + offset, &ttl, sizeof(ttl));
184
184
  }
185
185
  };