Google Cloud Bigtable C++ Client  1.35.0
A C++ Client Library for Google Cloud Bigtable
options.h
Go to the documentation of this file.
1 // Copyright 2021 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_OPTIONS_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_OPTIONS_H
17 
18 /**
19  * @file
20  *
21  * This file defines options to be used with instances of
22  * `google::cloud::Options`. By convention options are named with an "Option"
23  * suffix. As the name would imply, all options are optional, and leaving them
24  * unset will result in a reasonable default being chosen.
25  *
26  * Not all options are meaningful to all functions that accept a
27  * `google::cloud::Options` instance. Each function that accepts a
28  * `google::cloud::Options` should document which options it expects. This is
29  * typically done by indicating lists of options using "OptionList" aliases.
30  * For example, a function may indicate that users may set any option in
31  * `ClientOptionList`.
32  *
33  * @note Unrecognized options are allowed and will be ignored. To debug issues
34  * with options set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment
35  * and unexpected options will be logged.
36  *
37  * @see `google::cloud::CommonOptionList`
38  * @see `google::cloud::GrpcOptionList`
39  */
40 
41 #include "google/cloud/bigtable/version.h"
42 #include "google/cloud/options.h"
43 #include <chrono>
44 #include <string>
45 
46 namespace google {
47 namespace cloud {
48 namespace bigtable {
50 
51 /// The endpoint for data operations.
53  using Type = std::string;
54 };
55 
56 /// The endpoint for table admin operations.
58  using Type = std::string;
59 };
60 
61 /**
62  * The endpoint for instance admin operations.
63  *
64  * In most scenarios this should have the same value as `AdminEndpointOption`.
65  * The most common exception is testing, where the emulator for instance admin
66  * operations may be different than the emulator for admin and data operations.
67  */
69  using Type = std::string;
70 };
71 
72 /**
73  * Minimum time in ms to refresh connections.
74  *
75  * The server will not disconnect idle connections before this time.
76  */
78  using Type = std::chrono::milliseconds;
79 };
80 
81 /**
82  * Maximum time in ms to refresh connections.
83  *
84  * The server will disconnect idle connections before this time. The
85  * connections will not be automatically refreshed in the background if this
86  * value is set to `0`.
87  *
88  * @note If this value is less than the value of `MinConnectionRefreshOption`,
89  * it will be set to the value of `MinConnectionRefreshOption`.
90  */
92  using Type = std::chrono::milliseconds;
93 };
94 
95 /// The complete list of options accepted by `bigtable::*Client`
96 using ClientOptionList =
100 
102 } // namespace bigtable
103 } // namespace cloud
104 } // namespace google
105 
106 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_OPTIONS_H