couchbase 4.2.5 → 4.2.6-dev.1
Sign up to get free protection for your applications and to get access to all the features.
- package/deps/couchbase-cxx-client/CMakeLists.txt +9 -1
- package/deps/couchbase-cxx-client/bin/api.rb +234 -0
- package/deps/couchbase-cxx-client/bin/create-search-index +18 -135
- package/deps/couchbase-cxx-client/bin/init-cluster +17 -139
- package/deps/couchbase-cxx-client/bin/load-sample-buckets +54 -0
- package/deps/couchbase-cxx-client/core/cluster.hxx +33 -12
- package/deps/couchbase-cxx-client/core/cluster_options.hxx +3 -0
- package/deps/couchbase-cxx-client/core/crud_component.cxx +51 -22
- package/deps/couchbase-cxx-client/core/impl/build_deferred_query_indexes.cxx +115 -50
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +6 -0
- package/deps/couchbase-cxx-client/core/impl/create_bucket.cxx +155 -0
- package/deps/couchbase-cxx-client/core/impl/create_query_index.cxx +172 -59
- package/deps/couchbase-cxx-client/core/impl/dns_srv_tracker.cxx +2 -1
- package/deps/couchbase-cxx-client/core/impl/drop_bucket.cxx +66 -0
- package/deps/couchbase-cxx-client/core/impl/drop_query_index.cxx +138 -59
- package/deps/couchbase-cxx-client/core/impl/flush_bucket.cxx +66 -0
- package/deps/couchbase-cxx-client/core/impl/get_all_buckets.cxx +163 -0
- package/deps/couchbase-cxx-client/core/impl/get_all_query_indexes.cxx +67 -37
- package/deps/couchbase-cxx-client/core/impl/get_bucket.cxx +153 -0
- package/deps/couchbase-cxx-client/core/impl/internal_manager_error_context.cxx +113 -0
- package/deps/couchbase-cxx-client/core/impl/internal_manager_error_context.hxx +60 -0
- package/deps/couchbase-cxx-client/core/impl/key_value_error_category.cxx +2 -4
- package/deps/couchbase-cxx-client/core/impl/manager_error_context.cxx +100 -0
- package/deps/couchbase-cxx-client/core/impl/query.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/update_bucket.cxx +130 -0
- package/deps/couchbase-cxx-client/core/impl/watch_query_indexes.cxx +53 -29
- package/deps/couchbase-cxx-client/core/io/dns_client.cxx +71 -38
- package/deps/couchbase-cxx-client/core/io/dns_config.cxx +5 -4
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +5 -6
- package/deps/couchbase-cxx-client/core/meta/features.hxx +6 -0
- package/deps/couchbase-cxx-client/core/operations/document_query.cxx +11 -0
- package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -0
- package/deps/couchbase-cxx-client/core/origin.cxx +270 -0
- package/deps/couchbase-cxx-client/core/origin.hxx +2 -0
- package/deps/couchbase-cxx-client/core/protocol/status.cxx +2 -2
- package/deps/couchbase-cxx-client/core/range_scan_options.cxx +3 -27
- package/deps/couchbase-cxx-client/core/range_scan_options.hxx +13 -17
- package/deps/couchbase-cxx-client/core/range_scan_orchestrator.cxx +367 -170
- package/deps/couchbase-cxx-client/core/range_scan_orchestrator.hxx +13 -2
- package/deps/couchbase-cxx-client/core/range_scan_orchestrator_options.hxx +5 -3
- package/deps/couchbase-cxx-client/core/scan_options.hxx +0 -19
- package/deps/couchbase-cxx-client/core/scan_result.cxx +19 -5
- package/deps/couchbase-cxx-client/core/scan_result.hxx +5 -2
- package/deps/couchbase-cxx-client/core/timeout_defaults.hxx +2 -3
- package/deps/couchbase-cxx-client/core/topology/capabilities.hxx +1 -0
- package/deps/couchbase-cxx-client/core/topology/capabilities_fmt.hxx +2 -0
- package/deps/couchbase-cxx-client/core/topology/collections_manifest_fmt.hxx +1 -1
- package/deps/couchbase-cxx-client/core/topology/configuration.hxx +5 -0
- package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +2 -0
- package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +4 -0
- package/deps/couchbase-cxx-client/couchbase/behavior_options.hxx +19 -2
- package/deps/couchbase-cxx-client/couchbase/bucket_manager.hxx +135 -0
- package/deps/couchbase-cxx-client/couchbase/build_query_index_options.hxx +0 -30
- package/deps/couchbase-cxx-client/couchbase/cluster.hxx +14 -0
- package/deps/couchbase-cxx-client/couchbase/collection_query_index_manager.hxx +7 -48
- package/deps/couchbase-cxx-client/couchbase/create_bucket_options.hxx +41 -0
- package/deps/couchbase-cxx-client/couchbase/create_primary_query_index_options.hxx +0 -29
- package/deps/couchbase-cxx-client/couchbase/create_query_index_options.hxx +0 -33
- package/deps/couchbase-cxx-client/couchbase/drop_bucket_options.hxx +41 -0
- package/deps/couchbase-cxx-client/couchbase/drop_primary_query_index_options.hxx +0 -30
- package/deps/couchbase-cxx-client/couchbase/drop_query_index_options.hxx +0 -31
- package/deps/couchbase-cxx-client/couchbase/error_codes.hxx +1 -2
- package/deps/couchbase-cxx-client/couchbase/flush_bucket_options.hxx +41 -0
- package/deps/couchbase-cxx-client/couchbase/get_all_buckets_options.hxx +44 -0
- package/deps/couchbase-cxx-client/couchbase/get_all_query_indexes_options.hxx +0 -30
- package/deps/couchbase-cxx-client/couchbase/get_bucket_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/management/bucket_settings.hxx +116 -0
- package/deps/couchbase-cxx-client/couchbase/manager_error_context.hxx +29 -53
- package/deps/couchbase-cxx-client/couchbase/query_index_manager.hxx +16 -83
- package/deps/couchbase-cxx-client/couchbase/query_options.hxx +18 -0
- package/deps/couchbase-cxx-client/couchbase/security_options.hxx +15 -0
- package/deps/couchbase-cxx-client/couchbase/update_bucket_options.hxx +41 -0
- package/deps/couchbase-cxx-client/couchbase/watch_query_indexes_options.hxx +0 -31
- package/deps/couchbase-cxx-client/docs/cbc-analytics.md +1 -0
- package/deps/couchbase-cxx-client/docs/cbc-get.md +1 -0
- package/deps/couchbase-cxx-client/docs/cbc-pillowfight.md +1 -0
- package/deps/couchbase-cxx-client/docs/cbc-query.md +1 -0
- package/deps/couchbase-cxx-client/docs/cbc.md +10 -0
- package/deps/couchbase-cxx-client/test/CMakeLists.txt +1 -0
- package/deps/couchbase-cxx-client/test/test_integration_collections.cxx +6 -0
- package/deps/couchbase-cxx-client/test/test_integration_crud.cxx +5 -0
- package/deps/couchbase-cxx-client/test/test_integration_examples.cxx +137 -1
- package/deps/couchbase-cxx-client/test/test_integration_management.cxx +709 -266
- package/deps/couchbase-cxx-client/test/test_integration_query.cxx +19 -7
- package/deps/couchbase-cxx-client/test/test_integration_range_scan.cxx +351 -112
- package/deps/couchbase-cxx-client/test/test_integration_search.cxx +10 -1
- package/deps/couchbase-cxx-client/test/test_transaction_public_async_api.cxx +13 -12
- package/deps/couchbase-cxx-client/test/test_transaction_public_blocking_api.cxx +27 -21
- package/deps/couchbase-cxx-client/test/test_unit_query.cxx +75 -0
- package/deps/couchbase-cxx-client/test/utils/server_version.hxx +5 -0
- package/deps/couchbase-cxx-client/test/utils/wait_until.cxx +29 -10
- package/deps/couchbase-cxx-client/test/utils/wait_until.hxx +3 -1
- package/deps/couchbase-cxx-client/tools/utils.cxx +4 -1
- package/dist/binding.d.ts +21 -16
- package/dist/binding.js +1 -4
- package/dist/bindingutilities.d.ts +6 -1
- package/dist/bindingutilities.js +36 -1
- package/dist/collection.d.ts +65 -3
- package/dist/collection.js +107 -0
- package/dist/crudoptypes.d.ts +34 -0
- package/dist/crudoptypes.js +18 -1
- package/dist/queryexecutor.js +1 -0
- package/dist/querytypes.d.ts +7 -0
- package/dist/rangeScan.d.ts +107 -0
- package/dist/rangeScan.js +91 -0
- package/dist/streamablepromises.d.ts +6 -0
- package/dist/streamablepromises.js +25 -1
- package/package.json +13 -13
- package/src/addondata.hpp +1 -0
- package/src/binding.cpp +5 -2
- package/src/connection.cpp +108 -2
- package/src/connection.hpp +1 -0
- package/src/constants.cpp +2 -12
- package/src/jstocbpp_autogen.hpp +49 -22
- package/src/jstocbpp_basic.hpp +2 -8
- package/src/mutationtoken.cpp +13 -0
- package/src/scan_iterator.cpp +90 -0
- package/src/scan_iterator.hpp +30 -0
- package/tools/gen-bindings-json.py +9 -8
- package/deps/couchbase-cxx-client/core/impl/collection_query_index_manager.cxx +0 -93
@@ -136,37 +136,4 @@ class create_query_index_options : public common_options<create_query_index_opti
|
|
136
136
|
*/
|
137
137
|
|
138
138
|
using create_query_index_handler = std::function<void(couchbase::manager_error_context)>;
|
139
|
-
|
140
|
-
#ifndef COUCHBASE_CXX_CLIENT_DOXYGEN
|
141
|
-
namespace core
|
142
|
-
{
|
143
|
-
class cluster;
|
144
|
-
class query_context;
|
145
|
-
namespace impl
|
146
|
-
{
|
147
|
-
|
148
|
-
/**
|
149
|
-
* @since 1.0.0
|
150
|
-
* @internal
|
151
|
-
*/
|
152
|
-
void
|
153
|
-
initiate_create_query_index(std::shared_ptr<couchbase::core::cluster> core,
|
154
|
-
std::string bucket_name,
|
155
|
-
std::string index_name,
|
156
|
-
std::vector<std::string> fields,
|
157
|
-
couchbase::create_query_index_options::built options,
|
158
|
-
create_query_index_handler&& handler);
|
159
|
-
void
|
160
|
-
initiate_create_query_index(std::shared_ptr<couchbase::core::cluster> core,
|
161
|
-
std::string bucket_name,
|
162
|
-
std::string index_name,
|
163
|
-
std::vector<std::string> fields,
|
164
|
-
couchbase::create_query_index_options::built options,
|
165
|
-
query_context query_ctx,
|
166
|
-
std::string collection_name,
|
167
|
-
create_query_index_handler&& handler);
|
168
|
-
|
169
|
-
#endif
|
170
|
-
} // namespace impl
|
171
|
-
} // namespace core
|
172
139
|
} // namespace couchbase
|
@@ -0,0 +1,41 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2020-Present 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 <functional>
|
21
|
+
#include <memory>
|
22
|
+
#include <optional>
|
23
|
+
#include <string>
|
24
|
+
|
25
|
+
namespace couchbase
|
26
|
+
{
|
27
|
+
struct drop_bucket_options : public common_options<drop_bucket_options> {
|
28
|
+
public:
|
29
|
+
struct built : public common_options<drop_bucket_options>::built {
|
30
|
+
};
|
31
|
+
|
32
|
+
[[nodiscard]] auto build() const -> built
|
33
|
+
{
|
34
|
+
return { build_common_options() };
|
35
|
+
}
|
36
|
+
|
37
|
+
private:
|
38
|
+
};
|
39
|
+
|
40
|
+
using drop_bucket_handler = std::function<void(couchbase::manager_error_context)>;
|
41
|
+
} // namespace couchbase
|
@@ -96,34 +96,4 @@ class drop_primary_query_index_options : public common_options<drop_primary_quer
|
|
96
96
|
*/
|
97
97
|
|
98
98
|
using drop_primary_query_index_handler = std::function<void(couchbase::manager_error_context)>;
|
99
|
-
|
100
|
-
#ifndef COUCHBASE_CXX_CLIENT_DOXYGEN
|
101
|
-
namespace core
|
102
|
-
{
|
103
|
-
class cluster;
|
104
|
-
class query_context;
|
105
|
-
namespace impl
|
106
|
-
{
|
107
|
-
|
108
|
-
/**
|
109
|
-
* @since 1.0.0
|
110
|
-
* @internal
|
111
|
-
*/
|
112
|
-
void
|
113
|
-
initiate_drop_primary_query_index(std::shared_ptr<couchbase::core::cluster> core,
|
114
|
-
std::string bucket_name,
|
115
|
-
couchbase::drop_primary_query_index_options::built options,
|
116
|
-
query_context query_ctx,
|
117
|
-
std::string collection_name,
|
118
|
-
drop_primary_query_index_handler&& handler);
|
119
|
-
|
120
|
-
void
|
121
|
-
initiate_drop_primary_query_index(std::shared_ptr<couchbase::core::cluster> core,
|
122
|
-
std::string bucket_name,
|
123
|
-
couchbase::drop_primary_query_index_options::built options,
|
124
|
-
drop_primary_query_index_handler&& handler);
|
125
|
-
|
126
|
-
#endif
|
127
|
-
} // namespace impl
|
128
|
-
} // namespace core
|
129
99
|
} // namespace couchbase
|
@@ -82,35 +82,4 @@ class drop_query_index_options : public common_options<drop_query_index_options>
|
|
82
82
|
*/
|
83
83
|
|
84
84
|
using drop_query_index_handler = std::function<void(couchbase::manager_error_context)>;
|
85
|
-
|
86
|
-
#ifndef COUCHBASE_CXX_CLIENT_DOXYGEN
|
87
|
-
namespace core
|
88
|
-
{
|
89
|
-
class cluster;
|
90
|
-
class query_context;
|
91
|
-
namespace impl
|
92
|
-
{
|
93
|
-
|
94
|
-
/**
|
95
|
-
* @since 1.0.0
|
96
|
-
* @internal
|
97
|
-
*/
|
98
|
-
void
|
99
|
-
initiate_drop_query_index(std::shared_ptr<couchbase::core::cluster> core,
|
100
|
-
std::string bucket_name,
|
101
|
-
std::string index_name,
|
102
|
-
couchbase::drop_query_index_options::built options,
|
103
|
-
query_context query_ctx,
|
104
|
-
std::string collection_name,
|
105
|
-
drop_query_index_handler&& handler);
|
106
|
-
void
|
107
|
-
initiate_drop_query_index(std::shared_ptr<couchbase::core::cluster> core,
|
108
|
-
std::string bucket_name,
|
109
|
-
std::string index_name,
|
110
|
-
couchbase::drop_query_index_options::built options,
|
111
|
-
drop_query_index_handler&& handler);
|
112
|
-
|
113
|
-
#endif
|
114
|
-
} // namespace impl
|
115
|
-
} // namespace core
|
116
85
|
} // namespace couchbase
|
@@ -0,0 +1,41 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2020-Present 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 <functional>
|
21
|
+
#include <memory>
|
22
|
+
#include <optional>
|
23
|
+
#include <string>
|
24
|
+
|
25
|
+
namespace couchbase
|
26
|
+
{
|
27
|
+
struct flush_bucket_options : public common_options<flush_bucket_options> {
|
28
|
+
public:
|
29
|
+
struct built : public common_options<flush_bucket_options>::built {
|
30
|
+
};
|
31
|
+
|
32
|
+
[[nodiscard]] auto build() const -> built
|
33
|
+
{
|
34
|
+
return { build_common_options() };
|
35
|
+
}
|
36
|
+
|
37
|
+
private:
|
38
|
+
};
|
39
|
+
|
40
|
+
using flush_bucket_handler = std::function<void(couchbase::manager_error_context)>;
|
41
|
+
} // namespace couchbase
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2020-Present 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 <couchbase/management/bucket_settings.hxx>
|
21
|
+
|
22
|
+
#include <functional>
|
23
|
+
#include <memory>
|
24
|
+
#include <optional>
|
25
|
+
#include <string>
|
26
|
+
|
27
|
+
namespace couchbase
|
28
|
+
{
|
29
|
+
struct get_all_buckets_options : public common_options<get_all_buckets_options> {
|
30
|
+
public:
|
31
|
+
struct built : public common_options<get_all_buckets_options>::built {
|
32
|
+
};
|
33
|
+
|
34
|
+
[[nodiscard]] auto build() const -> built
|
35
|
+
{
|
36
|
+
return { build_common_options() };
|
37
|
+
}
|
38
|
+
|
39
|
+
private:
|
40
|
+
};
|
41
|
+
|
42
|
+
using get_all_buckets_handler =
|
43
|
+
std::function<void(couchbase::manager_error_context, std::vector<couchbase::management::cluster::bucket_settings>)>;
|
44
|
+
} // namespace couchbase
|
@@ -68,34 +68,4 @@ class get_all_query_indexes_options : public common_options<get_all_query_indexe
|
|
68
68
|
|
69
69
|
using get_all_query_indexes_handler =
|
70
70
|
std::function<void(couchbase::manager_error_context, std::vector<couchbase::management::query::index>)>;
|
71
|
-
|
72
|
-
#ifndef COUCHBASE_CXX_CLIENT_DOXYGEN
|
73
|
-
namespace core
|
74
|
-
{
|
75
|
-
class cluster;
|
76
|
-
class query_context;
|
77
|
-
namespace impl
|
78
|
-
{
|
79
|
-
|
80
|
-
/**
|
81
|
-
* @since 1.0.0
|
82
|
-
* @internal
|
83
|
-
*/
|
84
|
-
void
|
85
|
-
initiate_get_all_query_indexes(std::shared_ptr<couchbase::core::cluster> core,
|
86
|
-
std::string bucket_name,
|
87
|
-
couchbase::get_all_query_indexes_options::built options,
|
88
|
-
get_all_query_indexes_handler&& handler);
|
89
|
-
|
90
|
-
void
|
91
|
-
initiate_get_all_query_indexes(std::shared_ptr<couchbase::core::cluster> core,
|
92
|
-
std::string bucket_name,
|
93
|
-
couchbase::get_all_query_indexes_options::built options,
|
94
|
-
query_context query_ctx,
|
95
|
-
std::string collection_name,
|
96
|
-
get_all_query_indexes_handler&& handler);
|
97
|
-
|
98
|
-
#endif
|
99
|
-
} // namespace impl
|
100
|
-
} // namespace core
|
101
71
|
} // namespace couchbase
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2020-Present 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 <couchbase/management/bucket_settings.hxx>
|
21
|
+
|
22
|
+
#include <functional>
|
23
|
+
#include <memory>
|
24
|
+
#include <optional>
|
25
|
+
#include <string>
|
26
|
+
|
27
|
+
namespace couchbase
|
28
|
+
{
|
29
|
+
struct get_bucket_options : public common_options<get_bucket_options> {
|
30
|
+
public:
|
31
|
+
struct built : public common_options<get_bucket_options>::built {
|
32
|
+
};
|
33
|
+
|
34
|
+
[[nodiscard]] auto build() const -> built
|
35
|
+
{
|
36
|
+
return { build_common_options() };
|
37
|
+
}
|
38
|
+
|
39
|
+
private:
|
40
|
+
};
|
41
|
+
|
42
|
+
using get_bucket_handler = std::function<void(couchbase::manager_error_context, couchbase::management::cluster::bucket_settings)>;
|
43
|
+
} // namespace couchbase
|
@@ -0,0 +1,116 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2020-2021 Couchbase, Inc.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#pragma once
|
19
|
+
|
20
|
+
#include <couchbase/durability_level.hxx>
|
21
|
+
|
22
|
+
#include <map>
|
23
|
+
#include <optional>
|
24
|
+
#include <string>
|
25
|
+
#include <vector>
|
26
|
+
|
27
|
+
namespace couchbase::management::cluster
|
28
|
+
{
|
29
|
+
enum class bucket_type { unknown, couchbase, memcached, ephemeral };
|
30
|
+
enum class bucket_compression { unknown, off, active, passive };
|
31
|
+
enum class bucket_eviction_policy {
|
32
|
+
unknown,
|
33
|
+
|
34
|
+
/**
|
35
|
+
* During ejection, everything (including key, metadata, and value) will be ejected.
|
36
|
+
*
|
37
|
+
* Full Ejection reduces the memory overhead requirement, at the cost of performance.
|
38
|
+
*
|
39
|
+
* This value is only valid for buckets of type COUCHBASE.
|
40
|
+
*/
|
41
|
+
full,
|
42
|
+
|
43
|
+
/**
|
44
|
+
* During ejection, only the value will be ejected (key and metadata will remain in memory).
|
45
|
+
*
|
46
|
+
* Value Ejection needs more system memory, but provides better performance than Full Ejection.
|
47
|
+
*
|
48
|
+
* This value is only valid for buckets of type COUCHBASE.
|
49
|
+
*/
|
50
|
+
value_only,
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Couchbase Server keeps all data until explicitly deleted, but will reject
|
54
|
+
* any new data if you reach the quota (dedicated memory) you set for your bucket.
|
55
|
+
*
|
56
|
+
* This value is only valid for buckets of type EPHEMERAL.
|
57
|
+
*/
|
58
|
+
no_eviction,
|
59
|
+
|
60
|
+
/**
|
61
|
+
* When the memory quota is reached, Couchbase Server ejects data that has not been used recently.
|
62
|
+
*
|
63
|
+
* This value is only valid for buckets of type EPHEMERAL.
|
64
|
+
*/
|
65
|
+
not_recently_used,
|
66
|
+
};
|
67
|
+
enum class bucket_conflict_resolution {
|
68
|
+
unknown,
|
69
|
+
/**
|
70
|
+
* Use timestamp conflict resolution.
|
71
|
+
*
|
72
|
+
* Timestamp-based conflict resolution (often referred to as Last Write Wins, or LWW) uses the document
|
73
|
+
* timestamp (stored in the CAS) to resolve conflicts. The timestamps associated with the most recent
|
74
|
+
* updates of source and target documents are compared. The document whose update has the more recent
|
75
|
+
* timestamp prevails.
|
76
|
+
*/
|
77
|
+
timestamp,
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Use sequence number conflict resolution
|
81
|
+
*
|
82
|
+
* Conflicts can be resolved by referring to documents' sequence numbers. Sequence numbers are maintained
|
83
|
+
* per document, and are incremented on every document-update. The sequence numbers of source and
|
84
|
+
* target documents are compared; and the document with the higher sequence number prevails.
|
85
|
+
*/
|
86
|
+
sequence_number,
|
87
|
+
|
88
|
+
/**
|
89
|
+
* VOLATILE: This API is subject to change at any time.
|
90
|
+
*
|
91
|
+
* In Couchbase Server 7.1, this feature is only available in "developer-preview" mode. See the UI XDCR settings.
|
92
|
+
*/
|
93
|
+
custom,
|
94
|
+
};
|
95
|
+
enum class bucket_storage_backend { unknown, couchstore, magma };
|
96
|
+
|
97
|
+
struct bucket_settings {
|
98
|
+
|
99
|
+
std::string name;
|
100
|
+
cluster::bucket_type bucket_type{ cluster::bucket_type::unknown };
|
101
|
+
std::uint64_t ram_quota_mb{ 100 };
|
102
|
+
std::uint32_t max_expiry{ 0 };
|
103
|
+
bucket_compression compression_mode{ bucket_compression::unknown };
|
104
|
+
std::optional<couchbase::durability_level> minimum_durability_level{};
|
105
|
+
std::uint32_t num_replicas{ 1 };
|
106
|
+
bool replica_indexes{ false };
|
107
|
+
bool flush_enabled{ false };
|
108
|
+
bucket_eviction_policy eviction_policy{ bucket_eviction_policy::unknown };
|
109
|
+
bucket_conflict_resolution conflict_resolution_type{ bucket_conflict_resolution::unknown };
|
110
|
+
|
111
|
+
/**
|
112
|
+
* UNCOMMITTED: This API may change in the future
|
113
|
+
*/
|
114
|
+
bucket_storage_backend storage_backend{ bucket_storage_backend::unknown };
|
115
|
+
};
|
116
|
+
} // namespace couchbase::management::cluster
|
@@ -17,14 +17,20 @@
|
|
17
17
|
|
18
18
|
#pragma once
|
19
19
|
|
20
|
+
#include "core/impl/internal_manager_error_context.hxx"
|
20
21
|
#include <couchbase/error_context.hxx>
|
21
22
|
|
22
23
|
#include <cstdint>
|
24
|
+
#include <memory>
|
23
25
|
#include <optional>
|
24
26
|
#include <string>
|
25
27
|
|
26
28
|
namespace couchbase
|
27
29
|
{
|
30
|
+
#ifndef COUCHBASE_CXX_CLIENT_DOXYGEN
|
31
|
+
class internal_manager_error_context;
|
32
|
+
#endif
|
33
|
+
|
28
34
|
/**
|
29
35
|
* The error context returned with manager operations.
|
30
36
|
*
|
@@ -40,40 +46,25 @@ class manager_error_context : public error_context
|
|
40
46
|
* @since 1.0.0
|
41
47
|
* @committed
|
42
48
|
*/
|
43
|
-
manager_error_context()
|
49
|
+
manager_error_context();
|
50
|
+
explicit manager_error_context(internal_manager_error_context ctx);
|
51
|
+
manager_error_context(manager_error_context&& other);
|
52
|
+
manager_error_context& operator=(manager_error_context&& other);
|
53
|
+
manager_error_context(const manager_error_context& other) = delete;
|
54
|
+
manager_error_context& operator=(const manager_error_context& other) = delete;
|
55
|
+
~manager_error_context() override;
|
44
56
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
* @param path
|
57
|
-
*
|
58
|
-
* @since 1.0.0
|
59
|
-
* @internal
|
60
|
-
*/
|
61
|
-
manager_error_context(std::error_code ec,
|
62
|
-
std::optional<std::string> last_dispatched_to,
|
63
|
-
std::optional<std::string> last_dispatched_from,
|
64
|
-
std::size_t retry_attempts,
|
65
|
-
std::set<retry_reason> retry_reasons,
|
66
|
-
std::string client_context_id,
|
67
|
-
std::uint32_t http_status,
|
68
|
-
std::string content,
|
69
|
-
std::string path)
|
70
|
-
: error_context{ {}, ec, std::move(last_dispatched_to), std::move(last_dispatched_from), retry_attempts, std::move(retry_reasons) }
|
71
|
-
, client_context_id_{ std::move(client_context_id) }
|
72
|
-
, http_status_{ http_status }
|
73
|
-
, content_{ std::move(content) }
|
74
|
-
, path_{ std::move(path) }
|
75
|
-
{
|
76
|
-
}
|
57
|
+
[[nodiscard]] auto ec() const -> std::error_code override;
|
58
|
+
|
59
|
+
[[nodiscard]] auto last_dispatched_to() const -> const std::optional<std::string>& override;
|
60
|
+
|
61
|
+
[[nodiscard]] auto last_dispatched_from() const -> const std::optional<std::string>& override;
|
62
|
+
|
63
|
+
[[nodiscard]] auto retry_attempts() const -> std::size_t override;
|
64
|
+
|
65
|
+
[[nodiscard]] auto retry_reasons() const -> const std::set<retry_reason>& override;
|
66
|
+
|
67
|
+
[[nodiscard]] auto retried_because_of(retry_reason reason) const -> bool override;
|
77
68
|
|
78
69
|
/**
|
79
70
|
* Returns request path.
|
@@ -83,10 +74,7 @@ class manager_error_context : public error_context
|
|
83
74
|
* @since 1.0.0
|
84
75
|
* @uncommitted
|
85
76
|
*/
|
86
|
-
[[nodiscard]] auto path() const -> const std::string
|
87
|
-
{
|
88
|
-
return path_;
|
89
|
-
}
|
77
|
+
[[nodiscard]] auto path() const -> const std::string&;
|
90
78
|
|
91
79
|
/**
|
92
80
|
* Returns response body.
|
@@ -96,10 +84,7 @@ class manager_error_context : public error_context
|
|
96
84
|
* @since 1.0.0
|
97
85
|
* @committed
|
98
86
|
*/
|
99
|
-
[[nodiscard]] auto content() const -> const std::string
|
100
|
-
{
|
101
|
-
return content_;
|
102
|
-
}
|
87
|
+
[[nodiscard]] auto content() const -> const std::string&;
|
103
88
|
|
104
89
|
/**
|
105
90
|
* Returns the unique
|
@@ -109,10 +94,7 @@ class manager_error_context : public error_context
|
|
109
94
|
* @since 1.0.0
|
110
95
|
* @uncommitted
|
111
96
|
*/
|
112
|
-
[[nodiscard]] auto client_context_id() const -> const std::string
|
113
|
-
{
|
114
|
-
return client_context_id_;
|
115
|
-
}
|
97
|
+
[[nodiscard]] auto client_context_id() const -> const std::string&;
|
116
98
|
|
117
99
|
/**
|
118
100
|
* Returns HTTP status of response
|
@@ -122,15 +104,9 @@ class manager_error_context : public error_context
|
|
122
104
|
* @since 1.0.0
|
123
105
|
* @committed
|
124
106
|
*/
|
125
|
-
[[nodiscard]] auto http_status() const -> std::uint32_t
|
126
|
-
{
|
127
|
-
return http_status_;
|
128
|
-
}
|
107
|
+
[[nodiscard]] auto http_status() const -> std::uint32_t;
|
129
108
|
|
130
109
|
private:
|
131
|
-
std::
|
132
|
-
std::uint32_t http_status_{};
|
133
|
-
std::string content_{};
|
134
|
-
std::string path_{};
|
110
|
+
std::unique_ptr<internal_manager_error_context> internal_;
|
135
111
|
};
|
136
112
|
} // namespace couchbase
|