Couchbase C++ SDK 1.0.1 (rev. 58d46d7)
Loading...
Searching...
No Matches
query_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 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
28
29#include <future>
30#include <memory>
31
32namespace couchbase
33{
34#ifndef COUCHBASE_CXX_CLIENT_DOXYGEN
35namespace core
36{
37class cluster;
38} // namespace core
39class query_index_manager_impl;
40#endif
41
49{
50public:
61 void get_all_indexes(const std::string& bucket_name,
62 const get_all_query_indexes_options& options,
63 get_all_query_indexes_handler&& handler) const;
64
75 [[nodiscard]] auto get_all_indexes(const std::string& bucket_name,
76 const get_all_query_indexes_options& options) const
77 -> std::future<std::pair<error, std::vector<management::query_index>>>;
78
91 void create_index(const std::string& bucket_name,
92 std::string index_name,
93 std::vector<std::string> keys,
94 const create_query_index_options& options,
95 create_query_index_handler&& handler) const;
96
109 [[nodiscard]] auto create_index(const std::string& bucket_name,
110 std::string index_name,
111 std::vector<std::string> keys,
112 const create_query_index_options& options) const
113 -> std::future<error>;
114
125 void create_primary_index(const std::string& bucket_name,
127 create_primary_query_index_handler&& handler) const;
128
139 [[nodiscard]] auto create_primary_index(const std::string& bucket_name,
140 const create_primary_query_index_options& options) const
141 -> std::future<error>;
142
153 void drop_primary_index(const std::string& bucket_name,
155 drop_primary_query_index_handler&& handler) const;
156
167 [[nodiscard]] auto drop_primary_index(const std::string& bucket_name,
168 const drop_primary_query_index_options& options) const
169 -> std::future<error>;
170
182 void drop_index(const std::string& bucket_name,
183 std::string index_name,
184 const drop_query_index_options& options,
185 drop_query_index_handler&& handler) const;
186
198 [[nodiscard]] auto drop_index(const std::string& bucket_name,
199 std::string index_name,
200 const drop_query_index_options& options) const
201 -> std::future<error>;
202
215 void build_deferred_indexes(const std::string& bucket_name,
216 const build_query_index_options& options,
218
231 [[nodiscard]] auto build_deferred_indexes(const std::string& bucket_name,
232 const build_query_index_options& options) const
233 -> std::future<error>;
234
246 void watch_indexes(const std::string& bucket_name,
247 std::vector<std::string> index_names,
248 const watch_query_indexes_options& options,
249 watch_query_indexes_handler&& handler) const;
250
262 [[nodiscard]] auto watch_indexes(const std::string& bucket_name,
263 std::vector<std::string> index_names,
264 const watch_query_indexes_options& options) const
265 -> std::future<error>;
266
267private:
268 friend class cluster;
269
270 explicit query_index_manager(core::cluster core);
271
272 std::shared_ptr<query_index_manager_impl> impl_;
273};
274} // namespace couchbase
Options for query_index_manager::build_deferred_indexes().
Definition build_query_index_options.hxx:37
The cluster is the main entry point when connecting to a Couchbase cluster.
Definition cluster.hxx:60
Definition create_primary_query_index_options.hxx:30
Definition create_query_index_options.hxx:30
Definition drop_primary_query_index_options.hxx:29
Definition drop_query_index_options.hxx:29
Definition get_all_query_indexes_options.hxx:33
The Query Index Manager interface contains the means for managing indexes used for queries.
Definition query_index_manager.hxx:49
auto build_deferred_indexes(const std::string &bucket_name, const build_query_index_options &options) const -> std::future< error >
Builds all currently deferred indexes.
auto drop_index(const std::string &bucket_name, std::string index_name, const drop_query_index_options &options) const -> std::future< error >
Drop specified query index.
auto create_index(const std::string &bucket_name, std::string index_name, std::vector< std::string > keys, const create_query_index_options &options) const -> std::future< error >
Create an index on a bucket.
void create_index(const std::string &bucket_name, std::string index_name, std::vector< std::string > keys, const create_query_index_options &options, create_query_index_handler &&handler) const
Create an index on a bucket.
void watch_indexes(const std::string &bucket_name, std::vector< std::string > index_names, const watch_query_indexes_options &options, watch_query_indexes_handler &&handler) const
Polls the state of a set of indexes, until they all are online.
void build_deferred_indexes(const std::string &bucket_name, const build_query_index_options &options, build_deferred_query_indexes_handler &&handler) const
Builds all currently deferred indexes.
auto create_primary_index(const std::string &bucket_name, const create_primary_query_index_options &options) const -> std::future< error >
Create a primary index on a bucket.
auto drop_primary_index(const std::string &bucket_name, const drop_primary_query_index_options &options) const -> std::future< error >
Drop primary index on a bucket.
void get_all_indexes(const std::string &bucket_name, const get_all_query_indexes_options &options, get_all_query_indexes_handler &&handler) const
Get all indexes within a bucket.
auto get_all_indexes(const std::string &bucket_name, const get_all_query_indexes_options &options) const -> std::future< std::pair< error, std::vector< management::query_index > > >
Get all indexes within a bucket.
auto watch_indexes(const std::string &bucket_name, std::vector< std::string > index_names, const watch_query_indexes_options &options) const -> std::future< error >
Polls the state of a set of indexes, until they all are online.
void create_primary_index(const std::string &bucket_name, const create_primary_query_index_options &options, create_primary_query_index_handler &&handler) const
Create a primary index on a bucket.
void drop_index(const std::string &bucket_name, std::string index_name, const drop_query_index_options &options, drop_query_index_handler &&handler) const
Drop specified query index.
void drop_primary_index(const std::string &bucket_name, const drop_primary_query_index_options &options, drop_primary_query_index_handler &&handler) const
Drop primary index on a bucket.
Definition watch_query_indexes_options.hxx:29
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28
std::function< void(error)> drop_query_index_handler
The signature for the handler of the query_index_manager::get_all_indexes() operation.
Definition drop_query_index_options.hxx:84
std::function< void(error)> create_query_index_handler
The signature for the handler of the query_index_manager::get_all_indexes() operation.
Definition create_query_index_options.hxx:139
std::function< void(error)> watch_query_indexes_handler
The signature for the handler of the query_index_manager::get_all_indexes() operation.
Definition watch_query_indexes_options.hxx:83
std::function< void(error)> create_primary_query_index_handler
The signature for the handler of the query_index_manager::get_all_indexes() operation.
Definition create_primary_query_index_options.hxx:137
std::function< void(error)> build_deferred_query_indexes_handler
The signature for the handler of the query_index_manager::build_deferred_indexes() operation.
Definition build_query_index_options.hxx:68
std::function< void(error)> drop_primary_query_index_handler
The signature for the handler of the query_index_manager::get_all_indexes() operation.
Definition drop_primary_query_index_options.hxx:98
std::function< void(error, std::vector< management::query_index >)> get_all_query_indexes_handler
The signature for the handler of the query_index_manager::get_all_indexes() operation.
Definition get_all_query_indexes_options.hxx:68