Couchbase C++ SDK 1.0.4 (rev. 5355b0f)
Loading...
Searching...
No Matches
analytics_index_manager.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright 2023-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
38
39#include <future>
40#include <string>
41#include <utility>
42
43namespace couchbase
44{
45#ifndef COUCHBASE_CXX_CLIENT_DOXYGEN
46namespace core
47{
48class cluster;
49} // namespace core
50class analytics_index_manager_impl;
51#endif
52
54{
55public:
66 void create_dataverse(const std::string& dataverse_name,
69
80 [[nodiscard]] auto create_dataverse(const std::string& dataverse_name,
81 const create_dataverse_analytics_options& options) const
82 -> std::future<error>;
83
94 void drop_dataverse(const std::string& dataverse_name,
96 drop_dataverse_analytics_handler&& handler) const;
97
108 [[nodiscard]] auto drop_dataverse(const std::string& dataverse_name,
109 const drop_dataverse_analytics_options& options) const
110 -> std::future<error>;
111
123 void create_dataset(const std::string& dataset_name,
124 const std::string& bucket_name,
126 create_dataset_analytics_handler&& handler) const;
127
139 [[nodiscard]] auto create_dataset(const std::string& dataset_name,
140 const std::string& bucket_name,
141 const create_dataset_analytics_options& options) const
142 -> std::future<error>;
143
154 void drop_dataset(const std::string& dataset_name,
155 const drop_dataset_analytics_options& options,
156 drop_dataset_analytics_handler&& handler) const;
157
168 [[nodiscard]] auto drop_dataset(const std::string& dataset_name,
169 const drop_dataset_analytics_options& options) const
170 -> std::future<error>;
171
182 get_all_datasets_analytics_handler&& handler) const;
183
193 [[nodiscard]] auto get_all_datasets(const get_all_datasets_analytics_options& options) const
194 -> std::future<std::pair<error, std::vector<management::analytics_dataset>>>;
195
208 void create_index(const std::string& index_name,
209 const std::string& dataset_name,
210 const std::map<std::string, std::string>& fields,
211 const create_index_analytics_options& options,
212 create_index_analytics_handler&& handler) const;
213
226 [[nodiscard]] auto create_index(const std::string& index_name,
227 const std::string& dataset_name,
228 const std::map<std::string, std::string>& fields,
229 const create_index_analytics_options& options) const
230 -> std::future<error>;
231
243 void drop_index(const std::string& index_name,
244 const std::string& dataset_name,
245 const drop_index_analytics_options& options,
246 drop_index_analytics_handler&& handler) const;
247
259 [[nodiscard]] auto drop_index(const std::string& index_name,
260 const std::string& dataset_name,
261 const drop_index_analytics_options& options) const
262 -> std::future<error>;
263
274 get_all_indexes_analytics_handler&& handler) const;
275
285 [[nodiscard]] auto get_all_indexes(const get_all_indexes_analytics_options& options) const
286 -> std::future<std::pair<error, std::vector<management::analytics_index>>>;
287
298 connect_link_analytics_handler&& handler) const;
299
309 [[nodiscard]] auto connect_link(const connect_link_analytics_options& options) const
310 -> std::future<error>;
311
322 disconnect_link_analytics_handler&& handler) const;
323
333 [[nodiscard]] auto disconnect_link(const disconnect_link_analytics_options& options) const
334 -> std::future<error>;
335
347
357 [[nodiscard]] auto get_pending_mutations(
358 const get_pending_mutations_analytics_options& options) const
359 -> std::future<std::pair<error, std::map<std::string, std::map<std::string, std::int64_t>>>>;
360
372 const create_link_analytics_options& options,
373 create_link_analytics_handler&& handler) const;
374
385 [[nodiscard]] auto create_link(const management::analytics_link& link,
386 const create_link_analytics_options& options) const
387 -> std::future<error>;
388
400 const replace_link_analytics_options& options,
401 replace_link_analytics_handler&& handler) const;
402
413 [[nodiscard]] auto replace_link(const management::analytics_link& link,
414 const replace_link_analytics_options& options) const
415 -> std::future<error>;
416
428 void drop_link(const std::string& link_name,
429 const std::string& dataverse_name,
430 const drop_link_analytics_options& options,
431 drop_link_analytics_handler&& handler) const;
432
444 [[nodiscard]] auto drop_link(const std::string& link_name,
445 const std::string& dataverse_name,
446 const drop_link_analytics_options& options) const
447 -> std::future<error>;
448
459 get_links_analytics_handler&& handler) const;
460
470 [[nodiscard]] auto get_links(const get_links_analytics_options& options) const
471 -> std::future<std::pair<error, std::vector<std::unique_ptr<management::analytics_link>>>>;
472
473private:
474 friend class cluster;
475
476 explicit analytics_index_manager(core::cluster core);
477
478 std::shared_ptr<analytics_index_manager_impl> impl_;
479};
480
481} // namespace couchbase
Definition analytics_index_manager.hxx:54
auto get_all_datasets(const get_all_datasets_analytics_options &options) const -> std::future< std::pair< error, std::vector< management::analytics_dataset > > >
Fetches all datasets (analytics collections) from the analytics service.
void create_dataset(const std::string &dataset_name, const std::string &bucket_name, const create_dataset_analytics_options &options, create_dataset_analytics_handler &&handler) const
Creates a new dataset (analytics collection).
void drop_link(const std::string &link_name, const std::string &dataverse_name, const drop_link_analytics_options &options, drop_link_analytics_handler &&handler) const
Drops an existing analytics remote link.
void get_all_datasets(const get_all_datasets_analytics_options &options, get_all_datasets_analytics_handler &&handler) const
Fetches all datasets (analytics collections) from the analytics service.
auto get_pending_mutations(const get_pending_mutations_analytics_options &options) const -> std::future< std::pair< error, std::map< std::string, std::map< std::string, std::int64_t > > > >
Returns the pending mutations for different dataverses.
auto create_link(const management::analytics_link &link, const create_link_analytics_options &options) const -> std::future< error >
Creates a new analytics remote link.
void disconnect_link(const disconnect_link_analytics_options &options, disconnect_link_analytics_handler &&handler) const
Disconnects a currently connected link.
auto replace_link(const management::analytics_link &link, const replace_link_analytics_options &options) const -> std::future< error >
Replaces an existing analytics remote link.
auto create_dataset(const std::string &dataset_name, const std::string &bucket_name, const create_dataset_analytics_options &options) const -> std::future< error >
Creates a new dataset (analytics collection).
auto disconnect_link(const disconnect_link_analytics_options &options) const -> std::future< error >
Disconnects a currently connected link.
void drop_index(const std::string &index_name, const std::string &dataset_name, const drop_index_analytics_options &options, drop_index_analytics_handler &&handler) const
Drops (removes) an analytics index.
auto drop_dataverse(const std::string &dataverse_name, const drop_dataverse_analytics_options &options) const -> std::future< error >
Drops (deletes) a dataverse.
auto drop_dataset(const std::string &dataset_name, const drop_dataset_analytics_options &options) const -> std::future< error >
Drops (deletes) a dataset.
void get_links(const get_links_analytics_options &options, get_links_analytics_handler &&handler) const
Fetches the existing analytics remote links.
void replace_link(const management::analytics_link &link, const replace_link_analytics_options &options, replace_link_analytics_handler &&handler) const
Replaces an existing analytics remote link.
void create_dataverse(const std::string &dataverse_name, const create_dataverse_analytics_options &options, create_dataverse_analytics_handler &&handler) const
Creates a new dataset (analytics scope).
void drop_dataset(const std::string &dataset_name, const drop_dataset_analytics_options &options, drop_dataset_analytics_handler &&handler) const
Drops (deletes) a dataset.
auto get_all_indexes(const get_all_indexes_analytics_options &options) const -> std::future< std::pair< error, std::vector< management::analytics_index > > >
Fetches all analytics indexes.
auto get_links(const get_links_analytics_options &options) const -> std::future< std::pair< error, std::vector< std::unique_ptr< management::analytics_link > > > >
Fetches the existing analytics remote links.
void get_all_indexes(const get_all_indexes_analytics_options &options, get_all_indexes_analytics_handler &&handler) const
Fetches all analytics indexes.
void drop_dataverse(const std::string &dataverse_name, const drop_dataverse_analytics_options &options, drop_dataverse_analytics_handler &&handler) const
Drops (deletes) a dataverse.
void create_index(const std::string &index_name, const std::string &dataset_name, const std::map< std::string, std::string > &fields, const create_index_analytics_options &options, create_index_analytics_handler &&handler) const
Creates a new analytics index.
auto create_dataverse(const std::string &dataverse_name, const create_dataverse_analytics_options &options) const -> std::future< error >
Creates a new dataset (analytics scope).
auto create_index(const std::string &index_name, const std::string &dataset_name, const std::map< std::string, std::string > &fields, const create_index_analytics_options &options) const -> std::future< error >
Creates a new analytics index.
void get_pending_mutations(const get_pending_mutations_analytics_options &options, get_pending_mutations_analytics_handler &&handler) const
Returns the pending mutations for different dataverses.
auto connect_link(const connect_link_analytics_options &options) const -> std::future< error >
Connects a not yet connected link.
auto drop_link(const std::string &link_name, const std::string &dataverse_name, const drop_link_analytics_options &options) const -> std::future< error >
Drops an existing analytics remote link.
auto drop_index(const std::string &index_name, const std::string &dataset_name, const drop_index_analytics_options &options) const -> std::future< error >
Drops (removes) an analytics index.
void create_link(const management::analytics_link &link, const create_link_analytics_options &options, create_link_analytics_handler &&handler) const
Creates a new analytics remote link.
void connect_link(const connect_link_analytics_options &options, connect_link_analytics_handler &&handler) const
Connects a not yet connected link.
The cluster is the main entry point when connecting to a Couchbase cluster.
Definition cluster.hxx:60
Definition create_dataset_analytics_options.hxx:30
Definition create_dataverse_analytics_options.hxx:28
Definition create_index_analytics_options.hxx:30
Definition drop_dataset_analytics_options.hxx:30
Definition drop_dataverse_analytics_options.hxx:28
Definition drop_index_analytics_options.hxx:30
Definition get_all_datasets_analytics_options.hxx:30
Definition get_all_indexes_analytics_options.hxx:30
Definition get_pending_mutations_analytics_options.hxx:32
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28
std::function< void(error)> create_dataverse_analytics_handler
The signature for the handler of the analytics_index_manager::create_dataverse() operation.
Definition create_dataverse_analytics_options.hxx:84
std::function< void(error)> create_link_analytics_handler
The signature for the handler of the analytics_index_manager::create_link() operation.
Definition create_link_analytics_options.hxx:62
std::function< void(error, std::map< std::string, std::map< std::string, std::int64_t > >)> get_pending_mutations_analytics_handler
The signature for the handler of the analytics_index_manager::get_pending_mutations() operation.
Definition get_pending_mutations_analytics_options.hxx:67
std::function< void(error)> drop_link_analytics_handler
The signature for the handler of the analytics_index_manager::drop_link() operation.
Definition drop_link_analytics_options.hxx:62
std::function< void(error)> create_index_analytics_handler
The signature for the handler of the analytics_index_manager::create_index() operation.
Definition create_index_analytics_options.hxx:102
std::function< void(error, std::vector< std::unique_ptr< management::analytics_link > >)> get_links_analytics_handler
The signature for the handler of the analytics_index_manager::get_links() operation.
Definition get_links_analytics_options.hxx:119
std::function< void(error, std::vector< management::analytics_dataset >)> get_all_datasets_analytics_handler
The signature for the handler of the analytics_index_manager::get_all_datasets() operation.
Definition get_all_datasets_analytics_options.hxx:64
std::function< void(error)> disconnect_link_analytics_handler
The signature for the handler of the analytics_index_manager::disconnect_link() operation.
Definition disconnect_link_analytics_options.hxx:104
std::function< void(error)> drop_dataset_analytics_handler
The signature for the handler of the analytics_index_manager::drop_dataset() operation.
Definition drop_dataset_analytics_options.hxx:102
std::function< void(error)> drop_index_analytics_handler
The signature for the handler of the analytics_index_manager::drop_index() operation.
Definition drop_index_analytics_options.hxx:102
std::function< void(error)> connect_link_analytics_handler
The signature for the handler of the analytics_index_manager::connect_link() operation.
Definition connect_link_analytics_options.hxx:117
std::function< void(error)> replace_link_analytics_handler
The signature for the handler of the analytics_index_manager::replace_link() operation.
Definition replace_link_analytics_options.hxx:62
std::function< void(error, std::vector< management::analytics_index >)> get_all_indexes_analytics_handler
The signature for the handler of the analytics_index_manager::get_all_indexes() operation.
Definition get_all_indexes_analytics_options.hxx:64
std::function< void(error)> create_dataset_analytics_handler
The signature for the handler of the analytics_index_manager::create_dataset() operation.
Definition create_dataset_analytics_options.hxx:119
std::function< void(error)> drop_dataverse_analytics_handler
The signature for the handler of the analytics_index_manager::drop_dataverse() operation.
Definition drop_dataverse_analytics_options.hxx:83