15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_SESSION_POOL_OPTIONS_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_SESSION_POOL_OPTIONS_H
18#include "google/cloud/spanner/internal/defaults.h"
19#include "google/cloud/spanner/options.h"
20#include "google/cloud/spanner/version.h"
21#include "google/cloud/grpc_options.h"
30GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
32GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
35namespace spanner_internal {
36GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
38GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
42GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
65
66
67
68
69
70
71
74 opts_
= spanner_internal::DefaultOptions(std::move(opts_));
79
80
81
82
83
93
94
95
107
108
109
127
128
129
135
136
137
138
139
151
152
153
154
155
162 std::map<std::string, std::string>
const&
labels()
const {
171GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
174namespace spanner_internal {
175GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
177 return std::move(old.opts_);
179GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
ValueTypeT< T > const & get() const
Options & set(ValueTypeT< T > v)
Options & operator=(Options &&)=default
Controls the session pool maintained by a spanner::Client.
Definition: session_pool_options.h:60
SessionPoolOptions & set_labels(std::map< std::string, std::string > labels)
Set the labels used when creating sessions within the pool.
Definition: session_pool_options.h:156
int max_idle_sessions() const
Return the maximum number of idle sessions to keep in the pool.
Definition: session_pool_options.h:116
std::map< std::string, std::string > const & labels() const
Return the labels used when creating sessions within the pool.
Definition: session_pool_options.h:162
SessionPoolOptions & set_keep_alive_interval(std::chrono::seconds interval)
Set the interval at which we refresh sessions so they don't get collected by the backend GC.
Definition: session_pool_options.h:140
int max_sessions_per_channel() const
Return the minimum number of sessions to keep in the pool.
Definition: session_pool_options.h:102
SessionPoolOptions & set_max_sessions_per_channel(int count)
Set the maximum number of sessions to create on each channel.
Definition: session_pool_options.h:96
SessionPoolOptions & set_max_idle_sessions(int count)
Set the maximum number of sessions to keep in the pool in an idle state.
Definition: session_pool_options.h:110
std::chrono::seconds keep_alive_interval() const
Return the interval at which we refresh sessions to prevent GC.
Definition: session_pool_options.h:146
ActionOnExhaustion action_on_exhaustion() const
Return the action to take (kBlock or kFail) when attempting to allocate a session when the pool is ex...
Definition: session_pool_options.h:130
SessionPoolOptions & set_min_sessions(int count)
Set the minimum number of sessions to keep in the pool.
Definition: session_pool_options.h:84
SessionPoolOptions & EnforceConstraints(int num_channels)
Enforce the stated constraints on the option values, altering them if necessary.
Definition: session_pool_options.h:72
int min_sessions() const
Return the minimum number of sessions to keep in the pool.
Definition: session_pool_options.h:90
SessionPoolOptions & set_action_on_exhaustion(ActionOnExhaustion action)
Set whether to block or fail on pool exhaustion.
Definition: session_pool_options.h:121
SessionPoolOptions()
Definition: session_pool_options.h:62
Contains all the Cloud Spanner C++ client types and functions.
Definition: backoff_policy.h:23
ActionOnExhaustion
Action to take when the session pool is exhausted.
Definition: options.h:158
Option for google::cloud::Options to set the action to take when attempting to allocate a session whe...
Definition: options.h:165
Option for google::cloud::Options to set the interval at which we refresh sessions so they don't get ...
Definition: options.h:179
Option for google::cloud::Options to set the labels used when creating sessions within the pool.
Definition: options.h:193
Option for google::cloud::Options to set the maximum number of sessions to keep in the pool in an idl...
Definition: options.h:153
Option for google::cloud::Options to set the maximum number of sessions to create on each channel.
Definition: options.h:141
Option for google::cloud::Options to set the minimum number of sessions to keep in the pool.
Definition: options.h:129