Google Cloud Bigtable C++ Client 2.13.0
A C++ Client Library for Google Cloud Bigtable
|
Configuration options for the Bigtable Client. More...
#include <google/cloud/bigtable/client_options.h>
Public Types | |
using | BackgroundThreadsFactory = ::google::cloud::BackgroundThreadsFactory |
Backwards compatibility alias. More... | |
Public Member Functions | |
ClientOptions () | |
Initialize the client options. More... | |
ClientOptions (Options opts) | |
Initialize the client options. More... | |
ClientOptions (std::shared_ptr< grpc::ChannelCredentials > creds) | |
Connect to the production instance of Cloud Bigtable using creds . More... | |
std::string const & | data_endpoint () const |
Return the current endpoint for data RPCs. More... | |
ClientOptions & | set_data_endpoint (std::string endpoint) |
Set the current endpoint for data RPCs. More... | |
std::string const & | admin_endpoint () const |
Return the current endpoint for admin RPCs. More... | |
ClientOptions & | set_admin_endpoint (std::string endpoint) |
Set the current endpoint for admin RPCs. More... | |
ClientOptions & | set_connection_pool_name (std::string name) |
Set the name of the connection pool. More... | |
std::string const & | connection_pool_name () const |
Return the name of the connection pool. More... | |
ClientOptions & | set_connection_pool_size (std::size_t size) |
Set the size of the connection pool. More... | |
std::size_t | connection_pool_size () const |
Return the size of the connection pool. More... | |
std::shared_ptr< grpc::ChannelCredentials > | credentials () const |
Return the current credentials. More... | |
ClientOptions & | SetCredentials (std::shared_ptr< grpc::ChannelCredentials > credentials) |
Set the current credentials. More... | |
grpc::ChannelArguments | channel_arguments () const |
Access all the channel arguments. More... | |
ClientOptions & | set_channel_arguments (grpc::ChannelArguments const &channel_arguments) |
Set all the channel arguments. More... | |
void | SetCompressionAlgorithm (grpc_compression_algorithm algorithm) |
Set compression algorithm for channel. More... | |
template<typename Rep , typename Period > | |
google::cloud::Status | SetGrpclbFallbackTimeout (std::chrono::duration< Rep, Period > fallback_timeout) |
Set the grpclb fallback timeout with the timestamp fallback_timeout for the channel. More... | |
void | SetUserAgentPrefix (grpc::string const &user_agent_prefix) |
Set the string to prepend to the user agent. More... | |
void | SetResourceQuota (grpc::ResourceQuota const &resource_quota) |
Set the buffer pool to be attached to the constructed channel. More... | |
void | SetMaxReceiveMessageSize (int size) |
Set the max receive message size in bytes. More... | |
void | SetMaxSendMessageSize (int size) |
Set the max send message size in bytes. More... | |
void | SetLoadBalancingPolicyName (grpc::string const &lb_policy_name) |
Set LB policy name. More... | |
void | SetServiceConfigJSON (grpc::string const &service_config_json) |
Set service config in JSON form. More... | |
void | SetSslTargetNameOverride (grpc::string const &name) |
Set target name override for SSL host name checking. More... | |
bool | tracing_enabled (std::string const &component) const |
Return whether tracing is enabled for the given component . More... | |
ClientOptions & | enable_tracing (std::string const &component) |
Enable tracing for component in clients configured with this object. More... | |
ClientOptions & | disable_tracing (std::string const &component) |
Disable tracing for component in clients configured with this object. More... | |
TracingOptions const & | tracing_options () const |
Return the options for use when tracing RPCs. More... | |
std::chrono::milliseconds | max_conn_refresh_period () |
Maximum connection refresh period, as set via set_max_conn_refresh_period More... | |
ClientOptions & | set_max_conn_refresh_period (std::chrono::milliseconds period) |
If set to a positive number, the client will refresh connections at random moments not more apart from each other than this duration. More... | |
std::chrono::milliseconds | min_conn_refresh_period () |
Minimum connection refresh period, as set via set_min_conn_refresh_period More... | |
ClientOptions & | set_min_conn_refresh_period (std::chrono::milliseconds period) |
Configures the minimum connection refresh period. More... | |
ClientOptions & | set_background_thread_pool_size (std::size_t s) |
Set the number of background threads. More... | |
std::size_t | background_thread_pool_size () const |
Return the number of background threads. More... | |
ClientOptions & | DisableBackgroundThreads (google::cloud::CompletionQueue const &cq) |
Configure the connection to use cq for all background work. More... | |
BackgroundThreadsFactory | background_threads_factory () const |
Static Public Member Functions | |
static std::string | UserAgentPrefix () |
Return the user agent prefix used by the library. More... | |
Friends | |
struct | ClientOptionsTestTraits |
Configuration options for the Bigtable Client.
Applications typically configure the client class using:
google::cloud::Options
instead. using google::cloud::bigtable::ClientOptions::BackgroundThreadsFactory = ::google::cloud::BackgroundThreadsFactory |
Backwards compatibility alias.
google::cloud::BackgroundThreadsFactory
directly google::cloud::bigtable::ClientOptions::ClientOptions | ( | ) |
Initialize the client options.
Configure the client to connect to the Cloud Bigtable service, using the default options.
BIGTABLE_EMULATOR_HOST
environment variable is set, the default configuration changes in important ways:grpc::InsecureCredentials()
.host:port
string) set in the environment variable.This makes it easy to test applications using the Cloud Bigtable Emulator.
grpc::GoogleDefaultCredentials
in the grpc documentation google::cloud::Options
instead.
|
explicit |
Initialize the client options.
Expected options are any of the types in the following option lists.
google::cloud::CommonOptionList
google::cloud::GrpcOptionList
google::cloud::bigtable::ClientOptionList
GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes
in the environment and unexpected options will be logged.opts | (optional) configuration options |
google::cloud::Options
directly instead.
|
explicit |
Connect to the production instance of Cloud Bigtable using creds
.
This constructor always connects to the production instance of Cloud Bigtable, and can be used when the application default credentials are not configured in the environment where the application is running.
creds | gRPC authentication credentials |
google::cloud::Options
with google::cloud::GrpcCredentialOption
instead.
|
inline |
Return the current endpoint for admin RPCs.
google::cloud::Options
with google::cloud::EndpointOption
instead.
|
inline |
Return the number of background threads.
DisableBackgroundThreads()
is called.google::cloud::Options
with google::cloud::GrpcBackgroundThreadPoolSizeOption
instead. BackgroundThreadsFactory google::cloud::bigtable::ClientOptions::background_threads_factory | ( | ) | const |
|
inline |
Access all the channel arguments.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsOption
or google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Return the name of the connection pool.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsOption
or google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Return the size of the connection pool.
google::cloud::Options
with google::cloud::GrpcNumChannelsOption
instead.
|
inline |
Return the current credentials.
google::cloud::Options
with google::cloud::GrpcCredentialOption
instead.
|
inline |
Return the current endpoint for data RPCs.
google::cloud::Options
with google::cloud::EndpointOption
instead.
|
inline |
Disable tracing for component
in clients configured with this object.
google::cloud::Options
with google::cloud::TracingComponentsOption
instead. ClientOptions & google::cloud::bigtable::ClientOptions::DisableBackgroundThreads | ( | google::cloud::CompletionQueue const & | cq | ) |
Configure the connection to use cq
for all background work.
Connections need to perform background work on behalf of the application. Normally they just create a background thread and a CompletionQueue
for this work, but the application may need more fine-grained control of their threads. In this case the application can provide the CompletionQueue
and it assumes responsibility for creating one or more threads blocked on CompletionQueue::Run()
.
google::cloud::Options
with google::cloud::GrpcCompletionQueueOption
instead.
|
inline |
Enable tracing for component
in clients configured with this object.
google::cloud::Options
with google::cloud::TracingComponentsOption
instead.
|
inline |
Maximum connection refresh period, as set via set_max_conn_refresh_period
google::cloud::Options
with bigtable::MinConnectionRefreshOption
and bigtable::MaxConnectionRefreshOption
instead.
|
inline |
Minimum connection refresh period, as set via set_min_conn_refresh_period
google::cloud::Options
with bigtable::MinConnectionRefreshOption
and bigtable::MaxConnectionRefreshOption
instead.
|
inline |
Set the current endpoint for admin RPCs.
google::cloud::Options
with google::cloud::EndpointOption
instead.
|
inline |
Set the number of background threads.
DisableBackgroundThreads()
is called.google::cloud::Options
with google::cloud::GrpcBackgroundThreadPoolSizeOption
instead.
|
inline |
Set all the channel arguments.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Set the name of the connection pool.
gRPC typically opens a single connection for each destination. To improve performance, the Cloud Bigtable C++ client can open multiple connections to a given destination, but these connections are shared by all threads in the application. Sometimes the application may want even more segregation, for example, the application may want to use a different pool for high-priority requests vs. lower priority ones. Using different names creates segregated pools.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsOption
or google::cloud::GrpcChannelArgumentsNativeOption
instead. ClientOptions & google::cloud::bigtable::ClientOptions::set_connection_pool_size | ( | std::size_t | size | ) |
Set the size of the connection pool.
Specifying 0 for size
will set the size of the connection pool to default.
google::cloud::Options
with google::cloud::GrpcNumChannelsOption
instead.
|
inline |
Set the current endpoint for data RPCs.
google::cloud::Options
with google::cloud::EndpointOption
instead.
|
inline |
If set to a positive number, the client will refresh connections at random moments not more apart from each other than this duration.
This is necessary to avoid all connections simultaneously expiring and causing latency spikes.
If needed it changes max_conn_refresh_period() to preserve the invariant:
google::cloud::Options
with bigtable::MinConnectionRefreshOption
and bigtable::MaxConnectionRefreshOption
instead.
|
inline |
Configures the minimum connection refresh period.
The library will wait at least this long before attempting any refresh operation.
If needed it changes max_conn_refresh_period() to preserve the invariant:
google::cloud::Options
with bigtable::MinConnectionRefreshOption
and bigtable::MaxConnectionRefreshOption
instead.
|
inline |
Set compression algorithm for channel.
Please see the docs for grpc::ChannelArguments::SetCompressionAlgorithm() on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html for more details.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Set the current credentials.
google::cloud::Options
with google::cloud::GrpcCredentialOption
instead.
|
inline |
Set the grpclb
fallback timeout with the timestamp fallback_timeout
for the channel.
For example:
Rep | a placeholder to match the Rep tparam for fallback_timeout , the semantics of this template parameter are documented in std::chrono::duration<> (in brief, the underlying arithmetic type used to store the number of ticks), for our purposes it is simply a formal parameter. |
Period | a placeholder to match the Period tparam for fallback_timeout , the semantics of this template parameter are documented in std::chrono::duration<> (in brief, the length of the tick in seconds, expressed as a std::ratio<> ), for our purposes it is simply a formal parameter. |
Please see the docs for grpc::ChannelArguments::SetGrpclbFallbackTimeout()
on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html for more details.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Set LB policy name.
Please see the docs for grpc::ChannelArguments::SetLoadBalancingPolicyName() on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html for more details.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Set the max receive message size in bytes.
-1 means unlimited.
Please see the docs for grpc::ChannelArguments::SetMaxReceiveMessageSize()
on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html for more details.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Set the max send message size in bytes.
-1 means unlimited.
Please see the docs for grpc::ChannelArguments::SetMaxSendMessageSize() on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html for more details.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Set the buffer pool to be attached to the constructed channel.
Please see the docs for grpc::ChannelArguments::SetResourceQuota()
on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html for more details.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Set service config in JSON form.
Please see the docs for grpc::ChannelArguments::SetServiceConfigJSON() on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html for more details.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Set target name override for SSL host name checking.
Please see the docs for grpc::ChannelArguments::SetSslTargetNameOverride() on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html for more details.
google::cloud::Options
with google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Set the string to prepend to the user agent.
Please see the docs for grpc::ChannelArguments::SetUserAgentPrefix()
on https://grpc.io/grpc/cpp/classgrpc_1_1_channel_arguments.html for more details.
google::cloud::Options
with google::cloud::UserAgentProductsOption
or google::cloud::GrpcChannelArgumentsNativeOption
instead.
|
inline |
Return whether tracing is enabled for the given component
.
The C++ clients can log interesting events to help library and application developers troubleshoot problems. This flag returns true if tracing should be enabled by clients configured with this option.
google::cloud::Options
with google::cloud::TracingComponentsOption
instead.
|
inline |
Return the options for use when tracing RPCs.
google::cloud::Options
with google::cloud::GrpcTracingOptionsOption
instead.
|
static |
Return the user agent prefix used by the library.
|
friend |