|
12 | 12 | // See the License for the specific language governing permissions and |
13 | 13 | // limitations under the License. |
14 | 14 |
|
15 | | -#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_CHANNEL_POOL_H |
16 | | -#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_CHANNEL_POOL_H |
| 15 | +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_DYNAMIC_CHANNEL_POOL_H |
| 16 | +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_DYNAMIC_CHANNEL_POOL_H |
17 | 17 |
|
18 | 18 | #include "google/cloud/completion_queue.h" |
19 | 19 | #include "google/cloud/internal/random.h" |
|
26 | 26 |
|
27 | 27 | namespace google { |
28 | 28 | namespace cloud { |
| 29 | +namespace bigtable_internal { |
29 | 30 | GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN |
30 | | -namespace internal { |
31 | 31 |
|
32 | 32 | template <typename T> |
33 | 33 | class StubUsageWrapper |
@@ -63,18 +63,6 @@ class StubUsageWrapper |
63 | 63 | int outstanding_rpcs_ = 0; |
64 | 64 | }; |
65 | 65 |
|
66 | | -template <typename T> |
67 | | -class StaticChannelPool { |
68 | | - public: |
69 | | - explicit StaticChannelPool(std::size_t size); |
70 | | - |
71 | | - std::shared_ptr<T> GetChannel(); |
72 | | - std::shared_ptr<T> GetChannel(std::size_t index); |
73 | | - |
74 | | - private: |
75 | | - std::vector<T> channels_; |
76 | | -}; |
77 | | - |
78 | 66 | template <typename T> |
79 | 67 | class DynamicChannelPool |
80 | 68 | : public std::enable_shared_from_this<DynamicChannelPool<T>> { |
@@ -138,18 +126,6 @@ class DynamicChannelPool |
138 | 126 | return channels_.size(); |
139 | 127 | } |
140 | 128 |
|
141 | | - // std::shared_ptr<StubUsageWrapper<T>> GetChannel( |
142 | | - // std::unique_lock<std::mutex> const&) { |
143 | | - // // TODO: check for empty |
144 | | - // return channels_[0]; |
145 | | - // } |
146 | | - // |
147 | | - // std::shared_ptr<StubUsageWrapper<T>> GetChannel( |
148 | | - // std::unique_lock<std::mutex> const&, std::size_t index) { |
149 | | - // // TODO: bounds check |
150 | | - // return channels_[index]; |
151 | | - // } |
152 | | - |
153 | 129 | std::shared_ptr<StubUsageWrapper<T>> GetChannelRandomTwoLeastUsed() { |
154 | 130 | std::unique_lock<std::mutex> lk(mu_); |
155 | 131 | std::cout << __PRETTY_FUNCTION__ << ": channels_size()=" << channels_.size() |
@@ -333,9 +309,9 @@ class DynamicChannelPool |
333 | 309 | int next_channel_id_; |
334 | 310 | }; |
335 | 311 |
|
336 | | -} // namespace internal |
337 | 312 | GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END |
| 313 | +} // namespace bigtable_internal |
338 | 314 | } // namespace cloud |
339 | 315 | } // namespace google |
340 | 316 |
|
341 | | -#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_CHANNEL_POOL_H |
| 317 | +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_DYNAMIC_CHANNEL_POOL_H |
0 commit comments