Skip to content

Commit 97d4f82

Browse files
committed
undo some of the renaming
1 parent 4b11b16 commit 97d4f82

11 files changed

+24
-52
lines changed

google/cloud/bigtable/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ add_library(
196196
internal/default_row_reader.h
197197
internal/defaults.cc
198198
internal/defaults.h
199+
internal/dynamic_channel_pool.cc
200+
internal/dynamic_channel_pool.h
199201
internal/google_bytes_traits.cc
200202
internal/google_bytes_traits.h
201203
internal/legacy_async_bulk_apply.cc
@@ -493,6 +495,7 @@ if (BUILD_TESTING)
493495
internal/data_tracing_connection_test.cc
494496
internal/default_row_reader_test.cc
495497
internal/defaults_test.cc
498+
internal/dynamic_channel_pool_test.cc
496499
internal/google_bytes_traits_test.cc
497500
internal/legacy_async_bulk_apply_test.cc
498501
internal/legacy_async_row_reader_test.cc

google/cloud/bigtable/bigtable_client_unit_tests.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ bigtable_client_unit_tests = [
5656
"internal/data_tracing_connection_test.cc",
5757
"internal/default_row_reader_test.cc",
5858
"internal/defaults_test.cc",
59+
"internal/dynamic_channel_pool_test.cc",
5960
"internal/google_bytes_traits_test.cc",
6061
"internal/legacy_async_bulk_apply_test.cc",
6162
"internal/legacy_async_row_reader_test.cc",

google/cloud/bigtable/google_cloud_cpp_bigtable.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ google_cloud_cpp_bigtable_hdrs = [
9696
"internal/data_tracing_connection.h",
9797
"internal/default_row_reader.h",
9898
"internal/defaults.h",
99+
"internal/dynamic_channel_pool.h",
99100
"internal/google_bytes_traits.h",
100101
"internal/legacy_async_bulk_apply.h",
101102
"internal/legacy_async_row_reader.h",
@@ -219,6 +220,7 @@ google_cloud_cpp_bigtable_srcs = [
219220
"internal/data_tracing_connection.cc",
220221
"internal/default_row_reader.cc",
221222
"internal/defaults.cc",
223+
"internal/dynamic_channel_pool.cc",
222224
"internal/google_bytes_traits.cc",
223225
"internal/legacy_async_bulk_apply.cc",
224226
"internal/legacy_async_row_reader.cc",

google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Generated by the Codegen C++ plugin.
16-
// If you make any local changes, they will be lost.
17-
// source: google/bigtable/v2/bigtable.proto
18-
1915
#include "google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h"
2016
#include <memory>
2117
#include <mutex>
@@ -79,10 +75,10 @@ class AsyncStreamingReadRpcTracking
7975

8076
BigtableRandomTwoLeastUsed::BigtableRandomTwoLeastUsed(
8177
CompletionQueue cq,
82-
internal::DynamicChannelPool<BigtableStub>::StubFactoryFn
78+
DynamicChannelPool<BigtableStub>::StubFactoryFn
8379
refreshing_channel_stub_factory_fn,
8480
std::vector<std::shared_ptr<BigtableStub>> children)
85-
: pool_(internal::DynamicChannelPool<BigtableStub>::Create(
81+
: pool_(DynamicChannelPool<BigtableStub>::Create(
8682
std::move(cq), std::move(children),
8783
std::move(refreshing_channel_stub_factory_fn))) {}
8884

@@ -328,7 +324,7 @@ BigtableRandomTwoLeastUsed::AsyncPrepareQuery(
328324
return result;
329325
}
330326

331-
std::shared_ptr<internal::StubUsageWrapper<BigtableStub>>
327+
std::shared_ptr<StubUsageWrapper<BigtableStub>>
332328
BigtableRandomTwoLeastUsed::Child() {
333329
std::cout << __PRETTY_FUNCTION__ << std::endl;
334330
return pool_->GetChannelRandomTwoLeastUsed();

google/cloud/bigtable/internal/bigtable_random_two_least_used_decorator.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Generated by the Codegen C++ plugin.
16-
// If you make any local changes, they will be lost.
17-
// source: google/bigtable/v2/bigtable.proto
18-
1915
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_RANDOM_TWO_LEAST_USED_DECORATOR_H
2016
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_BIGTABLE_RANDOM_TWO_LEAST_USED_DECORATOR_H
2117

2218
#include "google/cloud/bigtable/internal/bigtable_stub.h"
23-
#include "google/cloud/internal/channel_pool.h"
19+
#include "google/cloud/bigtable/internal/dynamic_channel_pool.h"
2420
#include "google/cloud/version.h"
2521
#include <memory>
2622
#include <mutex>
@@ -35,7 +31,7 @@ class BigtableRandomTwoLeastUsed : public BigtableStub {
3531
public:
3632
BigtableRandomTwoLeastUsed(
3733
CompletionQueue cq,
38-
internal::DynamicChannelPool<BigtableStub>::StubFactoryFn
34+
DynamicChannelPool<BigtableStub>::StubFactoryFn
3935
refreshing_channel_stub_factory_fn,
4036
std::vector<std::shared_ptr<BigtableStub>> children);
4137
~BigtableRandomTwoLeastUsed() override = default;
@@ -134,10 +130,10 @@ class BigtableRandomTwoLeastUsed : public BigtableStub {
134130
google::bigtable::v2::PrepareQueryRequest const& request) override;
135131

136132
private:
137-
std::shared_ptr<internal::StubUsageWrapper<BigtableStub>> Child();
133+
std::shared_ptr<StubUsageWrapper<BigtableStub>> Child();
138134

139135
// std::mutex mu_;
140-
std::shared_ptr<internal::DynamicChannelPool<BigtableStub>> pool_;
136+
std::shared_ptr<DynamicChannelPool<BigtableStub>> pool_;
141137
};
142138

143139
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END

google/cloud/internal/channel_pool.cc renamed to google/cloud/bigtable/internal/dynamic_channel_pool.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "google/cloud/internal/channel_pool.h"
15+
#include "google/cloud/bigtable/internal/dynamic_channel_pool.h"
1616
#include "google/cloud/version.h"
1717

1818
namespace google {
1919
namespace cloud {
20+
namespace bigtable_internal {
2021
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2122
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
23+
} // namespace bigtable_internal
2224
} // namespace cloud
2325
} // namespace google

google/cloud/internal/channel_pool.h renamed to google/cloud/bigtable/internal/dynamic_channel_pool.h

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

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
1717

1818
#include "google/cloud/completion_queue.h"
1919
#include "google/cloud/internal/random.h"
@@ -26,8 +26,8 @@
2626

2727
namespace google {
2828
namespace cloud {
29+
namespace bigtable_internal {
2930
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
30-
namespace internal {
3131

3232
template <typename T>
3333
class StubUsageWrapper
@@ -63,18 +63,6 @@ class StubUsageWrapper
6363
int outstanding_rpcs_ = 0;
6464
};
6565

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-
7866
template <typename T>
7967
class DynamicChannelPool
8068
: public std::enable_shared_from_this<DynamicChannelPool<T>> {
@@ -138,18 +126,6 @@ class DynamicChannelPool
138126
return channels_.size();
139127
}
140128

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-
153129
std::shared_ptr<StubUsageWrapper<T>> GetChannelRandomTwoLeastUsed() {
154130
std::unique_lock<std::mutex> lk(mu_);
155131
std::cout << __PRETTY_FUNCTION__ << ": channels_size()=" << channels_.size()
@@ -333,9 +309,9 @@ class DynamicChannelPool
333309
int next_channel_id_;
334310
};
335311

336-
} // namespace internal
337312
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
313+
} // namespace bigtable_internal
338314
} // namespace cloud
339315
} // namespace google
340316

341-
#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_INTERNAL_CHANNEL_POOL_H
317+
#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_DYNAMIC_CHANNEL_POOL_H

google/cloud/internal/channel_pool_test.cc renamed to google/cloud/bigtable/internal/dynamic_channel_pool_test.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "google/cloud/internal/channel_pool.h"
15+
#include "google/cloud/bigtable/internal/dynamic_channel_pool.h"
1616
#include "google/cloud/testing_util/status_matchers.h"
1717
#include <gmock/gmock.h>
1818

1919
namespace google {
2020
namespace cloud {
21+
namespace bigtable_internal {
2122
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2223
namespace internal {} // namespace internal
2324
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
25+
} // namespace bigtable_internal
2426
} // namespace cloud
2527
} // namespace google

google/cloud/google_cloud_cpp_grpc_utils.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ google_cloud_cpp_grpc_utils_hdrs = [
5454
"internal/async_streaming_write_rpc_timeout.h",
5555
"internal/async_streaming_write_rpc_tracing.h",
5656
"internal/background_threads_impl.h",
57-
"internal/channel_pool.h",
5857
"internal/completion_queue_impl.h",
5958
"internal/debug_string_protobuf.h",
6059
"internal/debug_string_status.h",
@@ -96,7 +95,6 @@ google_cloud_cpp_grpc_utils_srcs = [
9695
"internal/async_connection_ready.cc",
9796
"internal/async_polling_loop.cc",
9897
"internal/background_threads_impl.cc",
99-
"internal/channel_pool.cc",
10098
"internal/debug_string_protobuf.cc",
10199
"internal/debug_string_status.cc",
102100
"internal/default_completion_queue_impl.cc",

google/cloud/google_cloud_cpp_grpc_utils.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ add_library(
6161
internal/async_streaming_write_rpc_tracing.h
6262
internal/background_threads_impl.cc
6363
internal/background_threads_impl.h
64-
internal/channel_pool.cc
65-
internal/channel_pool.h
6664
internal/completion_queue_impl.h
6765
internal/debug_string_protobuf.cc
6866
internal/debug_string_protobuf.h
@@ -258,7 +256,6 @@ if (BUILD_TESTING)
258256
internal/async_streaming_write_rpc_timeout_test.cc
259257
internal/async_streaming_write_rpc_tracing_test.cc
260258
internal/background_threads_impl_test.cc
261-
internal/channel_pool_test.cc
262259
internal/debug_string_protobuf_test.cc
263260
internal/debug_string_status_test.cc
264261
internal/extract_long_running_result_test.cc

0 commit comments

Comments
 (0)