From 968483ff955513c2bf8a41b56bf8ab5eeea379bc Mon Sep 17 00:00:00 2001 From: vjpai Date: Thu, 24 Mar 2016 09:31:16 -0700 Subject: [PATCH 01/12] Fix the #ifdef to align with the new unix socket ifdef in general --- src/core/surface/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/surface/init.c b/src/core/surface/init.c index 233572a9f34..bd58f1d0670 100644 --- a/src/core/surface/init.c +++ b/src/core/surface/init.c @@ -172,7 +172,7 @@ void grpc_init(void) { grpc_register_resolver_type(grpc_dns_resolver_factory_create()); grpc_register_resolver_type(grpc_ipv4_resolver_factory_create()); grpc_register_resolver_type(grpc_ipv6_resolver_factory_create()); -#ifdef GPR_POSIX_SOCKET +#ifdef GPR_HAVE_UNIX_SOCKET grpc_register_resolver_type(grpc_unix_resolver_factory_create()); #endif grpc_register_tracer("api", &grpc_api_trace); From 81dbf84ded56f5f0fe8884e0bc151167fd5bec1c Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 24 Mar 2016 10:34:27 -0700 Subject: [PATCH 02/12] Change empty function to an assert since calling this code would be very bad right now. Added a TODO --- src/core/iomgr/unix_sockets_posix_noop.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/iomgr/unix_sockets_posix_noop.c b/src/core/iomgr/unix_sockets_posix_noop.c index 045467bea4f..5e797dbdc45 100644 --- a/src/core/iomgr/unix_sockets_posix_noop.c +++ b/src/core/iomgr/unix_sockets_posix_noop.c @@ -35,7 +35,10 @@ #ifndef GPR_HAVE_UNIX_SOCKET -void grpc_create_socketpair_if_unix(int sv[2]) {} +void grpc_create_socketpair_if_unix(int sv[2]) { + // TODO(ahedberg): Please fill in an implementation for non-Unix-sockets case + GPR_ASSERT(0); +} grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char *name) { return NULL; From 761f7bc3e4cb87af5521eae8803d27dbee64c958 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 24 Mar 2016 11:05:48 -0700 Subject: [PATCH 03/12] Fix todo, do not explicitly mark assignment --- src/core/iomgr/unix_sockets_posix_noop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/iomgr/unix_sockets_posix_noop.c b/src/core/iomgr/unix_sockets_posix_noop.c index 5e797dbdc45..d899b46093e 100644 --- a/src/core/iomgr/unix_sockets_posix_noop.c +++ b/src/core/iomgr/unix_sockets_posix_noop.c @@ -36,7 +36,9 @@ #ifndef GPR_HAVE_UNIX_SOCKET void grpc_create_socketpair_if_unix(int sv[2]) { - // TODO(ahedberg): Please fill in an implementation for non-Unix-sockets case + // TODO: Either implement this for the non-Unix socket case or make + // sure that it is never called in any such case. Until then, leave an + // assertion to notify if this gets called inadvertently GPR_ASSERT(0); } From 14e0d9862fac27558372ce4703787af6426189af Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 28 Mar 2016 17:11:26 -0700 Subject: [PATCH 04/12] Begin optionalizing lb policies: initial code movement --- BUILD | 48 +++++++++---------- Makefile | 16 +++---- binding.gyp | 8 ++-- build.yaml | 16 +++---- config.m4 | 10 ++-- gRPC.podspec | 24 +++++----- grpc.gemspec | 16 +++---- package.json | 16 +++---- package.xml | 16 +++---- .../lb_policy/grpclb}/load_balancer_api.c | 2 +- .../lb_policy/grpclb}/load_balancer_api.h | 2 +- .../proto/grpc/lb/v0/load_balancer.pb.c | 2 +- .../proto/grpc/lb/v0/load_balancer.pb.h | 0 .../lb_policy/pick_first}/pick_first.c | 2 +- .../lb_policy/pick_first}/pick_first.h | 0 .../lb_policy/round_robin}/round_robin.c | 2 +- .../lb_policy/round_robin}/round_robin.h | 0 src/core/lib/surface/init.c | 4 +- src/python/grpcio/grpc_core_dependencies.py | 8 ++-- test/core/client_config/lb_policies_test.c | 2 +- test/cpp/grpclb/grpclb_api_test.cc | 2 +- .../codegen/core/gen_load_balancing_proto.sh | 4 +- tools/distrib/check_include_guards.py | 2 +- tools/distrib/check_nanopb_output.sh | 4 +- tools/doxygen/Doxyfile.core.internal | 16 +++---- tools/run_tests/sources_and_headers.json | 48 +++++++++---------- 26 files changed, 135 insertions(+), 135 deletions(-) rename src/core/{lib/client_config/lb_policies => ext/lb_policy/grpclb}/load_balancer_api.c (98%) rename src/core/{lib/client_config/lb_policies => ext/lb_policy/grpclb}/load_balancer_api.h (97%) rename src/core/{lib => ext/lb_policy/grpclb}/proto/grpc/lb/v0/load_balancer.pb.c (98%) rename src/core/{lib => ext/lb_policy/grpclb}/proto/grpc/lb/v0/load_balancer.pb.h (100%) rename src/core/{lib/client_config/lb_policies => ext/lb_policy/pick_first}/pick_first.c (99%) rename src/core/{lib/client_config/lb_policies => ext/lb_policy/pick_first}/pick_first.h (100%) rename src/core/{lib/client_config/lb_policies => ext/lb_policy/round_robin}/round_robin.c (99%) rename src/core/{lib/client_config/lb_policies => ext/lb_policy/round_robin}/round_robin.h (100%) diff --git a/BUILD b/BUILD index 52d1d5a69f0..cd33480b85b 100644 --- a/BUILD +++ b/BUILD @@ -196,9 +196,9 @@ cc_library( "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/lib/client_config/lb_policies/load_balancer_api.h", - "src/core/lib/client_config/lb_policies/pick_first.h", - "src/core/lib/client_config/lb_policies/round_robin.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -258,7 +258,7 @@ cc_library( "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/security/auth_filters.h", "src/core/lib/security/b64.h", "src/core/lib/security/credentials.h", @@ -345,9 +345,9 @@ cc_library( "src/core/lib/client_config/connector.c", "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", - "src/core/lib/client_config/lb_policies/load_balancer_api.c", - "src/core/lib/client_config/lb_policies/pick_first.c", - "src/core/lib/client_config/lb_policies/round_robin.c", + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy_factory.c", "src/core/lib/client_config/lb_policy_registry.c", @@ -413,7 +413,7 @@ cc_library( "src/core/lib/json/json_reader.c", "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/lib/security/b64.c", "src/core/lib/security/client_auth_filter.c", "src/core/lib/security/credentials.c", @@ -571,9 +571,9 @@ cc_library( "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/lib/client_config/lb_policies/load_balancer_api.h", - "src/core/lib/client_config/lb_policies/pick_first.h", - "src/core/lib/client_config/lb_policies/round_robin.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -633,7 +633,7 @@ cc_library( "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/statistics/census_interface.h", "src/core/lib/statistics/census_rpc_stats.h", "src/core/lib/surface/api_trace.h", @@ -704,9 +704,9 @@ cc_library( "src/core/lib/client_config/connector.c", "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", - "src/core/lib/client_config/lb_policies/load_balancer_api.c", - "src/core/lib/client_config/lb_policies/pick_first.c", - "src/core/lib/client_config/lb_policies/round_robin.c", + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy_factory.c", "src/core/lib/client_config/lb_policy_registry.c", @@ -771,7 +771,7 @@ cc_library( "src/core/lib/json/json_reader.c", "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/lib/surface/alarm.c", "src/core/lib/surface/api_trace.c", "src/core/lib/surface/byte_buffer.c", @@ -1407,9 +1407,9 @@ objc_library( "src/core/lib/client_config/connector.c", "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", - "src/core/lib/client_config/lb_policies/load_balancer_api.c", - "src/core/lib/client_config/lb_policies/pick_first.c", - "src/core/lib/client_config/lb_policies/round_robin.c", + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy_factory.c", "src/core/lib/client_config/lb_policy_registry.c", @@ -1475,7 +1475,7 @@ objc_library( "src/core/lib/json/json_reader.c", "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/lib/security/b64.c", "src/core/lib/security/client_auth_filter.c", "src/core/lib/security/credentials.c", @@ -1578,9 +1578,9 @@ objc_library( "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/lib/client_config/lb_policies/load_balancer_api.h", - "src/core/lib/client_config/lb_policies/pick_first.h", - "src/core/lib/client_config/lb_policies/round_robin.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -1640,7 +1640,7 @@ objc_library( "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/security/auth_filters.h", "src/core/lib/security/b64.h", "src/core/lib/security/credentials.h", diff --git a/Makefile b/Makefile index 3773a8091cd..2ab4e7903e5 100644 --- a/Makefile +++ b/Makefile @@ -2467,9 +2467,9 @@ LIBGRPC_SRC = \ src/core/lib/client_config/connector.c \ src/core/lib/client_config/default_initial_connect_string.c \ src/core/lib/client_config/initial_connect_string.c \ - src/core/lib/client_config/lb_policies/load_balancer_api.c \ - src/core/lib/client_config/lb_policies/pick_first.c \ - src/core/lib/client_config/lb_policies/round_robin.c \ + src/core/ext/lb_policy/grpclb/load_balancer_api.c \ + src/core/ext/lb_policy/pick_first/pick_first.c \ + src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/lib/client_config/lb_policy.c \ src/core/lib/client_config/lb_policy_factory.c \ src/core/lib/client_config/lb_policy_registry.c \ @@ -2535,7 +2535,7 @@ LIBGRPC_SRC = \ src/core/lib/json/json_reader.c \ src/core/lib/json/json_string.c \ src/core/lib/json/json_writer.c \ - src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/lib/security/b64.c \ src/core/lib/security/client_auth_filter.c \ src/core/lib/security/credentials.c \ @@ -2826,9 +2826,9 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/client_config/connector.c \ src/core/lib/client_config/default_initial_connect_string.c \ src/core/lib/client_config/initial_connect_string.c \ - src/core/lib/client_config/lb_policies/load_balancer_api.c \ - src/core/lib/client_config/lb_policies/pick_first.c \ - src/core/lib/client_config/lb_policies/round_robin.c \ + src/core/ext/lb_policy/grpclb/load_balancer_api.c \ + src/core/ext/lb_policy/pick_first/pick_first.c \ + src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/lib/client_config/lb_policy.c \ src/core/lib/client_config/lb_policy_factory.c \ src/core/lib/client_config/lb_policy_registry.c \ @@ -2893,7 +2893,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/json/json_reader.c \ src/core/lib/json/json_string.c \ src/core/lib/json/json_writer.c \ - src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/lib/surface/alarm.c \ src/core/lib/surface/api_trace.c \ src/core/lib/surface/byte_buffer.c \ diff --git a/binding.gyp b/binding.gyp index a1cdf2ec366..1d18c8e7378 100644 --- a/binding.gyp +++ b/binding.gyp @@ -605,9 +605,9 @@ 'src/core/lib/client_config/connector.c', 'src/core/lib/client_config/default_initial_connect_string.c', 'src/core/lib/client_config/initial_connect_string.c', - 'src/core/lib/client_config/lb_policies/load_balancer_api.c', - 'src/core/lib/client_config/lb_policies/pick_first.c', - 'src/core/lib/client_config/lb_policies/round_robin.c', + 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', + 'src/core/ext/lb_policy/pick_first/pick_first.c', + 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/lib/client_config/lb_policy.c', 'src/core/lib/client_config/lb_policy_factory.c', 'src/core/lib/client_config/lb_policy_registry.c', @@ -673,7 +673,7 @@ 'src/core/lib/json/json_reader.c', 'src/core/lib/json/json_string.c', 'src/core/lib/json/json_writer.c', - 'src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/lib/security/b64.c', 'src/core/lib/security/client_auth_filter.c', 'src/core/lib/security/credentials.c', diff --git a/build.yaml b/build.yaml index c16712ea5a8..749aabceb5f 100644 --- a/build.yaml +++ b/build.yaml @@ -262,9 +262,9 @@ filegroups: - src/core/lib/client_config/client_config.h - src/core/lib/client_config/connector.h - src/core/lib/client_config/initial_connect_string.h - - src/core/lib/client_config/lb_policies/load_balancer_api.h - - src/core/lib/client_config/lb_policies/pick_first.h - - src/core/lib/client_config/lb_policies/round_robin.h + - src/core/ext/lb_policy/grpclb/load_balancer_api.h + - src/core/ext/lb_policy/pick_first/pick_first.h + - src/core/ext/lb_policy/round_robin/round_robin.h - src/core/lib/client_config/lb_policy.h - src/core/lib/client_config/lb_policy_factory.h - src/core/lib/client_config/lb_policy_registry.h @@ -324,7 +324,7 @@ filegroups: - src/core/lib/json/json_common.h - src/core/lib/json/json_reader.h - src/core/lib/json/json_writer.h - - src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h + - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h - src/core/lib/statistics/census_interface.h - src/core/lib/statistics/census_rpc_stats.h - src/core/lib/surface/api_trace.h @@ -363,9 +363,9 @@ filegroups: - src/core/lib/client_config/connector.c - src/core/lib/client_config/default_initial_connect_string.c - src/core/lib/client_config/initial_connect_string.c - - src/core/lib/client_config/lb_policies/load_balancer_api.c - - src/core/lib/client_config/lb_policies/pick_first.c - - src/core/lib/client_config/lb_policies/round_robin.c + - src/core/ext/lb_policy/grpclb/load_balancer_api.c + - src/core/ext/lb_policy/pick_first/pick_first.c + - src/core/ext/lb_policy/round_robin/round_robin.c - src/core/lib/client_config/lb_policy.c - src/core/lib/client_config/lb_policy_factory.c - src/core/lib/client_config/lb_policy_registry.c @@ -430,7 +430,7 @@ filegroups: - src/core/lib/json/json_reader.c - src/core/lib/json/json_string.c - src/core/lib/json/json_writer.c - - src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c + - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c - src/core/lib/surface/alarm.c - src/core/lib/surface/api_trace.c - src/core/lib/surface/byte_buffer.c diff --git a/config.m4 b/config.m4 index 653b2870677..fa249a99be1 100644 --- a/config.m4 +++ b/config.m4 @@ -127,9 +127,9 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/client_config/connector.c \ src/core/lib/client_config/default_initial_connect_string.c \ src/core/lib/client_config/initial_connect_string.c \ - src/core/lib/client_config/lb_policies/load_balancer_api.c \ - src/core/lib/client_config/lb_policies/pick_first.c \ - src/core/lib/client_config/lb_policies/round_robin.c \ + src/core/ext/lb_policy/grpclb/load_balancer_api.c \ + src/core/ext/lb_policy/pick_first/pick_first.c \ + src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/lib/client_config/lb_policy.c \ src/core/lib/client_config/lb_policy_factory.c \ src/core/lib/client_config/lb_policy_registry.c \ @@ -195,7 +195,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/json/json_reader.c \ src/core/lib/json/json_string.c \ src/core/lib/json/json_writer.c \ - src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/lib/security/b64.c \ src/core/lib/security/client_auth_filter.c \ src/core/lib/security/credentials.c \ @@ -562,7 +562,7 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/json) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/profiling) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/proto/grpc/lb/v0) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/security) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/support) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/surface) diff --git a/gRPC.podspec b/gRPC.podspec index 08330eb8e18..feedfdc9714 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -200,9 +200,9 @@ Pod::Spec.new do |s| 'src/core/lib/client_config/client_config.h', 'src/core/lib/client_config/connector.h', 'src/core/lib/client_config/initial_connect_string.h', - 'src/core/lib/client_config/lb_policies/load_balancer_api.h', - 'src/core/lib/client_config/lb_policies/pick_first.h', - 'src/core/lib/client_config/lb_policies/round_robin.h', + 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', + 'src/core/ext/lb_policy/pick_first/pick_first.h', + 'src/core/ext/lb_policy/round_robin/round_robin.h', 'src/core/lib/client_config/lb_policy.h', 'src/core/lib/client_config/lb_policy_factory.h', 'src/core/lib/client_config/lb_policy_registry.h', @@ -262,7 +262,7 @@ Pod::Spec.new do |s| 'src/core/lib/json/json_common.h', 'src/core/lib/json/json_reader.h', 'src/core/lib/json/json_writer.h', - 'src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/lib/security/auth_filters.h', 'src/core/lib/security/b64.h', 'src/core/lib/security/credentials.h', @@ -362,9 +362,9 @@ Pod::Spec.new do |s| 'src/core/lib/client_config/connector.c', 'src/core/lib/client_config/default_initial_connect_string.c', 'src/core/lib/client_config/initial_connect_string.c', - 'src/core/lib/client_config/lb_policies/load_balancer_api.c', - 'src/core/lib/client_config/lb_policies/pick_first.c', - 'src/core/lib/client_config/lb_policies/round_robin.c', + 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', + 'src/core/ext/lb_policy/pick_first/pick_first.c', + 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/lib/client_config/lb_policy.c', 'src/core/lib/client_config/lb_policy_factory.c', 'src/core/lib/client_config/lb_policy_registry.c', @@ -430,7 +430,7 @@ Pod::Spec.new do |s| 'src/core/lib/json/json_reader.c', 'src/core/lib/json/json_string.c', 'src/core/lib/json/json_writer.c', - 'src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/lib/security/b64.c', 'src/core/lib/security/client_auth_filter.c', 'src/core/lib/security/credentials.c', @@ -531,9 +531,9 @@ Pod::Spec.new do |s| 'src/core/lib/client_config/client_config.h', 'src/core/lib/client_config/connector.h', 'src/core/lib/client_config/initial_connect_string.h', - 'src/core/lib/client_config/lb_policies/load_balancer_api.h', - 'src/core/lib/client_config/lb_policies/pick_first.h', - 'src/core/lib/client_config/lb_policies/round_robin.h', + 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', + 'src/core/ext/lb_policy/pick_first/pick_first.h', + 'src/core/ext/lb_policy/round_robin/round_robin.h', 'src/core/lib/client_config/lb_policy.h', 'src/core/lib/client_config/lb_policy_factory.h', 'src/core/lib/client_config/lb_policy_registry.h', @@ -593,7 +593,7 @@ Pod::Spec.new do |s| 'src/core/lib/json/json_common.h', 'src/core/lib/json/json_reader.h', 'src/core/lib/json/json_writer.h', - 'src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/lib/security/auth_filters.h', 'src/core/lib/security/b64.h', 'src/core/lib/security/credentials.h', diff --git a/grpc.gemspec b/grpc.gemspec index c516f5278f2..713a3f238fa 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -196,9 +196,9 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/client_config/client_config.h ) s.files += %w( src/core/lib/client_config/connector.h ) s.files += %w( src/core/lib/client_config/initial_connect_string.h ) - s.files += %w( src/core/lib/client_config/lb_policies/load_balancer_api.h ) - s.files += %w( src/core/lib/client_config/lb_policies/pick_first.h ) - s.files += %w( src/core/lib/client_config/lb_policies/round_robin.h ) + s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.h ) + s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.h ) + s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.h ) s.files += %w( src/core/lib/client_config/lb_policy.h ) s.files += %w( src/core/lib/client_config/lb_policy_factory.h ) s.files += %w( src/core/lib/client_config/lb_policy_registry.h ) @@ -258,7 +258,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/json/json_common.h ) s.files += %w( src/core/lib/json/json_reader.h ) s.files += %w( src/core/lib/json/json_writer.h ) - s.files += %w( src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h ) + s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h ) s.files += %w( src/core/lib/security/auth_filters.h ) s.files += %w( src/core/lib/security/b64.h ) s.files += %w( src/core/lib/security/credentials.h ) @@ -345,9 +345,9 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/client_config/connector.c ) s.files += %w( src/core/lib/client_config/default_initial_connect_string.c ) s.files += %w( src/core/lib/client_config/initial_connect_string.c ) - s.files += %w( src/core/lib/client_config/lb_policies/load_balancer_api.c ) - s.files += %w( src/core/lib/client_config/lb_policies/pick_first.c ) - s.files += %w( src/core/lib/client_config/lb_policies/round_robin.c ) + s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.c ) + s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.c ) + s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.c ) s.files += %w( src/core/lib/client_config/lb_policy.c ) s.files += %w( src/core/lib/client_config/lb_policy_factory.c ) s.files += %w( src/core/lib/client_config/lb_policy_registry.c ) @@ -413,7 +413,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/json/json_reader.c ) s.files += %w( src/core/lib/json/json_string.c ) s.files += %w( src/core/lib/json/json_writer.c ) - s.files += %w( src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c ) + s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c ) s.files += %w( src/core/lib/security/b64.c ) s.files += %w( src/core/lib/security/client_auth_filter.c ) s.files += %w( src/core/lib/security/credentials.c ) diff --git a/package.json b/package.json index d430dfe28fc..ba3bb606ffc 100644 --- a/package.json +++ b/package.json @@ -138,9 +138,9 @@ "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/lib/client_config/lb_policies/load_balancer_api.h", - "src/core/lib/client_config/lb_policies/pick_first.h", - "src/core/lib/client_config/lb_policies/round_robin.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -200,7 +200,7 @@ "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/security/auth_filters.h", "src/core/lib/security/b64.h", "src/core/lib/security/credentials.h", @@ -287,9 +287,9 @@ "src/core/lib/client_config/connector.c", "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", - "src/core/lib/client_config/lb_policies/load_balancer_api.c", - "src/core/lib/client_config/lb_policies/pick_first.c", - "src/core/lib/client_config/lb_policies/round_robin.c", + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy_factory.c", "src/core/lib/client_config/lb_policy_registry.c", @@ -355,7 +355,7 @@ "src/core/lib/json/json_reader.c", "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/lib/security/b64.c", "src/core/lib/security/client_auth_filter.c", "src/core/lib/security/credentials.c", diff --git a/package.xml b/package.xml index a40cd160ae5..9975360af95 100644 --- a/package.xml +++ b/package.xml @@ -200,9 +200,9 @@ - - - + + + @@ -262,7 +262,7 @@ - + @@ -349,9 +349,9 @@ - - - + + + @@ -417,7 +417,7 @@ - + diff --git a/src/core/lib/client_config/lb_policies/load_balancer_api.c b/src/core/ext/lb_policy/grpclb/load_balancer_api.c similarity index 98% rename from src/core/lib/client_config/lb_policies/load_balancer_api.c rename to src/core/ext/lb_policy/grpclb/load_balancer_api.c index 4cbed200df3..d8af644870d 100644 --- a/src/core/lib/client_config/lb_policies/load_balancer_api.c +++ b/src/core/ext/lb_policy/grpclb/load_balancer_api.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/lb_policies/load_balancer_api.h" +#include "src/core/ext/lb_policy/grpclb/load_balancer_api.h" #include "third_party/nanopb/pb_decode.h" #include "third_party/nanopb/pb_encode.h" diff --git a/src/core/lib/client_config/lb_policies/load_balancer_api.h b/src/core/ext/lb_policy/grpclb/load_balancer_api.h similarity index 97% rename from src/core/lib/client_config/lb_policies/load_balancer_api.h rename to src/core/ext/lb_policy/grpclb/load_balancer_api.h index 83299adfa9d..c1af304f682 100644 --- a/src/core/lib/client_config/lb_policies/load_balancer_api.h +++ b/src/core/ext/lb_policy/grpclb/load_balancer_api.h @@ -37,7 +37,7 @@ #include #include "src/core/lib/client_config/lb_policy_factory.h" -#include "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h" +#include "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h" #ifdef __cplusplus extern "C" { diff --git a/src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c b/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c similarity index 98% rename from src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c rename to src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c index 8f82141f96d..97196731810 100644 --- a/src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c +++ b/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c @@ -33,7 +33,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.3.5-dev */ -#include "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h" +#include "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h" #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h b/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h similarity index 100% rename from src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h rename to src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h diff --git a/src/core/lib/client_config/lb_policies/pick_first.c b/src/core/ext/lb_policy/pick_first/pick_first.c similarity index 99% rename from src/core/lib/client_config/lb_policies/pick_first.c rename to src/core/ext/lb_policy/pick_first/pick_first.c index 2e399b73f90..e1dae82c277 100644 --- a/src/core/lib/client_config/lb_policies/pick_first.c +++ b/src/core/ext/lb_policy/pick_first/pick_first.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/lb_policies/pick_first.h" +#include "src/core/ext/lb_policy/pick_first/pick_first.h" #include "src/core/lib/client_config/lb_policy_factory.h" #include diff --git a/src/core/lib/client_config/lb_policies/pick_first.h b/src/core/ext/lb_policy/pick_first/pick_first.h similarity index 100% rename from src/core/lib/client_config/lb_policies/pick_first.h rename to src/core/ext/lb_policy/pick_first/pick_first.h diff --git a/src/core/lib/client_config/lb_policies/round_robin.c b/src/core/ext/lb_policy/round_robin/round_robin.c similarity index 99% rename from src/core/lib/client_config/lb_policies/round_robin.c rename to src/core/ext/lb_policy/round_robin/round_robin.c index c904c5f9215..31056ea1385 100644 --- a/src/core/lib/client_config/lb_policies/round_robin.c +++ b/src/core/ext/lb_policy/round_robin/round_robin.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/lb_policies/round_robin.h" +#include "src/core/ext/lb_policy/round_robin/round_robin.h" #include diff --git a/src/core/lib/client_config/lb_policies/round_robin.h b/src/core/ext/lb_policy/round_robin/round_robin.h similarity index 100% rename from src/core/lib/client_config/lb_policies/round_robin.h rename to src/core/ext/lb_policy/round_robin/round_robin.h diff --git a/src/core/lib/surface/init.c b/src/core/lib/surface/init.c index dbfc8a9336e..5bf275b97a6 100644 --- a/src/core/lib/surface/init.c +++ b/src/core/lib/surface/init.c @@ -48,8 +48,8 @@ #include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/http_client_filter.h" #include "src/core/lib/channel/http_server_filter.h" -#include "src/core/lib/client_config/lb_policies/pick_first.h" -#include "src/core/lib/client_config/lb_policies/round_robin.h" +#include "src/core/ext/lb_policy/pick_first/pick_first.h" +#include "src/core/ext/lb_policy/round_robin/round_robin.h" #include "src/core/lib/client_config/lb_policy_registry.h" #include "src/core/lib/client_config/resolver_registry.h" #include "src/core/lib/client_config/resolvers/dns_resolver.h" diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 3c57ad71daa..509a45d29d1 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -121,9 +121,9 @@ CORE_SOURCE_FILES = [ 'src/core/lib/client_config/connector.c', 'src/core/lib/client_config/default_initial_connect_string.c', 'src/core/lib/client_config/initial_connect_string.c', - 'src/core/lib/client_config/lb_policies/load_balancer_api.c', - 'src/core/lib/client_config/lb_policies/pick_first.c', - 'src/core/lib/client_config/lb_policies/round_robin.c', + 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', + 'src/core/ext/lb_policy/pick_first/pick_first.c', + 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/lib/client_config/lb_policy.c', 'src/core/lib/client_config/lb_policy_factory.c', 'src/core/lib/client_config/lb_policy_registry.c', @@ -189,7 +189,7 @@ CORE_SOURCE_FILES = [ 'src/core/lib/json/json_reader.c', 'src/core/lib/json/json_string.c', 'src/core/lib/json/json_writer.c', - 'src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/lib/security/b64.c', 'src/core/lib/security/client_auth_filter.c', 'src/core/lib/security/credentials.c', diff --git a/test/core/client_config/lb_policies_test.c b/test/core/client_config/lb_policies_test.c index bae3e7d18cc..bd2f0e5e750 100644 --- a/test/core/client_config/lb_policies_test.c +++ b/test/core/client_config/lb_policies_test.c @@ -43,7 +43,7 @@ #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/client_channel.h" -#include "src/core/lib/client_config/lb_policies/round_robin.h" +#include "src/core/ext/lb_policy/round_robin/round_robin.h" #include "src/core/lib/client_config/lb_policy_registry.h" #include "src/core/lib/support/string.h" #include "src/core/lib/surface/channel.h" diff --git a/test/cpp/grpclb/grpclb_api_test.cc b/test/cpp/grpclb/grpclb_api_test.cc index bc8219c1c7a..92f93c869c7 100644 --- a/test/cpp/grpclb/grpclb_api_test.cc +++ b/test/cpp/grpclb/grpclb_api_test.cc @@ -34,7 +34,7 @@ #include #include -#include "src/core/lib/client_config/lb_policies/load_balancer_api.h" +#include "src/core/ext/lb_policy/grpclb/load_balancer_api.h" #include "src/proto/grpc/lb/v0/load_balancer.pb.h" // C++ version namespace grpc { diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 6a5363eeb32..339da0a7339 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -82,7 +82,7 @@ fi readonly GRPC_ROOT=$PWD -OUTPUT_DIR="$GRPC_ROOT/src/core/lib/proto/grpc/lb/v0" +OUTPUT_DIR="$GRPC_ROOT/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0" if [ $# -eq 2 ]; then mkdir -p "$2" if [ $? != 0 ]; then @@ -122,7 +122,7 @@ protoc \ "$(basename $1)" readonly PROTO_BASENAME=$(basename $1 .proto) -sed -i "s:$PROTO_BASENAME.pb.h:src/core/lib/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h:g" \ +sed -i "s:$PROTO_BASENAME.pb.h:src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h:g" \ "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" # prepend copyright diff --git a/tools/distrib/check_include_guards.py b/tools/distrib/check_include_guards.py index 463e3168858..6406fe6ae70 100755 --- a/tools/distrib/check_include_guards.py +++ b/tools/distrib/check_include_guards.py @@ -167,7 +167,7 @@ argp.add_argument('--precommit', args = argp.parse_args() KNOWN_BAD = set([ - 'src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', ]) diff --git a/tools/distrib/check_nanopb_output.sh b/tools/distrib/check_nanopb_output.sh index e0a60946a99..4032ae1d9db 100755 --- a/tools/distrib/check_nanopb_output.sh +++ b/tools/distrib/check_nanopb_output.sh @@ -60,7 +60,7 @@ PATH="$PROTOC_PATH:$PATH" ./tools/codegen/core/gen_load_balancing_proto.sh \ $NANOPB_TMP_OUTPUT # compare outputs to checked compiled code -if ! diff -r $NANOPB_TMP_OUTPUT src/core/lib/proto/grpc/lb/v0; then - echo "Outputs differ: $NANOPB_TMP_OUTPUT vs src/core/lib/proto/grpc/lb/v0" +if ! diff -r $NANOPB_TMP_OUTPUT src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0; then + echo "Outputs differ: $NANOPB_TMP_OUTPUT vs src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0" exit 2 fi diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index bb7177f52f2..2d308dbcf49 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -812,9 +812,9 @@ src/core/lib/channel/subchannel_call_holder.h \ src/core/lib/client_config/client_config.h \ src/core/lib/client_config/connector.h \ src/core/lib/client_config/initial_connect_string.h \ -src/core/lib/client_config/lb_policies/load_balancer_api.h \ -src/core/lib/client_config/lb_policies/pick_first.h \ -src/core/lib/client_config/lb_policies/round_robin.h \ +src/core/ext/lb_policy/grpclb/load_balancer_api.h \ +src/core/ext/lb_policy/pick_first/pick_first.h \ +src/core/ext/lb_policy/round_robin/round_robin.h \ src/core/lib/client_config/lb_policy.h \ src/core/lib/client_config/lb_policy_factory.h \ src/core/lib/client_config/lb_policy_registry.h \ @@ -874,7 +874,7 @@ src/core/lib/json/json.h \ src/core/lib/json/json_common.h \ src/core/lib/json/json_reader.h \ src/core/lib/json/json_writer.h \ -src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h \ +src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ src/core/lib/security/auth_filters.h \ src/core/lib/security/b64.h \ src/core/lib/security/credentials.h \ @@ -961,9 +961,9 @@ src/core/lib/client_config/client_config.c \ src/core/lib/client_config/connector.c \ src/core/lib/client_config/default_initial_connect_string.c \ src/core/lib/client_config/initial_connect_string.c \ -src/core/lib/client_config/lb_policies/load_balancer_api.c \ -src/core/lib/client_config/lb_policies/pick_first.c \ -src/core/lib/client_config/lb_policies/round_robin.c \ +src/core/ext/lb_policy/grpclb/load_balancer_api.c \ +src/core/ext/lb_policy/pick_first/pick_first.c \ +src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/lib/client_config/lb_policy.c \ src/core/lib/client_config/lb_policy_factory.c \ src/core/lib/client_config/lb_policy_registry.c \ @@ -1029,7 +1029,7 @@ src/core/lib/json/json.c \ src/core/lib/json/json_reader.c \ src/core/lib/json/json_string.c \ src/core/lib/json/json_writer.c \ -src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c \ +src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/lib/security/b64.c \ src/core/lib/security/client_auth_filter.c \ src/core/lib/security/credentials.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index e1bfa8719b6..4627a7c7bc3 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -3963,9 +3963,9 @@ "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/lib/client_config/lb_policies/load_balancer_api.h", - "src/core/lib/client_config/lb_policies/pick_first.h", - "src/core/lib/client_config/lb_policies/round_robin.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -4025,7 +4025,7 @@ "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/security/auth_filters.h", "src/core/lib/security/b64.h", "src/core/lib/security/credentials.h", @@ -4168,12 +4168,12 @@ "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.h", - "src/core/lib/client_config/lb_policies/load_balancer_api.c", - "src/core/lib/client_config/lb_policies/load_balancer_api.h", - "src/core/lib/client_config/lb_policies/pick_first.c", - "src/core/lib/client_config/lb_policies/pick_first.h", - "src/core/lib/client_config/lb_policies/round_robin.c", - "src/core/lib/client_config/lb_policies/round_robin.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.c", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.c", @@ -4298,8 +4298,8 @@ "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", "src/core/lib/json/json_writer.h", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/security/auth_filters.h", "src/core/lib/security/b64.c", "src/core/lib/security/b64.h", @@ -4591,9 +4591,9 @@ "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/lib/client_config/lb_policies/load_balancer_api.h", - "src/core/lib/client_config/lb_policies/pick_first.h", - "src/core/lib/client_config/lb_policies/round_robin.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -4653,7 +4653,7 @@ "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/statistics/census_interface.h", "src/core/lib/statistics/census_rpc_stats.h", "src/core/lib/surface/api_trace.h", @@ -4779,12 +4779,12 @@ "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.h", - "src/core/lib/client_config/lb_policies/load_balancer_api.c", - "src/core/lib/client_config/lb_policies/load_balancer_api.h", - "src/core/lib/client_config/lb_policies/pick_first.c", - "src/core/lib/client_config/lb_policies/pick_first.h", - "src/core/lib/client_config/lb_policies/round_robin.c", - "src/core/lib/client_config/lb_policies/round_robin.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.c", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.c", @@ -4908,8 +4908,8 @@ "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", "src/core/lib/json/json_writer.h", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.c", - "src/core/lib/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/statistics/census_interface.h", "src/core/lib/statistics/census_rpc_stats.h", "src/core/lib/surface/alarm.c", From 9c84fc308039bcac7bcec3cc7d7de1a26328f4df Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 28 Mar 2016 17:11:55 -0700 Subject: [PATCH 05/12] Fix include guards --- src/core/ext/lb_policy/grpclb/load_balancer_api.h | 6 +++--- src/core/ext/lb_policy/pick_first/pick_first.h | 6 +++--- src/core/ext/lb_policy/round_robin/round_robin.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/ext/lb_policy/grpclb/load_balancer_api.h b/src/core/ext/lb_policy/grpclb/load_balancer_api.h index c1af304f682..b39b4635d34 100644 --- a/src/core/ext/lb_policy/grpclb/load_balancer_api.h +++ b/src/core/ext/lb_policy/grpclb/load_balancer_api.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICIES_LOAD_BALANCER_API_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICIES_LOAD_BALANCER_API_H +#ifndef GRPC_CORE_EXT_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H +#define GRPC_CORE_EXT_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H #include @@ -82,4 +82,4 @@ void grpc_grpclb_response_destroy(grpc_grpclb_response *response); } #endif -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICIES_LOAD_BALANCER_API_H */ +#endif /* GRPC_CORE_EXT_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H */ diff --git a/src/core/ext/lb_policy/pick_first/pick_first.h b/src/core/ext/lb_policy/pick_first/pick_first.h index dba86ea7ad3..23a018ba448 100644 --- a/src/core/ext/lb_policy/pick_first/pick_first.h +++ b/src/core/ext/lb_policy/pick_first/pick_first.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICIES_PICK_FIRST_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICIES_PICK_FIRST_H +#ifndef GRPC_CORE_EXT_LB_POLICY_PICK_FIRST_PICK_FIRST_H +#define GRPC_CORE_EXT_LB_POLICY_PICK_FIRST_PICK_FIRST_H #include "src/core/lib/client_config/lb_policy_factory.h" @@ -40,4 +40,4 @@ * the first subchannel from \a subchannels to succesfully connect */ grpc_lb_policy_factory *grpc_pick_first_lb_factory_create(); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICIES_PICK_FIRST_H */ +#endif /* GRPC_CORE_EXT_LB_POLICY_PICK_FIRST_PICK_FIRST_H */ diff --git a/src/core/ext/lb_policy/round_robin/round_robin.h b/src/core/ext/lb_policy/round_robin/round_robin.h index 52db1caa0c2..4cac8682f6a 100644 --- a/src/core/ext/lb_policy/round_robin/round_robin.h +++ b/src/core/ext/lb_policy/round_robin/round_robin.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICIES_ROUND_ROBIN_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICIES_ROUND_ROBIN_H +#ifndef GRPC_CORE_EXT_LB_POLICY_ROUND_ROBIN_ROUND_ROBIN_H +#define GRPC_CORE_EXT_LB_POLICY_ROUND_ROBIN_ROUND_ROBIN_H #include "src/core/lib/client_config/lb_policy.h" @@ -43,4 +43,4 @@ extern int grpc_lb_round_robin_trace; /** Returns a load balancing factory for the round robin policy */ grpc_lb_policy_factory *grpc_round_robin_lb_factory_create(); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICIES_ROUND_ROBIN_H */ +#endif /* GRPC_CORE_EXT_LB_POLICY_ROUND_ROBIN_ROUND_ROBIN_H */ From 023caf1846bc8b285704ea973bfae27fbd0df8e0 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 29 Mar 2016 08:00:30 -0700 Subject: [PATCH 06/12] Refactor build to have lb policies as extensions --- BUILD | 48 +++++----- Makefile | 16 ++-- binding.gyp | 8 +- build.yaml | 37 ++++++-- config.m4 | 14 +-- gRPC.podspec | 24 ++--- grpc.gemspec | 16 ++-- package.json | 16 ++-- package.xml | 16 ++-- src/python/grpcio/grpc_core_dependencies.py | 8 +- tools/doxygen/Doxyfile.core.internal | 16 ++-- tools/run_tests/sources_and_headers.json | 48 +++++----- vsprojects/vcxproj/grpc/grpc.vcxproj | 24 ++--- vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 87 ++++++++++--------- .../grpc_unsecure/grpc_unsecure.vcxproj | 24 ++--- .../grpc_unsecure.vcxproj.filters | 87 ++++++++++--------- 16 files changed, 265 insertions(+), 224 deletions(-) diff --git a/BUILD b/BUILD index cd33480b85b..f6f02d2244f 100644 --- a/BUILD +++ b/BUILD @@ -157,6 +157,10 @@ cc_library( cc_library( name = "grpc", srcs = [ + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -196,9 +200,6 @@ cc_library( "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -258,7 +259,6 @@ cc_library( "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/security/auth_filters.h", "src/core/lib/security/b64.h", "src/core/lib/security/credentials.h", @@ -298,6 +298,10 @@ cc_library( "third_party/nanopb/pb_common.h", "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", "src/core/ext/transport/chttp2/client/secure/secure_channel_create.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2.c", @@ -345,9 +349,6 @@ cc_library( "src/core/lib/client_config/connector.c", "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", - "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/pick_first/pick_first.c", - "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy_factory.c", "src/core/lib/client_config/lb_policy_registry.c", @@ -413,7 +414,6 @@ cc_library( "src/core/lib/json/json_reader.c", "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/lib/security/b64.c", "src/core/lib/security/client_auth_filter.c", "src/core/lib/security/credentials.c", @@ -532,6 +532,10 @@ cc_library( cc_library( name = "grpc_unsecure", srcs = [ + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -571,9 +575,6 @@ cc_library( "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -633,7 +634,6 @@ cc_library( "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/statistics/census_interface.h", "src/core/lib/statistics/census_rpc_stats.h", "src/core/lib/surface/api_trace.h", @@ -659,6 +659,10 @@ cc_library( "third_party/nanopb/pb_common.h", "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2.c", "src/core/ext/transport/chttp2/transport/alpn.c", @@ -704,9 +708,6 @@ cc_library( "src/core/lib/client_config/connector.c", "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", - "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/pick_first/pick_first.c", - "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy_factory.c", "src/core/lib/client_config/lb_policy_registry.c", @@ -771,7 +772,6 @@ cc_library( "src/core/lib/json/json_reader.c", "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/lib/surface/alarm.c", "src/core/lib/surface/api_trace.c", "src/core/lib/surface/byte_buffer.c", @@ -1360,6 +1360,10 @@ objc_library( objc_library( name = "grpc_objc", srcs = [ + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", "src/core/ext/transport/chttp2/client/secure/secure_channel_create.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2.c", @@ -1407,9 +1411,6 @@ objc_library( "src/core/lib/client_config/connector.c", "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", - "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/pick_first/pick_first.c", - "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy_factory.c", "src/core/lib/client_config/lb_policy_registry.c", @@ -1475,7 +1476,6 @@ objc_library( "src/core/lib/json/json_reader.c", "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/lib/security/b64.c", "src/core/lib/security/client_auth_filter.c", "src/core/lib/security/credentials.c", @@ -1539,6 +1539,10 @@ objc_library( "include/grpc/impl/codegen/propagation_bits.h", "include/grpc/impl/codegen/status.h", "include/grpc/status.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -1578,9 +1582,6 @@ objc_library( "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -1640,7 +1641,6 @@ objc_library( "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/security/auth_filters.h", "src/core/lib/security/b64.h", "src/core/lib/security/credentials.h", diff --git a/Makefile b/Makefile index 2ab4e7903e5..e5f83e8a148 100644 --- a/Makefile +++ b/Makefile @@ -2420,6 +2420,10 @@ endif LIBGRPC_SRC = \ + src/core/ext/lb_policy/grpclb/load_balancer_api.c \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ + src/core/ext/lb_policy/pick_first/pick_first.c \ + src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ @@ -2467,9 +2471,6 @@ LIBGRPC_SRC = \ src/core/lib/client_config/connector.c \ src/core/lib/client_config/default_initial_connect_string.c \ src/core/lib/client_config/initial_connect_string.c \ - src/core/ext/lb_policy/grpclb/load_balancer_api.c \ - src/core/ext/lb_policy/pick_first/pick_first.c \ - src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/lib/client_config/lb_policy.c \ src/core/lib/client_config/lb_policy_factory.c \ src/core/lib/client_config/lb_policy_registry.c \ @@ -2535,7 +2536,6 @@ LIBGRPC_SRC = \ src/core/lib/json/json_reader.c \ src/core/lib/json/json_string.c \ src/core/lib/json/json_writer.c \ - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/lib/security/b64.c \ src/core/lib/security/client_auth_filter.c \ src/core/lib/security/credentials.c \ @@ -2781,6 +2781,10 @@ endif LIBGRPC_UNSECURE_SRC = \ + src/core/ext/lb_policy/grpclb/load_balancer_api.c \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ + src/core/ext/lb_policy/pick_first/pick_first.c \ + src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ src/core/ext/transport/chttp2/transport/alpn.c \ @@ -2826,9 +2830,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/client_config/connector.c \ src/core/lib/client_config/default_initial_connect_string.c \ src/core/lib/client_config/initial_connect_string.c \ - src/core/ext/lb_policy/grpclb/load_balancer_api.c \ - src/core/ext/lb_policy/pick_first/pick_first.c \ - src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/lib/client_config/lb_policy.c \ src/core/lib/client_config/lb_policy_factory.c \ src/core/lib/client_config/lb_policy_registry.c \ @@ -2893,7 +2894,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/json/json_reader.c \ src/core/lib/json/json_string.c \ src/core/lib/json/json_writer.c \ - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/lib/surface/alarm.c \ src/core/lib/surface/api_trace.c \ src/core/lib/surface/byte_buffer.c \ diff --git a/binding.gyp b/binding.gyp index 1d18c8e7378..068161ba06b 100644 --- a/binding.gyp +++ b/binding.gyp @@ -558,6 +558,10 @@ 'gpr', ], 'sources': [ + 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', + 'src/core/ext/lb_policy/pick_first/pick_first.c', + 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c', 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', @@ -605,9 +609,6 @@ 'src/core/lib/client_config/connector.c', 'src/core/lib/client_config/default_initial_connect_string.c', 'src/core/lib/client_config/initial_connect_string.c', - 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', - 'src/core/ext/lb_policy/pick_first/pick_first.c', - 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/lib/client_config/lb_policy.c', 'src/core/lib/client_config/lb_policy_factory.c', 'src/core/lib/client_config/lb_policy_registry.c', @@ -673,7 +674,6 @@ 'src/core/lib/json/json_reader.c', 'src/core/lib/json/json_string.c', 'src/core/lib/json/json_writer.c', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/lib/security/b64.c', 'src/core/lib/security/client_auth_filter.c', 'src/core/lib/security/credentials.c', diff --git a/build.yaml b/build.yaml index 749aabceb5f..6b9d0929758 100644 --- a/build.yaml +++ b/build.yaml @@ -247,6 +247,7 @@ filegroups: - include/grpc/grpc.h - include/grpc/status.h headers: + - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h - src/core/lib/census/grpc_filter.h - src/core/lib/census/grpc_plugin.h - src/core/lib/channel/channel_args.h @@ -262,9 +263,6 @@ filegroups: - src/core/lib/client_config/client_config.h - src/core/lib/client_config/connector.h - src/core/lib/client_config/initial_connect_string.h - - src/core/ext/lb_policy/grpclb/load_balancer_api.h - - src/core/ext/lb_policy/pick_first/pick_first.h - - src/core/ext/lb_policy/round_robin/round_robin.h - src/core/lib/client_config/lb_policy.h - src/core/lib/client_config/lb_policy_factory.h - src/core/lib/client_config/lb_policy_registry.h @@ -324,7 +322,6 @@ filegroups: - src/core/lib/json/json_common.h - src/core/lib/json/json_reader.h - src/core/lib/json/json_writer.h - - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h - src/core/lib/statistics/census_interface.h - src/core/lib/statistics/census_rpc_stats.h - src/core/lib/surface/api_trace.h @@ -347,6 +344,7 @@ filegroups: - src/core/lib/transport/transport.h - src/core/lib/transport/transport_impl.h src: + - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c - src/core/lib/census/grpc_context.c - src/core/lib/census/grpc_filter.c - src/core/lib/census/grpc_plugin.c @@ -363,9 +361,6 @@ filegroups: - src/core/lib/client_config/connector.c - src/core/lib/client_config/default_initial_connect_string.c - src/core/lib/client_config/initial_connect_string.c - - src/core/ext/lb_policy/grpclb/load_balancer_api.c - - src/core/ext/lb_policy/pick_first/pick_first.c - - src/core/ext/lb_policy/round_robin/round_robin.c - src/core/lib/client_config/lb_policy.c - src/core/lib/client_config/lb_policy_factory.c - src/core/lib/client_config/lb_policy_registry.c @@ -430,7 +425,6 @@ filegroups: - src/core/lib/json/json_reader.c - src/core/lib/json/json_string.c - src/core/lib/json/json_writer.c - - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c - src/core/lib/surface/alarm.c - src/core/lib/surface/api_trace.c - src/core/lib/surface/byte_buffer.c @@ -466,6 +460,27 @@ filegroups: - include/grpc/impl/codegen/grpc_types.h - include/grpc/impl/codegen/propagation_bits.h - include/grpc/impl/codegen/status.h +- name: grpc_lb_policy_grpclb + headers: + - src/core/ext/lb_policy/grpclb/load_balancer_api.h + src: + - src/core/ext/lb_policy/grpclb/load_balancer_api.c + uses: + - grpc_base +- name: grpc_lb_policy_pick_first + headers: + - src/core/ext/lb_policy/pick_first/pick_first.h + src: + - src/core/ext/lb_policy/pick_first/pick_first.c + uses: + - grpc_base +- name: grpc_lb_policy_round_robin + headers: + - src/core/ext/lb_policy/round_robin/round_robin.h + src: + - src/core/ext/lb_policy/round_robin/round_robin.c + uses: + - grpc_base - name: grpc_secure headers: - src/core/lib/security/auth_filters.h @@ -639,6 +654,9 @@ libs: - grpc_transport_chttp2_client_secure - grpc_transport_chttp2_server_insecure - grpc_transport_chttp2_client_insecure + - grpc_lb_policy_grpclb + - grpc_lb_policy_pick_first + - grpc_lb_policy_round_robin - grpc_secure - grpc_codegen - census @@ -722,6 +740,9 @@ libs: - grpc_base - grpc_transport_chttp2_server_insecure - grpc_transport_chttp2_client_insecure + - grpc_lb_policy_grpclb + - grpc_lb_policy_pick_first + - grpc_lb_policy_round_robin - grpc_codegen - census - nanopb diff --git a/config.m4 b/config.m4 index fa249a99be1..dd1069cb255 100644 --- a/config.m4 +++ b/config.m4 @@ -80,6 +80,10 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/support/tmpfile_posix.c \ src/core/lib/support/tmpfile_win32.c \ src/core/lib/support/wrap_memcpy.c \ + src/core/ext/lb_policy/grpclb/load_balancer_api.c \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ + src/core/ext/lb_policy/pick_first/pick_first.c \ + src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ @@ -127,9 +131,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/client_config/connector.c \ src/core/lib/client_config/default_initial_connect_string.c \ src/core/lib/client_config/initial_connect_string.c \ - src/core/ext/lb_policy/grpclb/load_balancer_api.c \ - src/core/ext/lb_policy/pick_first/pick_first.c \ - src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/lib/client_config/lb_policy.c \ src/core/lib/client_config/lb_policy_factory.c \ src/core/lib/client_config/lb_policy_registry.c \ @@ -195,7 +196,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/json/json_reader.c \ src/core/lib/json/json_string.c \ src/core/lib/json/json_writer.c \ - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/lib/security/b64.c \ src/core/lib/security/client_auth_filter.c \ src/core/lib/security/credentials.c \ @@ -546,6 +546,10 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/php/ext/grpc) PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/pick_first) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/round_robin) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/insecure) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/secure) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server/insecure) @@ -554,7 +558,6 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/census) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/channel) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/client_config) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/client_config/lb_policies) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/client_config/resolvers) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/compression) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/debug) @@ -562,7 +565,6 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/json) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/profiling) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/security) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/support) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/surface) diff --git a/gRPC.podspec b/gRPC.podspec index feedfdc9714..bf687f0accd 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -161,6 +161,10 @@ Pod::Spec.new do |s| 'src/core/lib/support/tmpfile_posix.c', 'src/core/lib/support/tmpfile_win32.c', 'src/core/lib/support/wrap_memcpy.c', + 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', + 'src/core/ext/lb_policy/pick_first/pick_first.h', + 'src/core/ext/lb_policy/round_robin/round_robin.h', 'src/core/ext/transport/chttp2/transport/alpn.h', 'src/core/ext/transport/chttp2/transport/bin_encoder.h', 'src/core/ext/transport/chttp2/transport/chttp2_transport.h', @@ -200,9 +204,6 @@ Pod::Spec.new do |s| 'src/core/lib/client_config/client_config.h', 'src/core/lib/client_config/connector.h', 'src/core/lib/client_config/initial_connect_string.h', - 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', - 'src/core/ext/lb_policy/pick_first/pick_first.h', - 'src/core/ext/lb_policy/round_robin/round_robin.h', 'src/core/lib/client_config/lb_policy.h', 'src/core/lib/client_config/lb_policy_factory.h', 'src/core/lib/client_config/lb_policy_registry.h', @@ -262,7 +263,6 @@ Pod::Spec.new do |s| 'src/core/lib/json/json_common.h', 'src/core/lib/json/json_reader.h', 'src/core/lib/json/json_writer.h', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/lib/security/auth_filters.h', 'src/core/lib/security/b64.h', 'src/core/lib/security/credentials.h', @@ -315,6 +315,10 @@ Pod::Spec.new do |s| 'include/grpc/impl/codegen/propagation_bits.h', 'include/grpc/impl/codegen/status.h', 'include/grpc/status.h', + 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', + 'src/core/ext/lb_policy/pick_first/pick_first.c', + 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c', 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', @@ -362,9 +366,6 @@ Pod::Spec.new do |s| 'src/core/lib/client_config/connector.c', 'src/core/lib/client_config/default_initial_connect_string.c', 'src/core/lib/client_config/initial_connect_string.c', - 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', - 'src/core/ext/lb_policy/pick_first/pick_first.c', - 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/lib/client_config/lb_policy.c', 'src/core/lib/client_config/lb_policy_factory.c', 'src/core/lib/client_config/lb_policy_registry.c', @@ -430,7 +431,6 @@ Pod::Spec.new do |s| 'src/core/lib/json/json_reader.c', 'src/core/lib/json/json_string.c', 'src/core/lib/json/json_writer.c', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/lib/security/b64.c', 'src/core/lib/security/client_auth_filter.c', 'src/core/lib/security/credentials.c', @@ -492,6 +492,10 @@ Pod::Spec.new do |s| 'src/core/lib/support/thd_internal.h', 'src/core/lib/support/time_precise.h', 'src/core/lib/support/tmpfile.h', + 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', + 'src/core/ext/lb_policy/pick_first/pick_first.h', + 'src/core/ext/lb_policy/round_robin/round_robin.h', 'src/core/ext/transport/chttp2/transport/alpn.h', 'src/core/ext/transport/chttp2/transport/bin_encoder.h', 'src/core/ext/transport/chttp2/transport/chttp2_transport.h', @@ -531,9 +535,6 @@ Pod::Spec.new do |s| 'src/core/lib/client_config/client_config.h', 'src/core/lib/client_config/connector.h', 'src/core/lib/client_config/initial_connect_string.h', - 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', - 'src/core/ext/lb_policy/pick_first/pick_first.h', - 'src/core/ext/lb_policy/round_robin/round_robin.h', 'src/core/lib/client_config/lb_policy.h', 'src/core/lib/client_config/lb_policy_factory.h', 'src/core/lib/client_config/lb_policy_registry.h', @@ -593,7 +594,6 @@ Pod::Spec.new do |s| 'src/core/lib/json/json_common.h', 'src/core/lib/json/json_reader.h', 'src/core/lib/json/json_writer.h', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/lib/security/auth_filters.h', 'src/core/lib/security/b64.h', 'src/core/lib/security/credentials.h', diff --git a/grpc.gemspec b/grpc.gemspec index 713a3f238fa..528fe3f58d4 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -157,6 +157,10 @@ Gem::Specification.new do |s| s.files += %w( include/grpc/impl/codegen/propagation_bits.h ) s.files += %w( include/grpc/impl/codegen/status.h ) s.files += %w( include/grpc/status.h ) + s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.h ) + s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h ) + s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.h ) + s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.h ) s.files += %w( src/core/ext/transport/chttp2/transport/alpn.h ) s.files += %w( src/core/ext/transport/chttp2/transport/bin_encoder.h ) s.files += %w( src/core/ext/transport/chttp2/transport/chttp2_transport.h ) @@ -196,9 +200,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/client_config/client_config.h ) s.files += %w( src/core/lib/client_config/connector.h ) s.files += %w( src/core/lib/client_config/initial_connect_string.h ) - s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.h ) - s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.h ) - s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.h ) s.files += %w( src/core/lib/client_config/lb_policy.h ) s.files += %w( src/core/lib/client_config/lb_policy_factory.h ) s.files += %w( src/core/lib/client_config/lb_policy_registry.h ) @@ -258,7 +259,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/json/json_common.h ) s.files += %w( src/core/lib/json/json_reader.h ) s.files += %w( src/core/lib/json/json_writer.h ) - s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h ) s.files += %w( src/core/lib/security/auth_filters.h ) s.files += %w( src/core/lib/security/b64.h ) s.files += %w( src/core/lib/security/credentials.h ) @@ -298,6 +298,10 @@ Gem::Specification.new do |s| s.files += %w( third_party/nanopb/pb_common.h ) s.files += %w( third_party/nanopb/pb_decode.h ) s.files += %w( third_party/nanopb/pb_encode.h ) + s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.c ) + s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c ) + s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.c ) + s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.c ) s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.c ) s.files += %w( src/core/ext/transport/chttp2/client/secure/secure_channel_create.c ) s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2.c ) @@ -345,9 +349,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/client_config/connector.c ) s.files += %w( src/core/lib/client_config/default_initial_connect_string.c ) s.files += %w( src/core/lib/client_config/initial_connect_string.c ) - s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.c ) - s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.c ) - s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.c ) s.files += %w( src/core/lib/client_config/lb_policy.c ) s.files += %w( src/core/lib/client_config/lb_policy_factory.c ) s.files += %w( src/core/lib/client_config/lb_policy_registry.c ) @@ -413,7 +414,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/json/json_reader.c ) s.files += %w( src/core/lib/json/json_string.c ) s.files += %w( src/core/lib/json/json_writer.c ) - s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c ) s.files += %w( src/core/lib/security/b64.c ) s.files += %w( src/core/lib/security/client_auth_filter.c ) s.files += %w( src/core/lib/security/credentials.c ) diff --git a/package.json b/package.json index c07ceb2e0c9..fa7ed029543 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,10 @@ "include/grpc/impl/codegen/propagation_bits.h", "include/grpc/impl/codegen/status.h", "include/grpc/status.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -139,9 +143,6 @@ "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -201,7 +202,6 @@ "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/security/auth_filters.h", "src/core/lib/security/b64.h", "src/core/lib/security/credentials.h", @@ -241,6 +241,10 @@ "third_party/nanopb/pb_common.h", "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", "src/core/ext/transport/chttp2/client/secure/secure_channel_create.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2.c", @@ -288,9 +292,6 @@ "src/core/lib/client_config/connector.c", "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", - "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/pick_first/pick_first.c", - "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy_factory.c", "src/core/lib/client_config/lb_policy_registry.c", @@ -356,7 +357,6 @@ "src/core/lib/json/json_reader.c", "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/lib/security/b64.c", "src/core/lib/security/client_auth_filter.c", "src/core/lib/security/credentials.c", diff --git a/package.xml b/package.xml index 9975360af95..e29c55d69f9 100644 --- a/package.xml +++ b/package.xml @@ -161,6 +161,10 @@ + + + + @@ -200,9 +204,6 @@ - - - @@ -262,7 +263,6 @@ - @@ -302,6 +302,10 @@ + + + + @@ -349,9 +353,6 @@ - - - @@ -417,7 +418,6 @@ - diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 509a45d29d1..8c7890c0943 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -74,6 +74,10 @@ CORE_SOURCE_FILES = [ 'src/core/lib/support/tmpfile_posix.c', 'src/core/lib/support/tmpfile_win32.c', 'src/core/lib/support/wrap_memcpy.c', + 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', + 'src/core/ext/lb_policy/pick_first/pick_first.c', + 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c', 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', @@ -121,9 +125,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/client_config/connector.c', 'src/core/lib/client_config/default_initial_connect_string.c', 'src/core/lib/client_config/initial_connect_string.c', - 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', - 'src/core/ext/lb_policy/pick_first/pick_first.c', - 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/lib/client_config/lb_policy.c', 'src/core/lib/client_config/lb_policy_factory.c', 'src/core/lib/client_config/lb_policy_registry.c', @@ -189,7 +190,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/json/json_reader.c', 'src/core/lib/json/json_string.c', 'src/core/lib/json/json_writer.c', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/lib/security/b64.c', 'src/core/lib/security/client_auth_filter.c', 'src/core/lib/security/credentials.c', diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 2d308dbcf49..d3b7e2b8a28 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -773,6 +773,10 @@ include/grpc/impl/codegen/grpc_types.h \ include/grpc/impl/codegen/propagation_bits.h \ include/grpc/impl/codegen/status.h \ include/grpc/status.h \ +src/core/ext/lb_policy/grpclb/load_balancer_api.h \ +src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ +src/core/ext/lb_policy/pick_first/pick_first.h \ +src/core/ext/lb_policy/round_robin/round_robin.h \ src/core/ext/transport/chttp2/transport/alpn.h \ src/core/ext/transport/chttp2/transport/bin_encoder.h \ src/core/ext/transport/chttp2/transport/chttp2_transport.h \ @@ -812,9 +816,6 @@ src/core/lib/channel/subchannel_call_holder.h \ src/core/lib/client_config/client_config.h \ src/core/lib/client_config/connector.h \ src/core/lib/client_config/initial_connect_string.h \ -src/core/ext/lb_policy/grpclb/load_balancer_api.h \ -src/core/ext/lb_policy/pick_first/pick_first.h \ -src/core/ext/lb_policy/round_robin/round_robin.h \ src/core/lib/client_config/lb_policy.h \ src/core/lib/client_config/lb_policy_factory.h \ src/core/lib/client_config/lb_policy_registry.h \ @@ -874,7 +875,6 @@ src/core/lib/json/json.h \ src/core/lib/json/json_common.h \ src/core/lib/json/json_reader.h \ src/core/lib/json/json_writer.h \ -src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ src/core/lib/security/auth_filters.h \ src/core/lib/security/b64.h \ src/core/lib/security/credentials.h \ @@ -914,6 +914,10 @@ third_party/nanopb/pb.h \ third_party/nanopb/pb_common.h \ third_party/nanopb/pb_decode.h \ third_party/nanopb/pb_encode.h \ +src/core/ext/lb_policy/grpclb/load_balancer_api.c \ +src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ +src/core/ext/lb_policy/pick_first/pick_first.c \ +src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ @@ -961,9 +965,6 @@ src/core/lib/client_config/client_config.c \ src/core/lib/client_config/connector.c \ src/core/lib/client_config/default_initial_connect_string.c \ src/core/lib/client_config/initial_connect_string.c \ -src/core/ext/lb_policy/grpclb/load_balancer_api.c \ -src/core/ext/lb_policy/pick_first/pick_first.c \ -src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/lib/client_config/lb_policy.c \ src/core/lib/client_config/lb_policy_factory.c \ src/core/lib/client_config/lb_policy_registry.c \ @@ -1029,7 +1030,6 @@ src/core/lib/json/json.c \ src/core/lib/json/json_reader.c \ src/core/lib/json/json_string.c \ src/core/lib/json/json_writer.c \ -src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/lib/security/b64.c \ src/core/lib/security/client_auth_filter.c \ src/core/lib/security/credentials.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 4627a7c7bc3..3337c84b10a 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -3924,6 +3924,10 @@ "include/grpc/impl/codegen/propagation_bits.h", "include/grpc/impl/codegen/status.h", "include/grpc/status.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -3963,9 +3967,6 @@ "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -4025,7 +4026,6 @@ "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/security/auth_filters.h", "src/core/lib/security/b64.h", "src/core/lib/security/credentials.h", @@ -4082,6 +4082,14 @@ "include/grpc/impl/codegen/propagation_bits.h", "include/grpc/impl/codegen/status.h", "include/grpc/status.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.c", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", "src/core/ext/transport/chttp2/client/secure/secure_channel_create.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2.c", @@ -4168,12 +4176,6 @@ "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.h", - "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/pick_first/pick_first.c", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.c", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.c", @@ -4298,8 +4300,6 @@ "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", "src/core/lib/json/json_writer.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/security/auth_filters.h", "src/core/lib/security/b64.c", "src/core/lib/security/b64.h", @@ -4552,6 +4552,10 @@ "include/grpc/impl/codegen/propagation_bits.h", "include/grpc/impl/codegen/status.h", "include/grpc/status.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -4591,9 +4595,6 @@ "src/core/lib/client_config/client_config.h", "src/core/lib/client_config/connector.h", "src/core/lib/client_config/initial_connect_string.h", - "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.h", "src/core/lib/client_config/lb_policy_registry.h", @@ -4653,7 +4654,6 @@ "src/core/lib/json/json_common.h", "src/core/lib/json/json_reader.h", "src/core/lib/json/json_writer.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/statistics/census_interface.h", "src/core/lib/statistics/census_rpc_stats.h", "src/core/lib/surface/api_trace.h", @@ -4695,6 +4695,14 @@ "include/grpc/impl/codegen/propagation_bits.h", "include/grpc/impl/codegen/status.h", "include/grpc/status.h", + "src/core/ext/lb_policy/grpclb/load_balancer_api.c", + "src/core/ext/lb_policy/grpclb/load_balancer_api.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/pick_first/pick_first.c", + "src/core/ext/lb_policy/pick_first/pick_first.h", + "src/core/ext/lb_policy/round_robin/round_robin.c", + "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2.c", "src/core/ext/transport/chttp2/transport/alpn.c", @@ -4779,12 +4787,6 @@ "src/core/lib/client_config/default_initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.c", "src/core/lib/client_config/initial_connect_string.h", - "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/pick_first/pick_first.c", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.c", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/lib/client_config/lb_policy.c", "src/core/lib/client_config/lb_policy.h", "src/core/lib/client_config/lb_policy_factory.c", @@ -4908,8 +4910,6 @@ "src/core/lib/json/json_string.c", "src/core/lib/json/json_writer.c", "src/core/lib/json/json_writer.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/lib/statistics/census_interface.h", "src/core/lib/statistics/census_rpc_stats.h", "src/core/lib/surface/alarm.c", diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index c20f8d70708..678f913e45f 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -282,6 +282,10 @@ + + + + @@ -321,9 +325,6 @@ - - - @@ -383,7 +384,6 @@ - @@ -425,6 +425,14 @@ + + + + + + + + @@ -519,12 +527,6 @@ - - - - - - @@ -655,8 +657,6 @@ - - diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index f03b20703f7..60d0811ec5c 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -1,6 +1,18 @@ + + src\core\ext\lb_policy\grpclb + + + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 + + + src\core\ext\lb_policy\pick_first + + + src\core\ext\lb_policy\round_robin + src\core\ext\transport\chttp2\client\insecure @@ -142,15 +154,6 @@ src\core\lib\client_config - - src\core\lib\client_config\lb_policies - - - src\core\lib\client_config\lb_policies - - - src\core\lib\client_config\lb_policies - src\core\lib\client_config @@ -346,9 +349,6 @@ src\core\lib\json - - src\core\lib\proto\grpc\lb\v0 - src\core\lib\security @@ -536,6 +536,18 @@ + + src\core\ext\lb_policy\grpclb + + + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 + + + src\core\ext\lb_policy\pick_first + + + src\core\ext\lb_policy\round_robin + src\core\ext\transport\chttp2\transport @@ -653,15 +665,6 @@ src\core\lib\client_config - - src\core\lib\client_config\lb_policies - - - src\core\lib\client_config\lb_policies - - - src\core\lib\client_config\lb_policies - src\core\lib\client_config @@ -839,9 +842,6 @@ src\core\lib\json - - src\core\lib\proto\grpc\lb\v0 - src\core\lib\security @@ -983,6 +983,30 @@ {3f32a58f-394f-5f13-06aa-6cc52cc2daaf} + + {030f00ff-6c54-76c8-12df-37e3008335d1} + + + {fe41339e-53fb-39b3-7457-7a0fbb238dbe} + + + {a7c27f6b-6d15-01cf-76d9-c30dddea0990} + + + {bc714e6d-8aba-91df-7db9-7f189f05a6ff} + + + {adf7e553-94ef-14fd-e845-03104f00a06f} + + + {0406d191-8817-38c3-a562-e3541201f424} + + + {b63ded00-b24f-708e-333f-ce199e421875} + + + {2472d352-cf94-f317-646e-72b769cea846} + {e3abfd0a-064e-0f2f-c8e8-7c5a7e98142a} @@ -1022,9 +1046,6 @@ {2f3260de-be57-d18d-6882-61d115baa159} - - {118d2bb5-086f-54f3-11de-26d7d7f73f9d} - {b9d8db6c-2c68-1c90-fe5e-37da90f47ae6} @@ -1043,18 +1064,6 @@ {cb2b0073-f2a7-5c63-d182-8874b24bdf36} - - {b4b19f9a-1575-8a21-0bca-537746f858b7} - - - {cbc8ce67-4a97-d533-8dc3-f949c63e2771} - - - {933530ae-447b-ea8d-3531-98f0556960b0} - - - {c33f944f-37d4-42fd-abc3-61f0d4400462} - {c4661d64-349f-01c1-1ba8-0602f9047595} diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index e89cc8a1257..a2426c7712a 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -272,6 +272,10 @@ + + + + @@ -311,9 +315,6 @@ - - - @@ -373,7 +374,6 @@ - @@ -401,6 +401,14 @@ + + + + + + + + @@ -491,12 +499,6 @@ - - - - - - @@ -625,8 +627,6 @@ - - diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index c9f1ad69433..dee6778ffb4 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -1,6 +1,18 @@ + + src\core\ext\lb_policy\grpclb + + + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 + + + src\core\ext\lb_policy\pick_first + + + src\core\ext\lb_policy\round_robin + src\core\ext\transport\chttp2\client\insecure @@ -136,15 +148,6 @@ src\core\lib\client_config - - src\core\lib\client_config\lb_policies - - - src\core\lib\client_config\lb_policies - - - src\core\lib\client_config\lb_policies - src\core\lib\client_config @@ -337,9 +340,6 @@ src\core\lib\json - - src\core\lib\proto\grpc\lb\v0 - src\core\lib\surface @@ -473,6 +473,18 @@ + + src\core\ext\lb_policy\grpclb + + + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 + + + src\core\ext\lb_policy\pick_first + + + src\core\ext\lb_policy\round_robin + src\core\ext\transport\chttp2\transport @@ -590,15 +602,6 @@ src\core\lib\client_config - - src\core\lib\client_config\lb_policies - - - src\core\lib\client_config\lb_policies - - - src\core\lib\client_config\lb_policies - src\core\lib\client_config @@ -776,9 +779,6 @@ src\core\lib\json - - src\core\lib\proto\grpc\lb\v0 - src\core\lib\statistics @@ -878,6 +878,30 @@ {82f86e8c-00a4-f566-d235-670fc629798d} + + {a23781d2-27e4-7cb0-12cd-59782ecb21ce} + + + {25a465c8-d1e8-6248-c005-bb2062206472} + + + {40fc2615-d244-0d36-4486-ba6f0fa468bb} + + + {1d129f24-a399-12ef-68de-023aff7dde52} + + + {21858d9d-30b5-8847-5882-6b47df0fa293} + + + {1795a20b-3e7c-e27d-eae1-96582fa9a958} + + + {e27f9ecf-97bb-1a2e-3135-a41f732dcf55} + + + {e5fc1091-5d60-404f-775b-686ef4b3266f} + {967c89fe-c97c-27e2-aac0-9ba5854cb5fa} @@ -911,9 +935,6 @@ {29ca2974-89e4-1a74-3e4d-0d63e2f77566} - - {6c7e36d4-6117-e0cd-c886-b9eb3c994927} - {2d959ef9-9703-dc92-a56f-9fe136dadfb9} @@ -932,18 +953,6 @@ {681cdaeb-c47f-8853-d985-bf13c2873947} - - {4bfbd6c6-f6a8-c6b3-5186-b788f4e11e23} - - - {60f3ab7d-ea44-348f-671e-77fdebbd18bb} - - - {bcd33510-32e7-c2fb-e11d-a3655f97bc84} - - - {bb9b8c80-9eff-5ab6-5b29-c2d54f0fc192} - {d0ab6d54-ae25-fc49-3656-91d9db57366a} From 04b7ca8d5cd99bf96543c7ab4d516586f62ad99c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 29 Mar 2016 08:07:54 -0700 Subject: [PATCH 07/12] Starting plugin registry --- build.yaml | 4 ++ .../plugin_registry/grpc_plugin_registry.c | 32 ++++++++++++++++ .../grpc_unsecure_plugin_registry.c | 32 ++++++++++++++++ templates/src/core/plugin_registry.template | 38 +++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 src/core/plugin_registry/grpc_plugin_registry.c create mode 100644 src/core/plugin_registry/grpc_unsecure_plugin_registry.c create mode 100644 templates/src/core/plugin_registry.template diff --git a/build.yaml b/build.yaml index 6b9d0929758..8351c20449f 100644 --- a/build.yaml +++ b/build.yaml @@ -472,6 +472,7 @@ filegroups: - src/core/ext/lb_policy/pick_first/pick_first.h src: - src/core/ext/lb_policy/pick_first/pick_first.c + plugin: grpc_lb_policy_pick_first uses: - grpc_base - name: grpc_lb_policy_round_robin @@ -479,6 +480,7 @@ filegroups: - src/core/ext/lb_policy/round_robin/round_robin.h src: - src/core/ext/lb_policy/round_robin/round_robin.c + plugin: grpc_lb_policy_round_robin uses: - grpc_base - name: grpc_secure @@ -661,6 +663,7 @@ libs: - grpc_codegen - census - nanopb + generate_plugin_registry: true secure: true vs_packages: - grpc.dependencies.openssl @@ -746,6 +749,7 @@ libs: - grpc_codegen - census - nanopb + generate_plugin_registry: true secure: false vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}' - name: grpc_zookeeper diff --git a/src/core/plugin_registry/grpc_plugin_registry.c b/src/core/plugin_registry/grpc_plugin_registry.c new file mode 100644 index 00000000000..b0ac5249328 --- /dev/null +++ b/src/core/plugin_registry/grpc_plugin_registry.c @@ -0,0 +1,32 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c b/src/core/plugin_registry/grpc_unsecure_plugin_registry.c new file mode 100644 index 00000000000..b0ac5249328 --- /dev/null +++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.c @@ -0,0 +1,32 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ diff --git a/templates/src/core/plugin_registry.template b/templates/src/core/plugin_registry.template new file mode 100644 index 00000000000..5d522c6e9df --- /dev/null +++ b/templates/src/core/plugin_registry.template @@ -0,0 +1,38 @@ +%YAML 1.2 +--- +foreach: libs +cond: selected.get('generate_plugin_registry', False) +output_name: ${selected.name}_plugin_registry.c +template: | + /* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ From fb433852042e53e010ae1215bc846052ddac2e9b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 29 Mar 2016 08:51:07 -0700 Subject: [PATCH 08/12] Make plugin registries work --- BUILD | 9 ++-- Makefile | 3 ++ binding.gyp | 1 + build.yaml | 4 -- config.m4 | 2 + gRPC.podspec | 5 +- grpc.gemspec | 3 +- package.json | 3 +- package.xml | 3 +- .../ext/lb_policy/pick_first/pick_first.c | 38 +++++++++------ .../ext/lb_policy/pick_first/pick_first.h | 43 ----------------- .../ext/lb_policy/round_robin/round_robin.c | 29 ++++++++---- .../ext/lb_policy/round_robin/round_robin.h | 46 ------------------- src/core/lib/surface/init.c | 5 -- .../plugin_registry/grpc_plugin_registry.c | 14 ++++++ .../grpc_unsecure_plugin_registry.c | 14 ++++++ src/python/grpcio/grpc_core_dependencies.py | 1 + templates/src/core/plugin_registry.template | 14 ++++++ test/core/client_config/lb_policies_test.c | 3 +- tools/buildgen/plugins/expand_filegroups.py | 20 +++++++- tools/doxygen/Doxyfile.core.internal | 3 +- tools/run_tests/sources_and_headers.json | 14 ++---- vsprojects/vcxproj/grpc/grpc.vcxproj | 4 +- vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 12 ++--- .../grpc_unsecure/grpc_unsecure.vcxproj | 4 +- .../grpc_unsecure.vcxproj.filters | 12 ++--- 26 files changed, 139 insertions(+), 170 deletions(-) delete mode 100644 src/core/ext/lb_policy/pick_first/pick_first.h delete mode 100644 src/core/ext/lb_policy/round_robin/round_robin.h diff --git a/BUILD b/BUILD index f6f02d2244f..22cbf3d0afd 100644 --- a/BUILD +++ b/BUILD @@ -159,8 +159,6 @@ cc_library( srcs = [ "src/core/ext/lb_policy/grpclb/load_balancer_api.h", "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -459,6 +457,7 @@ cc_library( "src/core/lib/tsi/fake_transport_security.c", "src/core/lib/tsi/ssl_transport_security.c", "src/core/lib/tsi/transport_security.c", + "src/core/plugin_registry/grpc_plugin_registry.c", "third_party/nanopb/pb_common.c", "third_party/nanopb/pb_decode.c", "third_party/nanopb/pb_encode.c", @@ -534,8 +533,6 @@ cc_library( srcs = [ "src/core/ext/lb_policy/grpclb/load_balancer_api.h", "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -800,6 +797,7 @@ cc_library( "src/core/lib/transport/static_metadata.c", "src/core/lib/transport/transport.c", "src/core/lib/transport/transport_op_string.c", + "src/core/plugin_registry/grpc_unsecure_plugin_registry.c", "third_party/nanopb/pb_common.c", "third_party/nanopb/pb_decode.c", "third_party/nanopb/pb_encode.c", @@ -1521,6 +1519,7 @@ objc_library( "src/core/lib/tsi/fake_transport_security.c", "src/core/lib/tsi/ssl_transport_security.c", "src/core/lib/tsi/transport_security.c", + "src/core/plugin_registry/grpc_plugin_registry.c", "third_party/nanopb/pb_common.c", "third_party/nanopb/pb_decode.c", "third_party/nanopb/pb_encode.c", @@ -1541,8 +1540,6 @@ objc_library( "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", diff --git a/Makefile b/Makefile index e5f83e8a148..7b7200b6aee 100644 --- a/Makefile +++ b/Makefile @@ -2581,6 +2581,7 @@ LIBGRPC_SRC = \ src/core/lib/tsi/fake_transport_security.c \ src/core/lib/tsi/ssl_transport_security.c \ src/core/lib/tsi/transport_security.c \ + src/core/plugin_registry/grpc_plugin_registry.c \ third_party/nanopb/pb_common.c \ third_party/nanopb/pb_decode.c \ third_party/nanopb/pb_encode.c \ @@ -2922,6 +2923,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/transport/static_metadata.c \ src/core/lib/transport/transport.c \ src/core/lib/transport/transport_op_string.c \ + src/core/plugin_registry/grpc_unsecure_plugin_registry.c \ third_party/nanopb/pb_common.c \ third_party/nanopb/pb_decode.c \ third_party/nanopb/pb_encode.c \ @@ -13492,6 +13494,7 @@ src/core/lib/surface/init_secure.c: $(OPENSSL_DEP) src/core/lib/tsi/fake_transport_security.c: $(OPENSSL_DEP) src/core/lib/tsi/ssl_transport_security.c: $(OPENSSL_DEP) src/core/lib/tsi/transport_security.c: $(OPENSSL_DEP) +src/core/plugin_registry/grpc_plugin_registry.c: $(OPENSSL_DEP) src/cpp/client/secure_credentials.cc: $(OPENSSL_DEP) src/cpp/common/auth_property_iterator.cc: $(OPENSSL_DEP) src/cpp/common/secure_auth_context.cc: $(OPENSSL_DEP) diff --git a/binding.gyp b/binding.gyp index 068161ba06b..bfae59e50ce 100644 --- a/binding.gyp +++ b/binding.gyp @@ -719,6 +719,7 @@ 'src/core/lib/tsi/fake_transport_security.c', 'src/core/lib/tsi/ssl_transport_security.c', 'src/core/lib/tsi/transport_security.c', + 'src/core/plugin_registry/grpc_plugin_registry.c', 'third_party/nanopb/pb_common.c', 'third_party/nanopb/pb_decode.c', 'third_party/nanopb/pb_encode.c', diff --git a/build.yaml b/build.yaml index 8351c20449f..de4deeb9289 100644 --- a/build.yaml +++ b/build.yaml @@ -468,16 +468,12 @@ filegroups: uses: - grpc_base - name: grpc_lb_policy_pick_first - headers: - - src/core/ext/lb_policy/pick_first/pick_first.h src: - src/core/ext/lb_policy/pick_first/pick_first.c plugin: grpc_lb_policy_pick_first uses: - grpc_base - name: grpc_lb_policy_round_robin - headers: - - src/core/ext/lb_policy/round_robin/round_robin.h src: - src/core/ext/lb_policy/round_robin/round_robin.c plugin: grpc_lb_policy_round_robin diff --git a/config.m4 b/config.m4 index dd1069cb255..1b414a1142b 100644 --- a/config.m4 +++ b/config.m4 @@ -241,6 +241,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/tsi/fake_transport_security.c \ src/core/lib/tsi/ssl_transport_security.c \ src/core/lib/tsi/transport_security.c \ + src/core/plugin_registry/grpc_plugin_registry.c \ third_party/nanopb/pb_common.c \ third_party/nanopb/pb_decode.c \ third_party/nanopb/pb_encode.c \ @@ -570,6 +571,7 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/surface) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/transport) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/tsi) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/plugin_registry) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/aes) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/asn1) diff --git a/gRPC.podspec b/gRPC.podspec index bf687f0accd..d94905ce2a6 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -163,8 +163,6 @@ Pod::Spec.new do |s| 'src/core/lib/support/wrap_memcpy.c', 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', - 'src/core/ext/lb_policy/pick_first/pick_first.h', - 'src/core/ext/lb_policy/round_robin/round_robin.h', 'src/core/ext/transport/chttp2/transport/alpn.h', 'src/core/ext/transport/chttp2/transport/bin_encoder.h', 'src/core/ext/transport/chttp2/transport/chttp2_transport.h', @@ -476,6 +474,7 @@ Pod::Spec.new do |s| 'src/core/lib/tsi/fake_transport_security.c', 'src/core/lib/tsi/ssl_transport_security.c', 'src/core/lib/tsi/transport_security.c', + 'src/core/plugin_registry/grpc_plugin_registry.c', 'third_party/nanopb/pb_common.c', 'third_party/nanopb/pb_decode.c', 'third_party/nanopb/pb_encode.c' @@ -494,8 +493,6 @@ Pod::Spec.new do |s| 'src/core/lib/support/tmpfile.h', 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', - 'src/core/ext/lb_policy/pick_first/pick_first.h', - 'src/core/ext/lb_policy/round_robin/round_robin.h', 'src/core/ext/transport/chttp2/transport/alpn.h', 'src/core/ext/transport/chttp2/transport/bin_encoder.h', 'src/core/ext/transport/chttp2/transport/chttp2_transport.h', diff --git a/grpc.gemspec b/grpc.gemspec index 528fe3f58d4..e96bedb5875 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -159,8 +159,6 @@ Gem::Specification.new do |s| s.files += %w( include/grpc/status.h ) s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.h ) s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h ) - s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.h ) - s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.h ) s.files += %w( src/core/ext/transport/chttp2/transport/alpn.h ) s.files += %w( src/core/ext/transport/chttp2/transport/bin_encoder.h ) s.files += %w( src/core/ext/transport/chttp2/transport/chttp2_transport.h ) @@ -459,6 +457,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/tsi/fake_transport_security.c ) s.files += %w( src/core/lib/tsi/ssl_transport_security.c ) s.files += %w( src/core/lib/tsi/transport_security.c ) + s.files += %w( src/core/plugin_registry/grpc_plugin_registry.c ) s.files += %w( third_party/nanopb/pb_common.c ) s.files += %w( third_party/nanopb/pb_decode.c ) s.files += %w( third_party/nanopb/pb_encode.c ) diff --git a/package.json b/package.json index fa7ed029543..cbcfc19ee3c 100644 --- a/package.json +++ b/package.json @@ -102,8 +102,6 @@ "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -402,6 +400,7 @@ "src/core/lib/tsi/fake_transport_security.c", "src/core/lib/tsi/ssl_transport_security.c", "src/core/lib/tsi/transport_security.c", + "src/core/plugin_registry/grpc_plugin_registry.c", "third_party/nanopb/pb_common.c", "third_party/nanopb/pb_decode.c", "third_party/nanopb/pb_encode.c", diff --git a/package.xml b/package.xml index e29c55d69f9..1caf850c561 100644 --- a/package.xml +++ b/package.xml @@ -163,8 +163,6 @@ - - @@ -463,6 +461,7 @@ + diff --git a/src/core/ext/lb_policy/pick_first/pick_first.c b/src/core/ext/lb_policy/pick_first/pick_first.c index e1dae82c277..609c2d62d43 100644 --- a/src/core/ext/lb_policy/pick_first/pick_first.c +++ b/src/core/ext/lb_policy/pick_first/pick_first.c @@ -31,12 +31,10 @@ * */ -#include "src/core/ext/lb_policy/pick_first/pick_first.h" -#include "src/core/lib/client_config/lb_policy_factory.h" - #include #include +#include "src/core/lib/client_config/lb_policy_registry.h" #include "src/core/lib/transport/connectivity_state.h" typedef struct pending_pick { @@ -78,7 +76,7 @@ typedef struct { #define GET_SELECTED(p) \ ((grpc_connected_subchannel *)gpr_atm_acq_load(&(p)->selected)) -void pf_destroy(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { +static void pf_destroy(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { pick_first_lb_policy *p = (pick_first_lb_policy *)pol; grpc_connected_subchannel *selected = GET_SELECTED(p); size_t i; @@ -95,7 +93,7 @@ void pf_destroy(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { gpr_free(p); } -void pf_shutdown(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { +static void pf_shutdown(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { pick_first_lb_policy *p = (pick_first_lb_policy *)pol; pending_pick *pp; grpc_connected_subchannel *selected; @@ -162,7 +160,7 @@ static void start_picking(grpc_exec_ctx *exec_ctx, pick_first_lb_policy *p) { &p->connectivity_changed); } -void pf_exit_idle(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { +static void pf_exit_idle(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { pick_first_lb_policy *p = (pick_first_lb_policy *)pol; gpr_mu_lock(&p->mu); if (!p->started_picking) { @@ -171,9 +169,10 @@ void pf_exit_idle(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { gpr_mu_unlock(&p->mu); } -int pf_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, grpc_pollset *pollset, - grpc_metadata_batch *initial_metadata, - grpc_connected_subchannel **target, grpc_closure *on_complete) { +static int pf_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, + grpc_pollset *pollset, grpc_metadata_batch *initial_metadata, + grpc_connected_subchannel **target, + grpc_closure *on_complete) { pick_first_lb_policy *p = (pick_first_lb_policy *)pol; pending_pick *pp; @@ -356,9 +355,10 @@ static grpc_connectivity_state pf_check_connectivity(grpc_exec_ctx *exec_ctx, return st; } -void pf_notify_on_state_change(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, - grpc_connectivity_state *current, - grpc_closure *notify) { +static void pf_notify_on_state_change(grpc_exec_ctx *exec_ctx, + grpc_lb_policy *pol, + grpc_connectivity_state *current, + grpc_closure *notify) { pick_first_lb_policy *p = (pick_first_lb_policy *)pol; gpr_mu_lock(&p->mu); grpc_connectivity_state_notify_on_state_change(exec_ctx, &p->state_tracker, @@ -366,8 +366,8 @@ void pf_notify_on_state_change(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, gpr_mu_unlock(&p->mu); } -void pf_ping_one(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, - grpc_closure *closure) { +static void pf_ping_one(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, + grpc_closure *closure) { pick_first_lb_policy *p = (pick_first_lb_policy *)pol; grpc_connected_subchannel *selected = GET_SELECTED(p); if (selected) { @@ -416,6 +416,14 @@ static const grpc_lb_policy_factory_vtable pick_first_factory_vtable = { static grpc_lb_policy_factory pick_first_lb_policy_factory = { &pick_first_factory_vtable}; -grpc_lb_policy_factory *grpc_pick_first_lb_factory_create() { +static grpc_lb_policy_factory *pick_first_lb_factory_create() { return &pick_first_lb_policy_factory; } + +/* Plugin registration */ + +void grpc_lb_policy_pick_first_init() { + grpc_lb_policy_registry_init(pick_first_lb_factory_create()); +} + +void grpc_lb_policy_pick_first_shutdown() {} diff --git a/src/core/ext/lb_policy/pick_first/pick_first.h b/src/core/ext/lb_policy/pick_first/pick_first.h deleted file mode 100644 index 23a018ba448..00000000000 --- a/src/core/ext/lb_policy/pick_first/pick_first.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * Copyright 2015-2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPC_CORE_EXT_LB_POLICY_PICK_FIRST_PICK_FIRST_H -#define GRPC_CORE_EXT_LB_POLICY_PICK_FIRST_PICK_FIRST_H - -#include "src/core/lib/client_config/lb_policy_factory.h" - -/** Returns a load balancing factory for the pick first policy, which picks up - * the first subchannel from \a subchannels to succesfully connect */ -grpc_lb_policy_factory *grpc_pick_first_lb_factory_create(); - -#endif /* GRPC_CORE_EXT_LB_POLICY_PICK_FIRST_PICK_FIRST_H */ diff --git a/src/core/ext/lb_policy/round_robin/round_robin.c b/src/core/ext/lb_policy/round_robin/round_robin.c index 31056ea1385..318980892c5 100644 --- a/src/core/ext/lb_policy/round_robin/round_robin.c +++ b/src/core/ext/lb_policy/round_robin/round_robin.c @@ -31,11 +31,12 @@ * */ -#include "src/core/ext/lb_policy/round_robin/round_robin.h" - #include #include + +#include "src/core/lib/client_config/lb_policy_registry.h" +#include "src/core/lib/debug/trace.h" #include "src/core/lib/transport/connectivity_state.h" typedef struct round_robin_lb_policy round_robin_lb_policy; @@ -199,7 +200,7 @@ static void remove_disconnected_sc_locked(round_robin_lb_policy *p, gpr_free(node); } -void rr_destroy(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { +static void rr_destroy(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { round_robin_lb_policy *p = (round_robin_lb_policy *)pol; size_t i; ready_list *elem; @@ -226,7 +227,7 @@ void rr_destroy(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { gpr_free(p); } -void rr_shutdown(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { +static void rr_shutdown(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { round_robin_lb_policy *p = (round_robin_lb_policy *)pol; pending_pick *pp; size_t i; @@ -291,7 +292,7 @@ static void start_picking(grpc_exec_ctx *exec_ctx, round_robin_lb_policy *p) { } } -void rr_exit_idle(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { +static void rr_exit_idle(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { round_robin_lb_policy *p = (round_robin_lb_policy *)pol; gpr_mu_lock(&p->mu); if (!p->started_picking) { @@ -300,9 +301,10 @@ void rr_exit_idle(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { gpr_mu_unlock(&p->mu); } -int rr_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, grpc_pollset *pollset, - grpc_metadata_batch *initial_metadata, - grpc_connected_subchannel **target, grpc_closure *on_complete) { +static int rr_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, + grpc_pollset *pollset, grpc_metadata_batch *initial_metadata, + grpc_connected_subchannel **target, + grpc_closure *on_complete) { round_robin_lb_policy *p = (round_robin_lb_policy *)pol; pending_pick *pp; ready_list *selected; @@ -537,6 +539,15 @@ static const grpc_lb_policy_factory_vtable round_robin_factory_vtable = { static grpc_lb_policy_factory round_robin_lb_policy_factory = { &round_robin_factory_vtable}; -grpc_lb_policy_factory *grpc_round_robin_lb_factory_create() { +static grpc_lb_policy_factory *round_robin_lb_factory_create() { return &round_robin_lb_policy_factory; } + +/* Plugin registration */ + +void grpc_lb_policy_round_robin_init() { + grpc_lb_policy_registry_init(round_robin_lb_factory_create()); + grpc_register_tracer("round_robin", &grpc_lb_round_robin_trace); +} + +void grpc_lb_policy_round_robin_shutdown() {} diff --git a/src/core/ext/lb_policy/round_robin/round_robin.h b/src/core/ext/lb_policy/round_robin/round_robin.h deleted file mode 100644 index 4cac8682f6a..00000000000 --- a/src/core/ext/lb_policy/round_robin/round_robin.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * Copyright 2015-2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPC_CORE_EXT_LB_POLICY_ROUND_ROBIN_ROUND_ROBIN_H -#define GRPC_CORE_EXT_LB_POLICY_ROUND_ROBIN_ROUND_ROBIN_H - -#include "src/core/lib/client_config/lb_policy.h" - -extern int grpc_lb_round_robin_trace; - -#include "src/core/lib/client_config/lb_policy_factory.h" - -/** Returns a load balancing factory for the round robin policy */ -grpc_lb_policy_factory *grpc_round_robin_lb_factory_create(); - -#endif /* GRPC_CORE_EXT_LB_POLICY_ROUND_ROBIN_ROUND_ROBIN_H */ diff --git a/src/core/lib/surface/init.c b/src/core/lib/surface/init.c index 5bf275b97a6..69e0e692be4 100644 --- a/src/core/lib/surface/init.c +++ b/src/core/lib/surface/init.c @@ -48,8 +48,6 @@ #include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/http_client_filter.h" #include "src/core/lib/channel/http_server_filter.h" -#include "src/core/ext/lb_policy/pick_first/pick_first.h" -#include "src/core/ext/lb_policy/round_robin/round_robin.h" #include "src/core/lib/client_config/lb_policy_registry.h" #include "src/core/lib/client_config/resolver_registry.h" #include "src/core/lib/client_config/resolvers/dns_resolver.h" @@ -165,9 +163,6 @@ void grpc_init(void) { gpr_time_init(); grpc_mdctx_global_init(); grpc_channel_init_init(); - grpc_lb_policy_registry_init(grpc_pick_first_lb_factory_create()); - grpc_register_lb_policy(grpc_pick_first_lb_factory_create()); - grpc_register_lb_policy(grpc_round_robin_lb_factory_create()); grpc_resolver_registry_init(GRPC_DEFAULT_NAME_PREFIX); grpc_register_resolver_type(grpc_dns_resolver_factory_create()); grpc_register_resolver_type(grpc_ipv4_resolver_factory_create()); diff --git a/src/core/plugin_registry/grpc_plugin_registry.c b/src/core/plugin_registry/grpc_plugin_registry.c index b0ac5249328..3e3c214c221 100644 --- a/src/core/plugin_registry/grpc_plugin_registry.c +++ b/src/core/plugin_registry/grpc_plugin_registry.c @@ -30,3 +30,17 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ + +#include + +extern void grpc_lb_policy_pick_first_init(void); +extern void grpc_lb_policy_pick_first_shutdown(void); +extern void grpc_lb_policy_round_robin_init(void); +extern void grpc_lb_policy_round_robin_shutdown(void); + +void grpc_register_built_in_plugins(void) { + grpc_register_plugin(grpc_lb_policy_pick_first_init, + grpc_lb_policy_pick_first_shutdown); + grpc_register_plugin(grpc_lb_policy_round_robin_init, + grpc_lb_policy_round_robin_shutdown); +} diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c b/src/core/plugin_registry/grpc_unsecure_plugin_registry.c index b0ac5249328..3e3c214c221 100644 --- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c +++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.c @@ -30,3 +30,17 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ + +#include + +extern void grpc_lb_policy_pick_first_init(void); +extern void grpc_lb_policy_pick_first_shutdown(void); +extern void grpc_lb_policy_round_robin_init(void); +extern void grpc_lb_policy_round_robin_shutdown(void); + +void grpc_register_built_in_plugins(void) { + grpc_register_plugin(grpc_lb_policy_pick_first_init, + grpc_lb_policy_pick_first_shutdown); + grpc_register_plugin(grpc_lb_policy_round_robin_init, + grpc_lb_policy_round_robin_shutdown); +} diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 8c7890c0943..3cd8f62221f 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -235,6 +235,7 @@ CORE_SOURCE_FILES = [ 'src/core/lib/tsi/fake_transport_security.c', 'src/core/lib/tsi/ssl_transport_security.c', 'src/core/lib/tsi/transport_security.c', + 'src/core/plugin_registry/grpc_plugin_registry.c', 'third_party/nanopb/pb_common.c', 'third_party/nanopb/pb_decode.c', 'third_party/nanopb/pb_encode.c', diff --git a/templates/src/core/plugin_registry.template b/templates/src/core/plugin_registry.template index 5d522c6e9df..352682c3f0b 100644 --- a/templates/src/core/plugin_registry.template +++ b/templates/src/core/plugin_registry.template @@ -36,3 +36,17 @@ template: | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ + + #include + + %for plugin in selected.plugins: + extern void ${plugin}_init(void); + extern void ${plugin}_shutdown(void); + %endfor + + void grpc_register_built_in_plugins(void) { + %for plugin in selected.plugins: + grpc_register_plugin(${plugin}_init, + ${plugin}_shutdown); + %endfor + } diff --git a/test/core/client_config/lb_policies_test.c b/test/core/client_config/lb_policies_test.c index bd2f0e5e750..fcb8630cabb 100644 --- a/test/core/client_config/lb_policies_test.c +++ b/test/core/client_config/lb_policies_test.c @@ -43,7 +43,6 @@ #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/client_channel.h" -#include "src/core/ext/lb_policy/round_robin/round_robin.h" #include "src/core/lib/client_config/lb_policy_registry.h" #include "src/core/lib/support/string.h" #include "src/core/lib/surface/channel.h" @@ -880,7 +879,7 @@ int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); - grpc_lb_round_robin_trace = 1; + grpc_tracer_set_enabled("round_robin", 1); GPR_ASSERT(grpc_lb_policy_create("this-lb-policy-does-not-exist", NULL) == NULL); diff --git a/tools/buildgen/plugins/expand_filegroups.py b/tools/buildgen/plugins/expand_filegroups.py index c40143ef958..0294a43271a 100755 --- a/tools/buildgen/plugins/expand_filegroups.py +++ b/tools/buildgen/plugins/expand_filegroups.py @@ -75,11 +75,20 @@ def mako_plugin(dictionary): todo.append(cur) else: skips = 0 + assert 'plugins' not in cur + plugins = [] for uses in cur.get('uses', []): + for plugin in filegroups[uses]['plugins']: + if plugin not in plugins: + plugins.append(plugin) for lst in FILEGROUP_LISTS: vals = cur.get(lst, []) vals.extend(filegroups[uses].get(lst, [])) cur[lst] = vals + cur_plugin_name = cur.get('plugin') + if cur_plugin_name: + plugins.append(cur_plugin_name) + cur['plugins'] = plugins filegroups[cur['name']] = cur # the above expansion can introduce duplicate filenames: contract them here @@ -88,13 +97,20 @@ def mako_plugin(dictionary): fg[lst] = sorted(list(set(fg.get(lst, [])))) for lib in libs: + assert 'plugins' not in lib + plugins = [] for fg_name in lib.get('filegroups', []): fg = filegroups[fg_name] - + for plugin in fg['plugins']: + if plugin not in plugins: + plugins.append(plugin) for lst in FILEGROUP_LISTS: vals = lib.get(lst, []) vals.extend(fg.get(lst, [])) lib[lst] = vals - + lib['plugins'] = plugins + if lib.get('generate_plugin_registry', False): + lib['src'].append('src/core/plugin_registry/%s_plugin_registry.c' % + lib['name']) for lst in FILEGROUP_LISTS: lib[lst] = sorted(list(set(lib.get(lst, [])))) diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index d3b7e2b8a28..b94447c5550 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -775,8 +775,6 @@ include/grpc/impl/codegen/status.h \ include/grpc/status.h \ src/core/ext/lb_policy/grpclb/load_balancer_api.h \ src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ -src/core/ext/lb_policy/pick_first/pick_first.h \ -src/core/ext/lb_policy/round_robin/round_robin.h \ src/core/ext/transport/chttp2/transport/alpn.h \ src/core/ext/transport/chttp2/transport/bin_encoder.h \ src/core/ext/transport/chttp2/transport/chttp2_transport.h \ @@ -1075,6 +1073,7 @@ src/core/lib/transport/transport_op_string.c \ src/core/lib/tsi/fake_transport_security.c \ src/core/lib/tsi/ssl_transport_security.c \ src/core/lib/tsi/transport_security.c \ +src/core/plugin_registry/grpc_plugin_registry.c \ third_party/nanopb/pb_common.c \ third_party/nanopb/pb_decode.c \ third_party/nanopb/pb_encode.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 3337c84b10a..9fbf7ba2a7a 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -3926,8 +3926,6 @@ "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -4087,9 +4085,7 @@ "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/lb_policy/pick_first/pick_first.c", - "src/core/ext/lb_policy/pick_first/pick_first.h", "src/core/ext/lb_policy/round_robin/round_robin.c", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", "src/core/ext/transport/chttp2/client/secure/secure_channel_create.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2.c", @@ -4379,7 +4375,8 @@ "src/core/lib/tsi/ssl_types.h", "src/core/lib/tsi/transport_security.c", "src/core/lib/tsi/transport_security.h", - "src/core/lib/tsi/transport_security_interface.h" + "src/core/lib/tsi/transport_security_interface.h", + "src/core/plugin_registry/grpc_plugin_registry.c" ], "third_party": false, "type": "lib" @@ -4554,8 +4551,6 @@ "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", - "src/core/ext/lb_policy/pick_first/pick_first.h", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -4700,9 +4695,7 @@ "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/lb_policy/pick_first/pick_first.c", - "src/core/ext/lb_policy/pick_first/pick_first.h", "src/core/ext/lb_policy/round_robin/round_robin.c", - "src/core/ext/lb_policy/round_robin/round_robin.h", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2.c", "src/core/ext/transport/chttp2/transport/alpn.c", @@ -4958,7 +4951,8 @@ "src/core/lib/transport/transport.c", "src/core/lib/transport/transport.h", "src/core/lib/transport/transport_impl.h", - "src/core/lib/transport/transport_op_string.c" + "src/core/lib/transport/transport_op_string.c", + "src/core/plugin_registry/grpc_unsecure_plugin_registry.c" ], "third_party": false, "type": "lib" diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index 678f913e45f..93d5a9b02fa 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -284,8 +284,6 @@ - - @@ -747,6 +745,8 @@ + + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 60d0811ec5c..3e5032db0e1 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -484,6 +484,9 @@ src\core\lib\tsi + + src\core\plugin_registry + third_party\nanopb @@ -542,12 +545,6 @@ src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 - - src\core\ext\lb_policy\pick_first - - - src\core\ext\lb_policy\round_robin - src\core\ext\transport\chttp2\transport @@ -1079,6 +1076,9 @@ {95ad2811-c8d0-7a42-2a73-baf03fcbf699} + + {02bec99b-ff39-88d7-9dea-e0ff9f4a2701} + {aaab30a4-2a15-732e-c141-3fbc0f0f5a7a} diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index a2426c7712a..98a6bee1704 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -274,8 +274,6 @@ - - @@ -683,6 +681,8 @@ + + diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index dee6778ffb4..81c8a874fc9 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -424,6 +424,9 @@ src\core\lib\transport + + src\core\plugin_registry + third_party\nanopb @@ -479,12 +482,6 @@ src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 - - src\core\ext\lb_policy\pick_first - - - src\core\ext\lb_policy\round_robin - src\core\ext\transport\chttp2\transport @@ -962,6 +959,9 @@ {6c3394d1-27e9-003e-19ed-8116d210f7cc} + + {babf0a90-e934-f599-5475-e6937d9580fe} + {025c051e-8eba-125b-67f9-173f95176eb2} From 3113ef48ab8ae6e8c879cfb15ef0ccfe9a7cc824 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 29 Mar 2016 09:03:14 -0700 Subject: [PATCH 09/12] Register plugins correctly --- src/core/ext/lb_policy/pick_first/pick_first.c | 2 +- src/core/ext/lb_policy/round_robin/round_robin.c | 2 +- src/core/lib/client_config/lb_policy_registry.c | 7 +------ src/core/lib/client_config/lb_policy_registry.h | 2 +- src/core/lib/surface/init.c | 5 +++++ 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/ext/lb_policy/pick_first/pick_first.c b/src/core/ext/lb_policy/pick_first/pick_first.c index 609c2d62d43..8dc7ed01e28 100644 --- a/src/core/ext/lb_policy/pick_first/pick_first.c +++ b/src/core/ext/lb_policy/pick_first/pick_first.c @@ -423,7 +423,7 @@ static grpc_lb_policy_factory *pick_first_lb_factory_create() { /* Plugin registration */ void grpc_lb_policy_pick_first_init() { - grpc_lb_policy_registry_init(pick_first_lb_factory_create()); + grpc_register_lb_policy(pick_first_lb_factory_create()); } void grpc_lb_policy_pick_first_shutdown() {} diff --git a/src/core/ext/lb_policy/round_robin/round_robin.c b/src/core/ext/lb_policy/round_robin/round_robin.c index 318980892c5..b1996922bf9 100644 --- a/src/core/ext/lb_policy/round_robin/round_robin.c +++ b/src/core/ext/lb_policy/round_robin/round_robin.c @@ -546,7 +546,7 @@ static grpc_lb_policy_factory *round_robin_lb_factory_create() { /* Plugin registration */ void grpc_lb_policy_round_robin_init() { - grpc_lb_policy_registry_init(round_robin_lb_factory_create()); + grpc_register_lb_policy(round_robin_lb_factory_create()); grpc_register_tracer("round_robin", &grpc_lb_round_robin_trace); } diff --git a/src/core/lib/client_config/lb_policy_registry.c b/src/core/lib/client_config/lb_policy_registry.c index 13acfe78cda..82f70ed8c0b 100644 --- a/src/core/lib/client_config/lb_policy_registry.c +++ b/src/core/lib/client_config/lb_policy_registry.c @@ -40,12 +40,7 @@ static grpc_lb_policy_factory *g_all_of_the_lb_policies[MAX_POLICIES]; static int g_number_of_lb_policies = 0; -static grpc_lb_policy_factory *g_default_lb_policy_factory; - -void grpc_lb_policy_registry_init(grpc_lb_policy_factory *default_factory) { - g_number_of_lb_policies = 0; - g_default_lb_policy_factory = default_factory; -} +void grpc_lb_policy_registry_init(void) { g_number_of_lb_policies = 0; } void grpc_lb_policy_registry_shutdown(void) { int i; diff --git a/src/core/lib/client_config/lb_policy_registry.h b/src/core/lib/client_config/lb_policy_registry.h index c251fd9f080..da3a5d5e797 100644 --- a/src/core/lib/client_config/lb_policy_registry.h +++ b/src/core/lib/client_config/lb_policy_registry.h @@ -38,7 +38,7 @@ /** Initialize the registry and set \a default_factory as the factory to be * returned when no name is provided in a lookup */ -void grpc_lb_policy_registry_init(grpc_lb_policy_factory *default_factory); +void grpc_lb_policy_registry_init(void); void grpc_lb_policy_registry_shutdown(void); /** Register a LB policy factory. */ diff --git a/src/core/lib/surface/init.c b/src/core/lib/surface/init.c index 69e0e692be4..d59323b2bc4 100644 --- a/src/core/lib/surface/init.c +++ b/src/core/lib/surface/init.c @@ -73,6 +73,9 @@ #define GRPC_DEFAULT_NAME_PREFIX "dns:///" #endif +/* (generated) built in registry of plugins */ +extern void grpc_register_built_in_plugins(void); + #define MAX_PLUGINS 128 static gpr_once g_basic_init = GPR_ONCE_INIT; @@ -81,6 +84,7 @@ static int g_initializations; static void do_basic_init(void) { gpr_mu_init(&g_init_mu); + grpc_register_built_in_plugins(); /* TODO(ctiller): ideally remove this strict linkage */ grpc_register_plugin(census_grpc_plugin_init, census_grpc_plugin_destroy); g_initializations = 0; @@ -163,6 +167,7 @@ void grpc_init(void) { gpr_time_init(); grpc_mdctx_global_init(); grpc_channel_init_init(); + grpc_lb_policy_registry_init(); grpc_resolver_registry_init(GRPC_DEFAULT_NAME_PREFIX); grpc_register_resolver_type(grpc_dns_resolver_factory_create()); grpc_register_resolver_type(grpc_ipv4_resolver_factory_create()); From 796474c792c3744c78d64a3d8430817782d03042 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 29 Mar 2016 09:43:28 -0700 Subject: [PATCH 10/12] Move proto code under ext/.../grpclb --- BUILD | 12 ++++++------ Makefile | 4 ++-- binding.gyp | 2 +- build.yaml | 4 ++-- config.m4 | 2 +- gRPC.podspec | 6 +++--- grpc.gemspec | 4 ++-- package.json | 4 ++-- package.xml | 4 ++-- src/python/grpcio/grpc_core_dependencies.py | 2 +- tools/doxygen/Doxyfile.core.internal | 4 ++-- tools/run_tests/sources_and_headers.json | 4 ++-- vsprojects/vcxproj/grpc/grpc.vcxproj | 4 ++-- vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 4 ++-- .../vcxproj/grpc_unsecure/grpc_unsecure.vcxproj | 4 ++-- .../grpc_unsecure/grpc_unsecure.vcxproj.filters | 4 ++-- 16 files changed, 34 insertions(+), 34 deletions(-) diff --git a/BUILD b/BUILD index 22cbf3d0afd..1c638909ed4 100644 --- a/BUILD +++ b/BUILD @@ -158,7 +158,7 @@ cc_library( name = "grpc", srcs = [ "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -297,7 +297,7 @@ cc_library( "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/lb_policy/pick_first/pick_first.c", "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", @@ -532,7 +532,7 @@ cc_library( name = "grpc_unsecure", srcs = [ "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -657,7 +657,7 @@ cc_library( "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/lb_policy/pick_first/pick_first.c", "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", @@ -1359,7 +1359,7 @@ objc_library( name = "grpc_objc", srcs = [ "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/lb_policy/pick_first/pick_first.c", "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", @@ -1539,7 +1539,7 @@ objc_library( "include/grpc/impl/codegen/status.h", "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", diff --git a/Makefile b/Makefile index 7b7200b6aee..502e128060e 100644 --- a/Makefile +++ b/Makefile @@ -2421,7 +2421,7 @@ endif LIBGRPC_SRC = \ src/core/ext/lb_policy/grpclb/load_balancer_api.c \ - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ @@ -2783,7 +2783,7 @@ endif LIBGRPC_UNSECURE_SRC = \ src/core/ext/lb_policy/grpclb/load_balancer_api.c \ - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ diff --git a/binding.gyp b/binding.gyp index bfae59e50ce..b97ab023d1e 100644 --- a/binding.gyp +++ b/binding.gyp @@ -559,7 +559,7 @@ ], 'sources': [ 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/ext/lb_policy/pick_first/pick_first.c', 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c', diff --git a/build.yaml b/build.yaml index de4deeb9289..0ada42fa96c 100644 --- a/build.yaml +++ b/build.yaml @@ -247,7 +247,6 @@ filegroups: - include/grpc/grpc.h - include/grpc/status.h headers: - - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h - src/core/lib/census/grpc_filter.h - src/core/lib/census/grpc_plugin.h - src/core/lib/channel/channel_args.h @@ -344,7 +343,6 @@ filegroups: - src/core/lib/transport/transport.h - src/core/lib/transport/transport_impl.h src: - - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c - src/core/lib/census/grpc_context.c - src/core/lib/census/grpc_filter.c - src/core/lib/census/grpc_plugin.c @@ -463,8 +461,10 @@ filegroups: - name: grpc_lb_policy_grpclb headers: - src/core/ext/lb_policy/grpclb/load_balancer_api.h + - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c src: - src/core/ext/lb_policy/grpclb/load_balancer_api.c + - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h uses: - grpc_base - name: grpc_lb_policy_pick_first diff --git a/config.m4 b/config.m4 index 1b414a1142b..6bf0f4d8a71 100644 --- a/config.m4 +++ b/config.m4 @@ -81,7 +81,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/support/tmpfile_win32.c \ src/core/lib/support/wrap_memcpy.c \ src/core/ext/lb_policy/grpclb/load_balancer_api.c \ - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ diff --git a/gRPC.podspec b/gRPC.podspec index d94905ce2a6..cacaa027fb2 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -162,7 +162,7 @@ Pod::Spec.new do |s| 'src/core/lib/support/tmpfile_win32.c', 'src/core/lib/support/wrap_memcpy.c', 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/ext/transport/chttp2/transport/alpn.h', 'src/core/ext/transport/chttp2/transport/bin_encoder.h', 'src/core/ext/transport/chttp2/transport/chttp2_transport.h', @@ -314,7 +314,7 @@ Pod::Spec.new do |s| 'include/grpc/impl/codegen/status.h', 'include/grpc/status.h', 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/ext/lb_policy/pick_first/pick_first.c', 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c', @@ -492,7 +492,7 @@ Pod::Spec.new do |s| 'src/core/lib/support/time_precise.h', 'src/core/lib/support/tmpfile.h', 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/ext/transport/chttp2/transport/alpn.h', 'src/core/ext/transport/chttp2/transport/bin_encoder.h', 'src/core/ext/transport/chttp2/transport/chttp2_transport.h', diff --git a/grpc.gemspec b/grpc.gemspec index e96bedb5875..59361b29778 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -158,7 +158,7 @@ Gem::Specification.new do |s| s.files += %w( include/grpc/impl/codegen/status.h ) s.files += %w( include/grpc/status.h ) s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.h ) - s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h ) + s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c ) s.files += %w( src/core/ext/transport/chttp2/transport/alpn.h ) s.files += %w( src/core/ext/transport/chttp2/transport/bin_encoder.h ) s.files += %w( src/core/ext/transport/chttp2/transport/chttp2_transport.h ) @@ -297,7 +297,7 @@ Gem::Specification.new do |s| s.files += %w( third_party/nanopb/pb_decode.h ) s.files += %w( third_party/nanopb/pb_encode.h ) s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.c ) - s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c ) + s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h ) s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.c ) s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.c ) s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.c ) diff --git a/package.json b/package.json index cbcfc19ee3c..37e94a17613 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "include/grpc/impl/codegen/status.h", "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -240,7 +240,7 @@ "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/lb_policy/pick_first/pick_first.c", "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", diff --git a/package.xml b/package.xml index 1caf850c561..6d9356bc09f 100644 --- a/package.xml +++ b/package.xml @@ -162,7 +162,7 @@ - + @@ -301,7 +301,7 @@ - + diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 3cd8f62221f..237a05130b5 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -75,7 +75,7 @@ CORE_SOURCE_FILES = [ 'src/core/lib/support/tmpfile_win32.c', 'src/core/lib/support/wrap_memcpy.c', 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/ext/lb_policy/pick_first/pick_first.c', 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c', diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index b94447c5550..f3405fe5465 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -774,7 +774,7 @@ include/grpc/impl/codegen/propagation_bits.h \ include/grpc/impl/codegen/status.h \ include/grpc/status.h \ src/core/ext/lb_policy/grpclb/load_balancer_api.h \ -src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ +src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/ext/transport/chttp2/transport/alpn.h \ src/core/ext/transport/chttp2/transport/bin_encoder.h \ src/core/ext/transport/chttp2/transport/chttp2_transport.h \ @@ -913,7 +913,7 @@ third_party/nanopb/pb_common.h \ third_party/nanopb/pb_decode.h \ third_party/nanopb/pb_encode.h \ src/core/ext/lb_policy/grpclb/load_balancer_api.c \ -src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ +src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 9fbf7ba2a7a..5cbf890bea4 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -3925,7 +3925,7 @@ "include/grpc/impl/codegen/status.h", "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -4550,7 +4550,7 @@ "include/grpc/impl/codegen/status.h", "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index 93d5a9b02fa..18b92fb359b 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -283,7 +283,7 @@ - + @@ -425,7 +425,7 @@ - + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 3e5032db0e1..31a852b692e 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -4,7 +4,7 @@ src\core\ext\lb_policy\grpclb - + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 @@ -542,7 +542,7 @@ src\core\ext\lb_policy\grpclb - + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index 98a6bee1704..981d0a27147 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -273,7 +273,7 @@ - + @@ -401,7 +401,7 @@ - + diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index 81c8a874fc9..cebb073c59b 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -4,7 +4,7 @@ src\core\ext\lb_policy\grpclb - + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 @@ -479,7 +479,7 @@ src\core\ext\lb_policy\grpclb - + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 From 943cdf99e9fa08f17b7f11c87492b865a1e4741e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 29 Mar 2016 13:27:56 -0700 Subject: [PATCH 11/12] Swap header/src into the right order --- BUILD | 12 ++++++------ Makefile | 4 ++-- binding.gyp | 2 +- build.yaml | 4 ++-- config.m4 | 2 +- gRPC.podspec | 6 +++--- grpc.gemspec | 4 ++-- package.json | 4 ++-- package.xml | 4 ++-- src/python/grpcio/grpc_core_dependencies.py | 2 +- tools/doxygen/Doxyfile.core.internal | 4 ++-- tools/run_tests/sources_and_headers.json | 4 ++-- vsprojects/vcxproj/grpc/grpc.vcxproj | 4 ++-- vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 4 ++-- .../vcxproj/grpc_unsecure/grpc_unsecure.vcxproj | 4 ++-- .../grpc_unsecure/grpc_unsecure.vcxproj.filters | 4 ++-- 16 files changed, 34 insertions(+), 34 deletions(-) diff --git a/BUILD b/BUILD index 1c638909ed4..22cbf3d0afd 100644 --- a/BUILD +++ b/BUILD @@ -158,7 +158,7 @@ cc_library( name = "grpc", srcs = [ "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -297,7 +297,7 @@ cc_library( "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/lb_policy/pick_first/pick_first.c", "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", @@ -532,7 +532,7 @@ cc_library( name = "grpc_unsecure", srcs = [ "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -657,7 +657,7 @@ cc_library( "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/lb_policy/pick_first/pick_first.c", "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", @@ -1359,7 +1359,7 @@ objc_library( name = "grpc_objc", srcs = [ "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/lb_policy/pick_first/pick_first.c", "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", @@ -1539,7 +1539,7 @@ objc_library( "include/grpc/impl/codegen/status.h", "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", diff --git a/Makefile b/Makefile index 4b07c4eeaf2..e446e309783 100644 --- a/Makefile +++ b/Makefile @@ -2435,7 +2435,7 @@ endif LIBGRPC_SRC = \ src/core/ext/lb_policy/grpclb/load_balancer_api.c \ - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ @@ -2797,7 +2797,7 @@ endif LIBGRPC_UNSECURE_SRC = \ src/core/ext/lb_policy/grpclb/load_balancer_api.c \ - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ diff --git a/binding.gyp b/binding.gyp index b97ab023d1e..bfae59e50ce 100644 --- a/binding.gyp +++ b/binding.gyp @@ -559,7 +559,7 @@ ], 'sources': [ 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/ext/lb_policy/pick_first/pick_first.c', 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c', diff --git a/build.yaml b/build.yaml index f5dc786c26c..9a829f20802 100644 --- a/build.yaml +++ b/build.yaml @@ -461,10 +461,10 @@ filegroups: - name: grpc_lb_policy_grpclb headers: - src/core/ext/lb_policy/grpclb/load_balancer_api.h - - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c + - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h src: - src/core/ext/lb_policy/grpclb/load_balancer_api.c - - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h + - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c uses: - grpc_base - name: grpc_lb_policy_pick_first diff --git a/config.m4 b/config.m4 index 6bf0f4d8a71..1b414a1142b 100644 --- a/config.m4 +++ b/config.m4 @@ -81,7 +81,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/support/tmpfile_win32.c \ src/core/lib/support/wrap_memcpy.c \ src/core/ext/lb_policy/grpclb/load_balancer_api.c \ - src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ + src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ diff --git a/gRPC.podspec b/gRPC.podspec index cacaa027fb2..d94905ce2a6 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -162,7 +162,7 @@ Pod::Spec.new do |s| 'src/core/lib/support/tmpfile_win32.c', 'src/core/lib/support/wrap_memcpy.c', 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/ext/transport/chttp2/transport/alpn.h', 'src/core/ext/transport/chttp2/transport/bin_encoder.h', 'src/core/ext/transport/chttp2/transport/chttp2_transport.h', @@ -314,7 +314,7 @@ Pod::Spec.new do |s| 'include/grpc/impl/codegen/status.h', 'include/grpc/status.h', 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/ext/lb_policy/pick_first/pick_first.c', 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c', @@ -492,7 +492,7 @@ Pod::Spec.new do |s| 'src/core/lib/support/time_precise.h', 'src/core/lib/support/tmpfile.h', 'src/core/ext/lb_policy/grpclb/load_balancer_api.h', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/ext/transport/chttp2/transport/alpn.h', 'src/core/ext/transport/chttp2/transport/bin_encoder.h', 'src/core/ext/transport/chttp2/transport/chttp2_transport.h', diff --git a/grpc.gemspec b/grpc.gemspec index 59361b29778..e96bedb5875 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -158,7 +158,7 @@ Gem::Specification.new do |s| s.files += %w( include/grpc/impl/codegen/status.h ) s.files += %w( include/grpc/status.h ) s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.h ) - s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c ) + s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h ) s.files += %w( src/core/ext/transport/chttp2/transport/alpn.h ) s.files += %w( src/core/ext/transport/chttp2/transport/bin_encoder.h ) s.files += %w( src/core/ext/transport/chttp2/transport/chttp2_transport.h ) @@ -297,7 +297,7 @@ Gem::Specification.new do |s| s.files += %w( third_party/nanopb/pb_decode.h ) s.files += %w( third_party/nanopb/pb_encode.h ) s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.c ) - s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h ) + s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c ) s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.c ) s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.c ) s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.c ) diff --git a/package.json b/package.json index 37e94a17613..cbcfc19ee3c 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "include/grpc/impl/codegen/status.h", "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -240,7 +240,7 @@ "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.c", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/ext/lb_policy/pick_first/pick_first.c", "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c", diff --git a/package.xml b/package.xml index 6d9356bc09f..1caf850c561 100644 --- a/package.xml +++ b/package.xml @@ -162,7 +162,7 @@ - + @@ -301,7 +301,7 @@ - + diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 237a05130b5..3cd8f62221f 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -75,7 +75,7 @@ CORE_SOURCE_FILES = [ 'src/core/lib/support/tmpfile_win32.c', 'src/core/lib/support/wrap_memcpy.c', 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', - 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h', + 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/ext/lb_policy/pick_first/pick_first.c', 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c', diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index f3405fe5465..b94447c5550 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -774,7 +774,7 @@ include/grpc/impl/codegen/propagation_bits.h \ include/grpc/impl/codegen/status.h \ include/grpc/status.h \ src/core/ext/lb_policy/grpclb/load_balancer_api.h \ -src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ +src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ src/core/ext/transport/chttp2/transport/alpn.h \ src/core/ext/transport/chttp2/transport/bin_encoder.h \ src/core/ext/transport/chttp2/transport/chttp2_transport.h \ @@ -913,7 +913,7 @@ third_party/nanopb/pb_common.h \ third_party/nanopb/pb_decode.h \ third_party/nanopb/pb_encode.h \ src/core/ext/lb_policy/grpclb/load_balancer_api.c \ -src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \ +src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index e3e22769219..6084a16aa1f 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -3989,7 +3989,7 @@ "include/grpc/impl/codegen/status.h", "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", @@ -4614,7 +4614,7 @@ "include/grpc/impl/codegen/status.h", "include/grpc/status.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/ext/transport/chttp2/transport/alpn.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index 18b92fb359b..93d5a9b02fa 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -283,7 +283,7 @@ - + @@ -425,7 +425,7 @@ - + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 31a852b692e..3e5032db0e1 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -4,7 +4,7 @@ src\core\ext\lb_policy\grpclb - + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 @@ -542,7 +542,7 @@ src\core\ext\lb_policy\grpclb - + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index 981d0a27147..98a6bee1704 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -273,7 +273,7 @@ - + @@ -401,7 +401,7 @@ - + diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index cebb073c59b..81c8a874fc9 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -4,7 +4,7 @@ src\core\ext\lb_policy\grpclb - + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 @@ -479,7 +479,7 @@ src\core\ext\lb_policy\grpclb - + src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0 From 447bab1553d6b872e9cd447919f1b3a1e21c9ad6 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 29 Mar 2016 13:53:22 -0700 Subject: [PATCH 12/12] clang-format --- src/core/ext/lb_policy/grpclb/load_balancer_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ext/lb_policy/grpclb/load_balancer_api.h b/src/core/ext/lb_policy/grpclb/load_balancer_api.h index b39b4635d34..d329a2ffe82 100644 --- a/src/core/ext/lb_policy/grpclb/load_balancer_api.h +++ b/src/core/ext/lb_policy/grpclb/load_balancer_api.h @@ -36,8 +36,8 @@ #include -#include "src/core/lib/client_config/lb_policy_factory.h" #include "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h" +#include "src/core/lib/client_config/lb_policy_factory.h" #ifdef __cplusplus extern "C" {