From cfcbb0a535a190458384ec6718a496c5b54af9ec Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 20 Feb 2024 18:04:53 -0800 Subject: [PATCH] [build] move parts of the `grpc_client_channel` BUILD target out into their own targets (#35879) This breaks the following pieces out of the `grpc_client_channel` BUILD target: - backend_metric_parser - oob_backend_metric - child_policy_handler - backup_poller - service_config_channel_arg_filter - client_channel_channelz - client_channel_internal_header - subchannel_connector - subchannel_pool_interface - config_selector - client_channel_service_config_parser - retry_service_config_parser - retry_throttle The code left in the `grpc_client_channel` target will need more work to pull apart. Closes #35879 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35879 from markdroth:client_channel_build_split f388a37edcda5c319910596332c222fc98664fe8 PiperOrigin-RevId: 608806548 --- BUILD | 120 +++++-- CMakeLists.txt | 8 +- Makefile | 8 +- Package.swift | 6 +- build_autogenerated.yaml | 12 +- config.m4 | 4 +- config.w32 | 4 +- gRPC-C++.podspec | 8 +- gRPC-Core.podspec | 12 +- grpc.gemspec | 6 +- grpc.gyp | 8 +- package.xml | 6 +- src/core/BUILD | 334 ++++++++++++++++++ .../client_channel/client_channel_filter.cc | 6 +- .../backend_metric_parser.cc} | 2 +- .../backend_metric_parser.h} | 6 +- src/core/load_balancing/oob_backend_metric.cc | 4 +- src/core/load_balancing/oob_backend_metric.h | 2 +- .../service_config_channel_arg_filter.cc | 0 src/python/grpcio/grpc_core_dependencies.py | 4 +- test/core/client_channel/BUILD | 1 + test/core/client_channel/lb_policy/BUILD | 4 + test/core/util/BUILD | 1 + test/cpp/end2end/BUILD | 1 + tools/doxygen/Doxyfile.c++.internal | 6 +- tools/doxygen/Doxyfile.core.internal | 6 +- 26 files changed, 494 insertions(+), 85 deletions(-) rename src/core/{client_channel/backend_metric.cc => load_balancing/backend_metric_parser.cc} (98%) rename src/core/{client_channel/backend_metric.h => load_balancing/backend_metric_parser.h} (87%) rename src/core/{client_channel => service_config}/service_config_channel_arg_filter.cc (100%) diff --git a/BUILD b/BUILD index 5dd9ed6b08d..65fc7115dc7 100644 --- a/BUILD +++ b/BUILD @@ -570,12 +570,15 @@ grpc_cc_library( "//src/core:channel_args", "//src/core:channel_init", "//src/core:channel_stack_type", + "//src/core:client_channel_backup_poller", "//src/core:default_event_engine", "//src/core:experiments", "//src/core:forkable", "//src/core:grpc_authorization_base", + "//src/core:http_proxy_mapper", "//src/core:init_internally", "//src/core:posix_event_engine_timer_manager", + "//src/core:service_config_channel_arg_filter", "//src/core:slice", "//src/core:tcp_connect_handshaker", ], @@ -652,6 +655,7 @@ grpc_cc_library( "//src/core:channel_args", "//src/core:channel_init", "//src/core:channel_stack_type", + "//src/core:client_channel_backup_poller", "//src/core:default_event_engine", "//src/core:experiments", "//src/core:forkable", @@ -666,11 +670,13 @@ grpc_cc_library( "//src/core:grpc_ssl_credentials", "//src/core:grpc_tls_credentials", "//src/core:grpc_transport_chttp2_alpn", + "//src/core:http_proxy_mapper", "//src/core:httpcli_ssl_credentials", "//src/core:init_internally", "//src/core:json", "//src/core:posix_event_engine_timer_manager", "//src/core:ref_counted", + "//src/core:service_config_channel_arg_filter", "//src/core:slice", "//src/core:slice_refcount", "//src/core:tcp_connect_handshaker", @@ -1120,6 +1126,7 @@ grpc_cc_library( "//src/core:slice", "//src/core:slice_refcount", "//src/core:status_helper", + "//src/core:subchannel_connector", "//src/core:transport_fwd", ], ) @@ -3227,58 +3234,108 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "oob_backend_metric", + srcs = [ + "//src/core:load_balancing/oob_backend_metric.cc", + ], + hdrs = [ + "//src/core:load_balancing/oob_backend_metric.h", + "//src/core:load_balancing/oob_backend_metric_internal.h", + ], + external_deps = [ + "absl/base:core_headers", + "absl/status", + "absl/strings", + "upb_base_lib", + "upb_mem_lib", + ], + language = "c++", + deps = [ + "channelz", + "debug_location", + "exec_ctx", + "gpr", + "grpc_client_channel", + "grpc_public_hdrs", + "grpc_trace", + "orphanable", + "protobuf_duration_upb", + "ref_counted_ptr", + "xds_orca_service_upb", + "xds_orca_upb", + "//src/core:backend_metric_parser", + "//src/core:client_channel_channelz", + "//src/core:closure", + "//src/core:error", + "//src/core:grpc_backend_metric_data", + "//src/core:iomgr_fwd", + "//src/core:pollset_set", + "//src/core:slice", + "//src/core:subchannel_interface", + "//src/core:time", + "//src/core:unique_type_name", + ], +) + +grpc_cc_library( + name = "lb_child_policy_handler", + srcs = [ + "//src/core:load_balancing/child_policy_handler.cc", + ], + hdrs = [ + "//src/core:load_balancing/child_policy_handler.h", + ], + external_deps = [ + "absl/status", + "absl/strings", + ], + language = "c++", + deps = [ + "config", + "debug_location", + "gpr_public_hdrs", + "grpc_public_hdrs", + "grpc_trace", + "orphanable", + "ref_counted_ptr", + "//src/core:channel_args", + "//src/core:connectivity_state", + "//src/core:delegating_helper", + "//src/core:lb_policy", + "//src/core:lb_policy_registry", + "//src/core:pollset_set", + "//src/core:resolved_address", + "//src/core:subchannel_interface", + ], +) + grpc_cc_library( name = "grpc_client_channel", srcs = [ - "//src/core:client_channel/backend_metric.cc", - "//src/core:client_channel/backup_poller.cc", "//src/core:client_channel/channel_connectivity.cc", - "//src/core:client_channel/client_channel_channelz.cc", "//src/core:client_channel/client_channel_factory.cc", "//src/core:client_channel/client_channel_filter.cc", "//src/core:client_channel/client_channel_plugin.cc", - "//src/core:client_channel/client_channel_service_config.cc", - "//src/core:client_channel/config_selector.cc", "//src/core:client_channel/dynamic_filters.cc", "//src/core:client_channel/global_subchannel_pool.cc", - "//src/core:client_channel/http_proxy_mapper.cc", "//src/core:client_channel/local_subchannel_pool.cc", "//src/core:client_channel/retry_filter.cc", "//src/core:client_channel/retry_filter_legacy_call_data.cc", - "//src/core:client_channel/retry_service_config.cc", - "//src/core:client_channel/retry_throttle.cc", - "//src/core:client_channel/service_config_channel_arg_filter.cc", "//src/core:client_channel/subchannel.cc", - "//src/core:client_channel/subchannel_pool_interface.cc", "//src/core:client_channel/subchannel_stream_client.cc", - "//src/core:load_balancing/child_policy_handler.cc", - "//src/core:load_balancing/oob_backend_metric.cc", ], hdrs = [ - "//src/core:client_channel/backend_metric.h", - "//src/core:client_channel/backup_poller.h", - "//src/core:client_channel/client_channel_channelz.h", "//src/core:client_channel/client_channel_factory.h", "//src/core:client_channel/client_channel_filter.h", - "//src/core:client_channel/client_channel_internal.h", - "//src/core:client_channel/client_channel_service_config.h", - "//src/core:client_channel/config_selector.h", - "//src/core:client_channel/connector.h", "//src/core:client_channel/dynamic_filters.h", "//src/core:client_channel/global_subchannel_pool.h", - "//src/core:client_channel/http_proxy_mapper.h", "//src/core:client_channel/local_subchannel_pool.h", "//src/core:client_channel/retry_filter.h", "//src/core:client_channel/retry_filter_legacy_call_data.h", - "//src/core:client_channel/retry_service_config.h", - "//src/core:client_channel/retry_throttle.h", "//src/core:client_channel/subchannel.h", "//src/core:client_channel/subchannel_interface_internal.h", - "//src/core:client_channel/subchannel_pool_interface.h", "//src/core:client_channel/subchannel_stream_client.h", - "//src/core:load_balancing/child_policy_handler.h", - "//src/core:load_balancing/oob_backend_metric.h", - "//src/core:load_balancing/oob_backend_metric_internal.h", ], external_deps = [ "absl/base:core_headers", @@ -3318,6 +3375,7 @@ grpc_cc_library( "http_connect_handshaker", "iomgr", "iomgr_timer", + "lb_child_policy_handler", "legacy_context", "orphanable", "parse_address", @@ -3333,12 +3391,18 @@ grpc_cc_library( "//src/core:activity", "//src/core:arena", "//src/core:arena_promise", + "//src/core:backend_metric_parser", "//src/core:cancel_callback", "//src/core:channel_args", "//src/core:channel_fwd", "//src/core:channel_init", "//src/core:channel_stack_type", + "//src/core:client_channel_backup_poller", + "//src/core:client_channel_channelz", + "//src/core:client_channel_internal_header", + "//src/core:client_channel_service_config", "//src/core:closure", + "//src/core:config_selector", "//src/core:connectivity_state", "//src/core:construct_destruct", "//src/core:context", @@ -3374,6 +3438,8 @@ grpc_cc_library( "//src/core:ref_counted", "//src/core:resolved_address", "//src/core:resource_quota", + "//src/core:retry_service_config", + "//src/core:retry_throttle", "//src/core:seq", "//src/core:service_config_parser", "//src/core:slice", @@ -3381,7 +3447,9 @@ grpc_cc_library( "//src/core:slice_refcount", "//src/core:stats_data", "//src/core:status_helper", + "//src/core:subchannel_connector", "//src/core:subchannel_interface", + "//src/core:subchannel_pool_interface", "//src/core:time", "//src/core:try_seq", "//src/core:unique_type_name", diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fd0a8bd0ad..d000e6df5ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1776,7 +1776,6 @@ endif() add_library(grpc - src/core/client_channel/backend_metric.cc src/core/client_channel/backup_poller.cc src/core/client_channel/channel_connectivity.cc src/core/client_channel/client_channel_channelz.cc @@ -1793,7 +1792,6 @@ add_library(grpc src/core/client_channel/retry_filter_legacy_call_data.cc src/core/client_channel/retry_service_config.cc src/core/client_channel/retry_throttle.cc - src/core/client_channel/service_config_channel_arg_filter.cc src/core/client_channel/subchannel.cc src/core/client_channel/subchannel_pool_interface.cc src/core/client_channel/subchannel_stream_client.cc @@ -2496,6 +2494,7 @@ add_library(grpc src/core/lib/transport/transport_op_string.cc src/core/lib/uri/uri_parser.cc src/core/load_balancing/address_filtering.cc + src/core/load_balancing/backend_metric_parser.cc src/core/load_balancing/child_policy_handler.cc src/core/load_balancing/endpoint_list.cc src/core/load_balancing/grpclb/client_load_reporting_filter.cc @@ -2544,6 +2543,7 @@ add_library(grpc src/core/resolver/xds/xds_dependency_manager.cc src/core/resolver/xds/xds_resolver.cc src/core/resolver/xds/xds_resolver_trace.cc + src/core/service_config/service_config_channel_arg_filter.cc src/core/service_config/service_config_impl.cc src/core/service_config/service_config_parser.cc src/core/tsi/alts/crypt/aes_gcm.cc @@ -2873,7 +2873,6 @@ endif() add_library(grpc_unsecure - src/core/client_channel/backend_metric.cc src/core/client_channel/backup_poller.cc src/core/client_channel/channel_connectivity.cc src/core/client_channel/client_channel_channelz.cc @@ -2890,7 +2889,6 @@ add_library(grpc_unsecure src/core/client_channel/retry_filter_legacy_call_data.cc src/core/client_channel/retry_service_config.cc src/core/client_channel/retry_throttle.cc - src/core/client_channel/service_config_channel_arg_filter.cc src/core/client_channel/subchannel.cc src/core/client_channel/subchannel_pool_interface.cc src/core/client_channel/subchannel_stream_client.cc @@ -3223,6 +3221,7 @@ add_library(grpc_unsecure src/core/lib/transport/transport_op_string.cc src/core/lib/uri/uri_parser.cc src/core/load_balancing/address_filtering.cc + src/core/load_balancing/backend_metric_parser.cc src/core/load_balancing/child_policy_handler.cc src/core/load_balancing/endpoint_list.cc src/core/load_balancing/grpclb/client_load_reporting_filter.cc @@ -3261,6 +3260,7 @@ add_library(grpc_unsecure src/core/resolver/resolver.cc src/core/resolver/resolver_registry.cc src/core/resolver/sockaddr/sockaddr_resolver.cc + src/core/service_config/service_config_channel_arg_filter.cc src/core/service_config/service_config_impl.cc src/core/service_config/service_config_parser.cc src/core/tsi/alts/handshaker/transport_security_common_api.cc diff --git a/Makefile b/Makefile index ea17f927d42..3b327e73096 100644 --- a/Makefile +++ b/Makefile @@ -958,7 +958,6 @@ endif # deps: ['upb_json_lib', 'upb_textformat_lib', 're2', 'z', 'grpc_abseil', 'cares', 'gpr', 'libssl', 'address_sorting'] # transitive_deps: ['address_sorting', 'gpr', 'grpc_abseil', 'cares', 'z', 're2', 'upb_textformat_lib', 'upb_json_lib', 'utf8_range_lib', 'upb_message_lib', 'upb_mem_lib', 'upb_base_lib', 'libssl'] LIBGRPC_SRC = \ - src/core/client_channel/backend_metric.cc \ src/core/client_channel/backup_poller.cc \ src/core/client_channel/channel_connectivity.cc \ src/core/client_channel/client_channel_channelz.cc \ @@ -975,7 +974,6 @@ LIBGRPC_SRC = \ src/core/client_channel/retry_filter_legacy_call_data.cc \ src/core/client_channel/retry_service_config.cc \ src/core/client_channel/retry_throttle.cc \ - src/core/client_channel/service_config_channel_arg_filter.cc \ src/core/client_channel/subchannel.cc \ src/core/client_channel/subchannel_pool_interface.cc \ src/core/client_channel/subchannel_stream_client.cc \ @@ -1678,6 +1676,7 @@ LIBGRPC_SRC = \ src/core/lib/transport/transport_op_string.cc \ src/core/lib/uri/uri_parser.cc \ src/core/load_balancing/address_filtering.cc \ + src/core/load_balancing/backend_metric_parser.cc \ src/core/load_balancing/child_policy_handler.cc \ src/core/load_balancing/endpoint_list.cc \ src/core/load_balancing/grpclb/client_load_reporting_filter.cc \ @@ -1726,6 +1725,7 @@ LIBGRPC_SRC = \ src/core/resolver/xds/xds_dependency_manager.cc \ src/core/resolver/xds/xds_resolver.cc \ src/core/resolver/xds/xds_resolver_trace.cc \ + src/core/service_config/service_config_channel_arg_filter.cc \ src/core/service_config/service_config_impl.cc \ src/core/service_config/service_config_parser.cc \ src/core/tsi/alts/crypt/aes_gcm.cc \ @@ -1889,7 +1889,6 @@ endif # deps: ['upb_message_lib', 'utf8_range_lib', 'z', 'grpc_abseil', 'cares', 'gpr', 'address_sorting'] # transitive_deps: ['address_sorting', 'gpr', 'grpc_abseil', 'cares', 'z', 'utf8_range_lib', 'upb_message_lib', 'upb_mem_lib', 'upb_base_lib'] LIBGRPC_UNSECURE_SRC = \ - src/core/client_channel/backend_metric.cc \ src/core/client_channel/backup_poller.cc \ src/core/client_channel/channel_connectivity.cc \ src/core/client_channel/client_channel_channelz.cc \ @@ -1906,7 +1905,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/client_channel/retry_filter_legacy_call_data.cc \ src/core/client_channel/retry_service_config.cc \ src/core/client_channel/retry_throttle.cc \ - src/core/client_channel/service_config_channel_arg_filter.cc \ src/core/client_channel/subchannel.cc \ src/core/client_channel/subchannel_pool_interface.cc \ src/core/client_channel/subchannel_stream_client.cc \ @@ -2239,6 +2237,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/transport/transport_op_string.cc \ src/core/lib/uri/uri_parser.cc \ src/core/load_balancing/address_filtering.cc \ + src/core/load_balancing/backend_metric_parser.cc \ src/core/load_balancing/child_policy_handler.cc \ src/core/load_balancing/endpoint_list.cc \ src/core/load_balancing/grpclb/client_load_reporting_filter.cc \ @@ -2277,6 +2276,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/resolver/resolver.cc \ src/core/resolver/resolver_registry.cc \ src/core/resolver/sockaddr/sockaddr_resolver.cc \ + src/core/service_config/service_config_channel_arg_filter.cc \ src/core/service_config/service_config_impl.cc \ src/core/service_config/service_config_parser.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ diff --git a/Package.swift b/Package.swift index 2eef1c50f8f..2f056910c40 100644 --- a/Package.swift +++ b/Package.swift @@ -115,8 +115,6 @@ let package = Package( "include/grpc/support/thd_id.h", "include/grpc/support/time.h", "include/grpc/support/workaround_list.h", - "src/core/client_channel/backend_metric.cc", - "src/core/client_channel/backend_metric.h", "src/core/client_channel/backup_poller.cc", "src/core/client_channel/backup_poller.h", "src/core/client_channel/channel_connectivity.cc", @@ -149,7 +147,6 @@ let package = Package( "src/core/client_channel/retry_service_config.h", "src/core/client_channel/retry_throttle.cc", "src/core/client_channel/retry_throttle.h", - "src/core/client_channel/service_config_channel_arg_filter.cc", "src/core/client_channel/subchannel.cc", "src/core/client_channel/subchannel.h", "src/core/client_channel/subchannel_interface_internal.h", @@ -1849,6 +1846,8 @@ let package = Package( "src/core/load_balancing/address_filtering.cc", "src/core/load_balancing/address_filtering.h", "src/core/load_balancing/backend_metric_data.h", + "src/core/load_balancing/backend_metric_parser.cc", + "src/core/load_balancing/backend_metric_parser.h", "src/core/load_balancing/child_policy_handler.cc", "src/core/load_balancing/child_policy_handler.h", "src/core/load_balancing/delegating_helper.h", @@ -1939,6 +1938,7 @@ let package = Package( "src/core/resolver/xds/xds_resolver_trace.h", "src/core/service_config/service_config.h", "src/core/service_config/service_config_call_data.h", + "src/core/service_config/service_config_channel_arg_filter.cc", "src/core/service_config/service_config_impl.cc", "src/core/service_config/service_config_impl.h", "src/core/service_config/service_config_parser.cc", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index dcddc032e00..aec39d0727f 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -216,7 +216,6 @@ libs: - include/grpc/support/time.h - include/grpc/support/workaround_list.h headers: - - src/core/client_channel/backend_metric.h - src/core/client_channel/backup_poller.h - src/core/client_channel/client_channel_channelz.h - src/core/client_channel/client_channel_factory.h @@ -1156,6 +1155,7 @@ libs: - src/core/lib/uri/uri_parser.h - src/core/load_balancing/address_filtering.h - src/core/load_balancing/backend_metric_data.h + - src/core/load_balancing/backend_metric_parser.h - src/core/load_balancing/child_policy_handler.h - src/core/load_balancing/delegating_helper.h - src/core/load_balancing/endpoint_list.h @@ -1232,7 +1232,6 @@ libs: - third_party/upb/upb/generated_code_support.h - third_party/xxhash/xxhash.h src: - - src/core/client_channel/backend_metric.cc - src/core/client_channel/backup_poller.cc - src/core/client_channel/channel_connectivity.cc - src/core/client_channel/client_channel_channelz.cc @@ -1249,7 +1248,6 @@ libs: - src/core/client_channel/retry_filter_legacy_call_data.cc - src/core/client_channel/retry_service_config.cc - src/core/client_channel/retry_throttle.cc - - src/core/client_channel/service_config_channel_arg_filter.cc - src/core/client_channel/subchannel.cc - src/core/client_channel/subchannel_pool_interface.cc - src/core/client_channel/subchannel_stream_client.cc @@ -1952,6 +1950,7 @@ libs: - src/core/lib/transport/transport_op_string.cc - src/core/lib/uri/uri_parser.cc - src/core/load_balancing/address_filtering.cc + - src/core/load_balancing/backend_metric_parser.cc - src/core/load_balancing/child_policy_handler.cc - src/core/load_balancing/endpoint_list.cc - src/core/load_balancing/grpclb/client_load_reporting_filter.cc @@ -2000,6 +1999,7 @@ libs: - src/core/resolver/xds/xds_dependency_manager.cc - src/core/resolver/xds/xds_resolver.cc - src/core/resolver/xds/xds_resolver_trace.cc + - src/core/service_config/service_config_channel_arg_filter.cc - src/core/service_config/service_config_impl.cc - src/core/service_config/service_config_parser.cc - src/core/tsi/alts/crypt/aes_gcm.cc @@ -2193,7 +2193,6 @@ libs: - include/grpc/support/time.h - include/grpc/support/workaround_list.h headers: - - src/core/client_channel/backend_metric.h - src/core/client_channel/backup_poller.h - src/core/client_channel/client_channel_channelz.h - src/core/client_channel/client_channel_factory.h @@ -2615,6 +2614,7 @@ libs: - src/core/lib/uri/uri_parser.h - src/core/load_balancing/address_filtering.h - src/core/load_balancing/backend_metric_data.h + - src/core/load_balancing/backend_metric_parser.h - src/core/load_balancing/child_policy_handler.h - src/core/load_balancing/delegating_helper.h - src/core/load_balancing/endpoint_list.h @@ -2681,7 +2681,6 @@ libs: - third_party/upb/upb/wire/reader.h - third_party/upb/upb/wire/types.h src: - - src/core/client_channel/backend_metric.cc - src/core/client_channel/backup_poller.cc - src/core/client_channel/channel_connectivity.cc - src/core/client_channel/client_channel_channelz.cc @@ -2698,7 +2697,6 @@ libs: - src/core/client_channel/retry_filter_legacy_call_data.cc - src/core/client_channel/retry_service_config.cc - src/core/client_channel/retry_throttle.cc - - src/core/client_channel/service_config_channel_arg_filter.cc - src/core/client_channel/subchannel.cc - src/core/client_channel/subchannel_pool_interface.cc - src/core/client_channel/subchannel_stream_client.cc @@ -3031,6 +3029,7 @@ libs: - src/core/lib/transport/transport_op_string.cc - src/core/lib/uri/uri_parser.cc - src/core/load_balancing/address_filtering.cc + - src/core/load_balancing/backend_metric_parser.cc - src/core/load_balancing/child_policy_handler.cc - src/core/load_balancing/endpoint_list.cc - src/core/load_balancing/grpclb/client_load_reporting_filter.cc @@ -3069,6 +3068,7 @@ libs: - src/core/resolver/resolver.cc - src/core/resolver/resolver_registry.cc - src/core/resolver/sockaddr/sockaddr_resolver.cc + - src/core/service_config/service_config_channel_arg_filter.cc - src/core/service_config/service_config_impl.cc - src/core/service_config/service_config_parser.cc - src/core/tsi/alts/handshaker/transport_security_common_api.cc diff --git a/config.m4 b/config.m4 index 58288e0696e..1dbc1b1e324 100644 --- a/config.m4 +++ b/config.m4 @@ -41,7 +41,6 @@ if test "$PHP_GRPC" != "no"; then PHP_SUBST(GRPC_SHARED_LIBADD) PHP_NEW_EXTENSION(grpc, - src/core/client_channel/backend_metric.cc \ src/core/client_channel/backup_poller.cc \ src/core/client_channel/channel_connectivity.cc \ src/core/client_channel/client_channel_channelz.cc \ @@ -58,7 +57,6 @@ if test "$PHP_GRPC" != "no"; then src/core/client_channel/retry_filter_legacy_call_data.cc \ src/core/client_channel/retry_service_config.cc \ src/core/client_channel/retry_throttle.cc \ - src/core/client_channel/service_config_channel_arg_filter.cc \ src/core/client_channel/subchannel.cc \ src/core/client_channel/subchannel_pool_interface.cc \ src/core/client_channel/subchannel_stream_client.cc \ @@ -806,6 +804,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/transport/transport_op_string.cc \ src/core/lib/uri/uri_parser.cc \ src/core/load_balancing/address_filtering.cc \ + src/core/load_balancing/backend_metric_parser.cc \ src/core/load_balancing/child_policy_handler.cc \ src/core/load_balancing/endpoint_list.cc \ src/core/load_balancing/grpclb/client_load_reporting_filter.cc \ @@ -854,6 +853,7 @@ if test "$PHP_GRPC" != "no"; then src/core/resolver/xds/xds_dependency_manager.cc \ src/core/resolver/xds/xds_resolver.cc \ src/core/resolver/xds/xds_resolver_trace.cc \ + src/core/service_config/service_config_channel_arg_filter.cc \ src/core/service_config/service_config_impl.cc \ src/core/service_config/service_config_parser.cc \ src/core/tsi/alts/crypt/aes_gcm.cc \ diff --git a/config.w32 b/config.w32 index 95c28ce6b99..18f0c8e8725 100644 --- a/config.w32 +++ b/config.w32 @@ -6,7 +6,6 @@ ARG_WITH("grpc", "grpc support", "no"); if (PHP_GRPC != "no") { EXTENSION("grpc", - "src\\core\\client_channel\\backend_metric.cc " + "src\\core\\client_channel\\backup_poller.cc " + "src\\core\\client_channel\\channel_connectivity.cc " + "src\\core\\client_channel\\client_channel_channelz.cc " + @@ -23,7 +22,6 @@ if (PHP_GRPC != "no") { "src\\core\\client_channel\\retry_filter_legacy_call_data.cc " + "src\\core\\client_channel\\retry_service_config.cc " + "src\\core\\client_channel\\retry_throttle.cc " + - "src\\core\\client_channel\\service_config_channel_arg_filter.cc " + "src\\core\\client_channel\\subchannel.cc " + "src\\core\\client_channel\\subchannel_pool_interface.cc " + "src\\core\\client_channel\\subchannel_stream_client.cc " + @@ -771,6 +769,7 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\transport\\transport_op_string.cc " + "src\\core\\lib\\uri\\uri_parser.cc " + "src\\core\\load_balancing\\address_filtering.cc " + + "src\\core\\load_balancing\\backend_metric_parser.cc " + "src\\core\\load_balancing\\child_policy_handler.cc " + "src\\core\\load_balancing\\endpoint_list.cc " + "src\\core\\load_balancing\\grpclb\\client_load_reporting_filter.cc " + @@ -819,6 +818,7 @@ if (PHP_GRPC != "no") { "src\\core\\resolver\\xds\\xds_dependency_manager.cc " + "src\\core\\resolver\\xds\\xds_resolver.cc " + "src\\core\\resolver\\xds\\xds_resolver_trace.cc " + + "src\\core\\service_config\\service_config_channel_arg_filter.cc " + "src\\core\\service_config\\service_config_impl.cc " + "src\\core\\service_config\\service_config_parser.cc " + "src\\core\\tsi\\alts\\crypt\\aes_gcm.cc " + diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 46b13b49118..939670687e5 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -257,8 +257,7 @@ Pod::Spec.new do |s| ss.dependency 'abseil/types/variant', abseil_version ss.dependency 'abseil/utility/utility', abseil_version - ss.source_files = 'src/core/client_channel/backend_metric.h', - 'src/core/client_channel/backup_poller.h', + ss.source_files = 'src/core/client_channel/backup_poller.h', 'src/core/client_channel/client_channel_channelz.h', 'src/core/client_channel/client_channel_factory.h', 'src/core/client_channel/client_channel_filter.h', @@ -1261,6 +1260,7 @@ Pod::Spec.new do |s| 'src/core/lib/uri/uri_parser.h', 'src/core/load_balancing/address_filtering.h', 'src/core/load_balancing/backend_metric_data.h', + 'src/core/load_balancing/backend_metric_parser.h', 'src/core/load_balancing/child_policy_handler.h', 'src/core/load_balancing/delegating_helper.h', 'src/core/load_balancing/endpoint_list.h', @@ -1531,8 +1531,7 @@ Pod::Spec.new do |s| 'third_party/zlib/zlib.h', 'third_party/zlib/zutil.h' - ss.private_header_files = 'src/core/client_channel/backend_metric.h', - 'src/core/client_channel/backup_poller.h', + ss.private_header_files = 'src/core/client_channel/backup_poller.h', 'src/core/client_channel/client_channel_channelz.h', 'src/core/client_channel/client_channel_factory.h', 'src/core/client_channel/client_channel_filter.h', @@ -2517,6 +2516,7 @@ Pod::Spec.new do |s| 'src/core/lib/uri/uri_parser.h', 'src/core/load_balancing/address_filtering.h', 'src/core/load_balancing/backend_metric_data.h', + 'src/core/load_balancing/backend_metric_parser.h', 'src/core/load_balancing/child_policy_handler.h', 'src/core/load_balancing/delegating_helper.h', 'src/core/load_balancing/endpoint_list.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index d0ce5cdcff6..f55abe72e8e 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -228,9 +228,7 @@ Pod::Spec.new do |s| ss.dependency 'abseil/utility/utility', abseil_version ss.compiler_flags = '-DBORINGSSL_PREFIX=GRPC -Wno-unreachable-code -Wno-shorten-64-to-32' - ss.source_files = 'src/core/client_channel/backend_metric.cc', - 'src/core/client_channel/backend_metric.h', - 'src/core/client_channel/backup_poller.cc', + ss.source_files = 'src/core/client_channel/backup_poller.cc', 'src/core/client_channel/backup_poller.h', 'src/core/client_channel/channel_connectivity.cc', 'src/core/client_channel/client_channel_channelz.cc', @@ -262,7 +260,6 @@ Pod::Spec.new do |s| 'src/core/client_channel/retry_service_config.h', 'src/core/client_channel/retry_throttle.cc', 'src/core/client_channel/retry_throttle.h', - 'src/core/client_channel/service_config_channel_arg_filter.cc', 'src/core/client_channel/subchannel.cc', 'src/core/client_channel/subchannel.h', 'src/core/client_channel/subchannel_interface_internal.h', @@ -1958,6 +1955,8 @@ Pod::Spec.new do |s| 'src/core/load_balancing/address_filtering.cc', 'src/core/load_balancing/address_filtering.h', 'src/core/load_balancing/backend_metric_data.h', + 'src/core/load_balancing/backend_metric_parser.cc', + 'src/core/load_balancing/backend_metric_parser.h', 'src/core/load_balancing/child_policy_handler.cc', 'src/core/load_balancing/child_policy_handler.h', 'src/core/load_balancing/delegating_helper.h', @@ -2048,6 +2047,7 @@ Pod::Spec.new do |s| 'src/core/resolver/xds/xds_resolver_trace.h', 'src/core/service_config/service_config.h', 'src/core/service_config/service_config_call_data.h', + 'src/core/service_config/service_config_channel_arg_filter.cc', 'src/core/service_config/service_config_impl.cc', 'src/core/service_config/service_config_impl.h', 'src/core/service_config/service_config_parser.cc', @@ -2330,8 +2330,7 @@ Pod::Spec.new do |s| 'third_party/zlib/zlib.h', 'third_party/zlib/zutil.c', 'third_party/zlib/zutil.h' - ss.private_header_files = 'src/core/client_channel/backend_metric.h', - 'src/core/client_channel/backup_poller.h', + ss.private_header_files = 'src/core/client_channel/backup_poller.h', 'src/core/client_channel/client_channel_channelz.h', 'src/core/client_channel/client_channel_factory.h', 'src/core/client_channel/client_channel_filter.h', @@ -3295,6 +3294,7 @@ Pod::Spec.new do |s| 'src/core/lib/uri/uri_parser.h', 'src/core/load_balancing/address_filtering.h', 'src/core/load_balancing/backend_metric_data.h', + 'src/core/load_balancing/backend_metric_parser.h', 'src/core/load_balancing/child_policy_handler.h', 'src/core/load_balancing/delegating_helper.h', 'src/core/load_balancing/endpoint_list.h', diff --git a/grpc.gemspec b/grpc.gemspec index e05517f5357..6ceb9e0e50a 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -121,8 +121,6 @@ Gem::Specification.new do |s| s.files += %w( include/grpc/support/thd_id.h ) s.files += %w( include/grpc/support/time.h ) s.files += %w( include/grpc/support/workaround_list.h ) - s.files += %w( src/core/client_channel/backend_metric.cc ) - s.files += %w( src/core/client_channel/backend_metric.h ) s.files += %w( src/core/client_channel/backup_poller.cc ) s.files += %w( src/core/client_channel/backup_poller.h ) s.files += %w( src/core/client_channel/channel_connectivity.cc ) @@ -155,7 +153,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/client_channel/retry_service_config.h ) s.files += %w( src/core/client_channel/retry_throttle.cc ) s.files += %w( src/core/client_channel/retry_throttle.h ) - s.files += %w( src/core/client_channel/service_config_channel_arg_filter.cc ) s.files += %w( src/core/client_channel/subchannel.cc ) s.files += %w( src/core/client_channel/subchannel.h ) s.files += %w( src/core/client_channel/subchannel_interface_internal.h ) @@ -1851,6 +1848,8 @@ Gem::Specification.new do |s| s.files += %w( src/core/load_balancing/address_filtering.cc ) s.files += %w( src/core/load_balancing/address_filtering.h ) s.files += %w( src/core/load_balancing/backend_metric_data.h ) + s.files += %w( src/core/load_balancing/backend_metric_parser.cc ) + s.files += %w( src/core/load_balancing/backend_metric_parser.h ) s.files += %w( src/core/load_balancing/child_policy_handler.cc ) s.files += %w( src/core/load_balancing/child_policy_handler.h ) s.files += %w( src/core/load_balancing/delegating_helper.h ) @@ -1941,6 +1940,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/resolver/xds/xds_resolver_trace.h ) s.files += %w( src/core/service_config/service_config.h ) s.files += %w( src/core/service_config/service_config_call_data.h ) + s.files += %w( src/core/service_config/service_config_channel_arg_filter.cc ) s.files += %w( src/core/service_config/service_config_impl.cc ) s.files += %w( src/core/service_config/service_config_impl.h ) s.files += %w( src/core/service_config/service_config_parser.cc ) diff --git a/grpc.gyp b/grpc.gyp index defb544f104..045162a458c 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -272,7 +272,6 @@ 'address_sorting', ], 'sources': [ - 'src/core/client_channel/backend_metric.cc', 'src/core/client_channel/backup_poller.cc', 'src/core/client_channel/channel_connectivity.cc', 'src/core/client_channel/client_channel_channelz.cc', @@ -289,7 +288,6 @@ 'src/core/client_channel/retry_filter_legacy_call_data.cc', 'src/core/client_channel/retry_service_config.cc', 'src/core/client_channel/retry_throttle.cc', - 'src/core/client_channel/service_config_channel_arg_filter.cc', 'src/core/client_channel/subchannel.cc', 'src/core/client_channel/subchannel_pool_interface.cc', 'src/core/client_channel/subchannel_stream_client.cc', @@ -992,6 +990,7 @@ 'src/core/lib/transport/transport_op_string.cc', 'src/core/lib/uri/uri_parser.cc', 'src/core/load_balancing/address_filtering.cc', + 'src/core/load_balancing/backend_metric_parser.cc', 'src/core/load_balancing/child_policy_handler.cc', 'src/core/load_balancing/endpoint_list.cc', 'src/core/load_balancing/grpclb/client_load_reporting_filter.cc', @@ -1040,6 +1039,7 @@ 'src/core/resolver/xds/xds_dependency_manager.cc', 'src/core/resolver/xds/xds_resolver.cc', 'src/core/resolver/xds/xds_resolver_trace.cc', + 'src/core/service_config/service_config_channel_arg_filter.cc', 'src/core/service_config/service_config_impl.cc', 'src/core/service_config/service_config_parser.cc', 'src/core/tsi/alts/crypt/aes_gcm.cc', @@ -1143,7 +1143,6 @@ 'address_sorting', ], 'sources': [ - 'src/core/client_channel/backend_metric.cc', 'src/core/client_channel/backup_poller.cc', 'src/core/client_channel/channel_connectivity.cc', 'src/core/client_channel/client_channel_channelz.cc', @@ -1160,7 +1159,6 @@ 'src/core/client_channel/retry_filter_legacy_call_data.cc', 'src/core/client_channel/retry_service_config.cc', 'src/core/client_channel/retry_throttle.cc', - 'src/core/client_channel/service_config_channel_arg_filter.cc', 'src/core/client_channel/subchannel.cc', 'src/core/client_channel/subchannel_pool_interface.cc', 'src/core/client_channel/subchannel_stream_client.cc', @@ -1493,6 +1491,7 @@ 'src/core/lib/transport/transport_op_string.cc', 'src/core/lib/uri/uri_parser.cc', 'src/core/load_balancing/address_filtering.cc', + 'src/core/load_balancing/backend_metric_parser.cc', 'src/core/load_balancing/child_policy_handler.cc', 'src/core/load_balancing/endpoint_list.cc', 'src/core/load_balancing/grpclb/client_load_reporting_filter.cc', @@ -1531,6 +1530,7 @@ 'src/core/resolver/resolver.cc', 'src/core/resolver/resolver_registry.cc', 'src/core/resolver/sockaddr/sockaddr_resolver.cc', + 'src/core/service_config/service_config_channel_arg_filter.cc', 'src/core/service_config/service_config_impl.cc', 'src/core/service_config/service_config_parser.cc', 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', diff --git a/package.xml b/package.xml index 11cea713fdd..27eececb580 100644 --- a/package.xml +++ b/package.xml @@ -103,8 +103,6 @@ - - @@ -137,7 +135,6 @@ - @@ -1833,6 +1830,8 @@ + + @@ -1923,6 +1922,7 @@ + diff --git a/src/core/BUILD b/src/core/BUILD index 23f5dc97499..b9fd4b05ee2 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -2977,6 +2977,266 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "client_channel_internal_header", + hdrs = [ + "client_channel/client_channel_internal.h", + ], + external_deps = [ + "absl/functional:any_invocable", + ], + language = "c++", + deps = [ + "arena", + "grpc_service_config", + "lb_policy", + "unique_type_name", + "//:gpr_public_hdrs", + "//:grpc_base", + "//:legacy_context", + ], +) + +grpc_cc_library( + name = "subchannel_connector", + hdrs = [ + "client_channel/connector.h", + ], + language = "c++", + deps = [ + "channel_args", + "closure", + "error", + "iomgr_fwd", + "resolved_address", + "time", + "//:channelz", + "//:gpr_platform", + "//:grpc_base", + "//:iomgr", + "//:orphanable", + "//:ref_counted_ptr", + ], +) + +grpc_cc_library( + name = "subchannel_pool_interface", + srcs = [ + "client_channel/subchannel_pool_interface.cc", + ], + hdrs = [ + "client_channel/subchannel_pool_interface.h", + ], + external_deps = [ + "absl/status", + "absl/status:statusor", + "absl/strings", + ], + language = "c++", + deps = [ + "channel_args", + "ref_counted", + "resolved_address", + "useful", + "//:gpr_platform", + "//:grpc_trace", + "//:ref_counted_ptr", + "//:sockaddr_utils", + ], +) + +grpc_cc_library( + name = "config_selector", + srcs = [ + "client_channel/config_selector.cc", + ], + hdrs = [ + "client_channel/config_selector.h", + ], + external_deps = [ + "absl/status", + "absl/strings", + ], + language = "c++", + deps = [ + "arena", + "channel_args", + "channel_fwd", + "client_channel_internal_header", + "grpc_service_config", + "metadata_batch", + "ref_counted", + "slice", + "useful", + "//:gpr_public_hdrs", + "//:grpc_public_hdrs", + "//:ref_counted_ptr", + ], +) + +grpc_cc_library( + name = "client_channel_service_config", + srcs = [ + "client_channel/client_channel_service_config.cc", + ], + hdrs = [ + "client_channel/client_channel_service_config.h", + ], + external_deps = [ + "absl/status", + "absl/status:statusor", + "absl/strings", + "absl/types:optional", + ], + language = "c++", + deps = [ + "channel_args", + "json", + "json_args", + "json_object_loader", + "lb_policy", + "lb_policy_registry", + "service_config_parser", + "time", + "validation_errors", + "//:config", + "//:gpr_platform", + "//:ref_counted_ptr", + ], +) + +grpc_cc_library( + name = "retry_service_config", + srcs = [ + "client_channel/retry_service_config.cc", + ], + hdrs = [ + "client_channel/retry_service_config.h", + ], + external_deps = [ + "absl/strings", + "absl/types:optional", + ], + language = "c++", + deps = [ + "channel_args", + "json", + "json_args", + "json_channel_args", + "json_object_loader", + "service_config_parser", + "time", + "validation_errors", + "//:channel_arg_names", + "//:config", + "//:gpr_public_hdrs", + "//:grpc_base", + "//:grpc_public_hdrs", + ], +) + +grpc_cc_library( + name = "retry_throttle", + srcs = [ + "client_channel/retry_throttle.cc", + ], + hdrs = [ + "client_channel/retry_throttle.h", + ], + external_deps = [ + "absl/base:core_headers", + ], + language = "c++", + deps = [ + "gpr_atm", + "ref_counted", + "//:gpr", + "//:ref_counted_ptr", + ], +) + +grpc_cc_library( + name = "client_channel_backup_poller", + srcs = [ + "client_channel/backup_poller.cc", + ], + hdrs = [ + "client_channel/backup_poller.h", + ], + external_deps = [ + "absl/status", + ], + language = "c++", + deps = [ + "closure", + "error", + "iomgr_fwd", + "pollset_set", + "time", + "//:config_vars", + "//:gpr", + "//:gpr_platform", + "//:iomgr", + "//:iomgr_timer", + ], +) + +grpc_cc_library( + name = "client_channel_channelz", + srcs = [ + "client_channel/client_channel_channelz.cc", + ], + hdrs = [ + "client_channel/client_channel_channelz.h", + ], + external_deps = [ + "absl/base:core_headers", + "absl/strings", + ], + language = "c++", + deps = [ + "connectivity_state", + "json", + "//:channelz", + "//:gpr", + "//:grpc_public_hdrs", + "//:ref_counted_ptr", + ], +) + +grpc_cc_library( + name = "service_config_channel_arg_filter", + srcs = [ + "service_config/service_config_channel_arg_filter.cc", + ], + external_deps = [ + "absl/status", + "absl/status:statusor", + "absl/types:optional", + ], + language = "c++", + deps = [ + "arena", + "arena_promise", + "channel_args", + "channel_fwd", + "channel_stack_type", + "context", + "grpc_message_size_filter", + "grpc_service_config", + "metadata_batch", + "service_config_parser", + "//:channel_arg_names", + "//:config", + "//:gpr_platform", + "//:gpr_public_hdrs", + "//:grpc_base", + "//:grpc_service_config_impl", + "//:legacy_context", + "//:ref_counted_ptr", + ], +) + grpc_cc_library( name = "lb_policy", srcs = ["load_balancing/lb_policy.cc"], @@ -3082,6 +3342,28 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "backend_metric_parser", + srcs = [ + "load_balancing/backend_metric_parser.cc", + ], + hdrs = [ + "load_balancing/backend_metric_parser.h", + ], + external_deps = [ + "absl/strings", + "upb_base_lib", + "upb_mem_lib", + "upb_message_lib", + ], + language = "c++", + deps = [ + "grpc_backend_metric_data", + "xds_orca_upb", + "//:gpr_platform", + ], +) + grpc_cc_library( name = "proxy_mapper", hdrs = ["lib/handshaker/proxy_mapper.h"], @@ -3112,6 +3394,39 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "http_proxy_mapper", + srcs = [ + "client_channel/http_proxy_mapper.cc", + ], + hdrs = [ + "client_channel/http_proxy_mapper.h", + ], + external_deps = [ + "absl/status", + "absl/status:statusor", + "absl/strings", + "absl/types:optional", + ], + language = "c++", + deps = [ + "channel_args", + "env", + "experiments", + "proxy_mapper", + "resolved_address", + "//:channel_arg_names", + "//:config", + "//:gpr", + "//:grpc_base", + "//:http_connect_handshaker", + "//:iomgr", + "//:parse_address", + "//:sockaddr_utils", + "//:uri_parser", + ], +) + grpc_cc_library( name = "grpc_server_config_selector", hdrs = [ @@ -4373,6 +4688,7 @@ grpc_cc_library( "//:grpc_resolver_fake", "//:grpc_security_base", "//:grpc_trace", + "//:lb_child_policy_handler", "//:orphanable", "//:protobuf_duration_upb", "//:protobuf_timestamp_upb", @@ -4469,6 +4785,7 @@ grpc_cc_library( "//:grpc_security_base", "//:grpc_service_config_impl", "//:grpc_trace", + "//:lb_child_policy_handler", "//:orphanable", "//:ref_counted_ptr", "//:rls_upb", @@ -4869,6 +5186,7 @@ grpc_cc_library( language = "c++", deps = [ "channel_args", + "client_channel_internal_header", "connectivity_state", "delegating_helper", "grpc_backend_metric_data", @@ -4893,6 +5211,7 @@ grpc_cc_library( "//:grpc_base", "//:grpc_client_channel", "//:grpc_trace", + "//:lb_child_policy_handler", "//:orphanable", "//:ref_counted_ptr", "//:xds_client", @@ -4913,6 +5232,7 @@ grpc_cc_library( language = "c++", deps = [ "channel_args", + "client_channel_internal_header", "connectivity_state", "delegating_helper", "grpc_resolver_xds_attributes", @@ -4934,6 +5254,7 @@ grpc_cc_library( "//:grpc_base", "//:grpc_client_channel", "//:grpc_trace", + "//:lb_child_policy_handler", "//:orphanable", "//:ref_counted_ptr", "//:work_serializer", @@ -5023,6 +5344,8 @@ grpc_cc_library( language = "c++", deps = [ "channel_args", + "client_channel_channelz", + "client_channel_internal_header", "closure", "connectivity_state", "error", @@ -5247,6 +5570,7 @@ grpc_cc_library( language = "c++", deps = [ "channel_args", + "client_channel_internal_header", "closure", "connectivity_state", "delegating_helper", @@ -5378,6 +5702,7 @@ grpc_cc_library( "//:grpc_base", "//:grpc_client_channel", "//:grpc_trace", + "//:oob_backend_metric", "//:orphanable", "//:ref_counted_ptr", "//:server_address", @@ -5445,6 +5770,7 @@ grpc_cc_library( "//:grpc_base", "//:grpc_client_channel", "//:grpc_trace", + "//:lb_child_policy_handler", "//:orphanable", "//:ref_counted_ptr", "//:sockaddr_utils", @@ -5488,6 +5814,7 @@ grpc_cc_library( "//:grpc_base", "//:grpc_client_channel", "//:grpc_trace", + "//:lb_child_policy_handler", "//:orphanable", "//:ref_counted_ptr", "//:work_serializer", @@ -5531,6 +5858,7 @@ grpc_cc_library( "//:grpc_base", "//:grpc_client_channel", "//:grpc_trace", + "//:lb_child_policy_handler", "//:orphanable", "//:ref_counted_ptr", "//:work_serializer", @@ -5558,6 +5886,7 @@ grpc_cc_library( language = "c++", deps = [ "channel_args", + "client_channel_internal_header", "closure", "connectivity_state", "delegating_helper", @@ -5587,6 +5916,7 @@ grpc_cc_library( "//:grpc_base", "//:grpc_client_channel", "//:grpc_trace", + "//:lb_child_policy_handler", "//:orphanable", "//:parse_address", "//:ref_counted_ptr", @@ -5972,6 +6302,8 @@ grpc_cc_library( "arena_promise", "channel_args", "channel_fwd", + "client_channel_internal_header", + "config_selector", "context", "dual_ref_counted", "experiments", @@ -6279,6 +6611,7 @@ grpc_cc_library( "handshaker_registry", "resolved_address", "status_helper", + "subchannel_connector", "tcp_connect_handshaker", "time", "unique_type_name", @@ -7086,6 +7419,7 @@ grpc_cc_library( "sleep", "slice", "slice_buffer", + "subchannel_connector", "time", "try_seq", "wait_for_callback", diff --git a/src/core/client_channel/client_channel_filter.cc b/src/core/client_channel/client_channel_filter.cc index fdd7a848d60..42ad79f73d5 100644 --- a/src/core/client_channel/client_channel_filter.cc +++ b/src/core/client_channel/client_channel_filter.cc @@ -49,7 +49,6 @@ #include #include -#include "src/core/client_channel/backend_metric.h" #include "src/core/client_channel/backup_poller.h" #include "src/core/client_channel/client_channel_channelz.h" #include "src/core/client_channel/client_channel_internal.h" @@ -92,8 +91,6 @@ #include "src/core/lib/promise/promise.h" #include "src/core/lib/promise/try_seq.h" #include "src/core/lib/security/credentials/credentials.h" -#include "src/core/service_config/service_config_call_data.h" -#include "src/core/service_config/service_config_impl.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/surface/call.h" @@ -101,11 +98,14 @@ #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/metadata_batch.h" +#include "src/core/load_balancing/backend_metric_parser.h" #include "src/core/load_balancing/child_policy_handler.h" #include "src/core/load_balancing/lb_policy_registry.h" #include "src/core/load_balancing/subchannel_interface.h" #include "src/core/resolver/endpoint_addresses.h" #include "src/core/resolver/resolver_registry.h" +#include "src/core/service_config/service_config_call_data.h" +#include "src/core/service_config/service_config_impl.h" // // Client channel filter diff --git a/src/core/client_channel/backend_metric.cc b/src/core/load_balancing/backend_metric_parser.cc similarity index 98% rename from src/core/client_channel/backend_metric.cc rename to src/core/load_balancing/backend_metric_parser.cc index 31423662a18..968fc287b36 100644 --- a/src/core/client_channel/backend_metric.cc +++ b/src/core/load_balancing/backend_metric_parser.cc @@ -16,7 +16,7 @@ #include -#include "src/core/client_channel/backend_metric.h" +#include "src/core/load_balancing/backend_metric_parser.h" #include diff --git a/src/core/client_channel/backend_metric.h b/src/core/load_balancing/backend_metric_parser.h similarity index 87% rename from src/core/client_channel/backend_metric.h rename to src/core/load_balancing/backend_metric_parser.h index 15670c24ca5..3ee75c9c556 100644 --- a/src/core/client_channel/backend_metric.h +++ b/src/core/load_balancing/backend_metric_parser.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef GRPC_SRC_CORE_CLIENT_CHANNEL_BACKEND_METRIC_H -#define GRPC_SRC_CORE_CLIENT_CHANNEL_BACKEND_METRIC_H +#ifndef GRPC_SRC_CORE_LOAD_BALANCING_BACKEND_METRIC_PARSER_H +#define GRPC_SRC_CORE_LOAD_BALANCING_BACKEND_METRIC_PARSER_H #include @@ -44,4 +44,4 @@ const BackendMetricData* ParseBackendMetricData( } // namespace grpc_core -#endif // GRPC_SRC_CORE_CLIENT_CHANNEL_BACKEND_METRIC_H +#endif // GRPC_SRC_CORE_LOAD_BALANCING_BACKEND_METRIC_PARSER_H diff --git a/src/core/load_balancing/oob_backend_metric.cc b/src/core/load_balancing/oob_backend_metric.cc index ac7bcb36154..9156c7aa4e6 100644 --- a/src/core/load_balancing/oob_backend_metric.cc +++ b/src/core/load_balancing/oob_backend_metric.cc @@ -38,9 +38,7 @@ #include #include -#include "src/core/client_channel/backend_metric.h" #include "src/core/client_channel/client_channel_channelz.h" -#include "src/core/load_balancing/oob_backend_metric_internal.h" #include "src/core/client_channel/subchannel.h" #include "src/core/client_channel/subchannel_stream_client.h" #include "src/core/lib/channel/channel_trace.h" @@ -57,6 +55,8 @@ #include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/slice/slice.h" +#include "src/core/load_balancing/backend_metric_parser.h" +#include "src/core/load_balancing/oob_backend_metric_internal.h" namespace grpc_core { diff --git a/src/core/load_balancing/oob_backend_metric.h b/src/core/load_balancing/oob_backend_metric.h index b31a4c748cb..b90e12889c9 100644 --- a/src/core/load_balancing/oob_backend_metric.h +++ b/src/core/load_balancing/oob_backend_metric.h @@ -21,8 +21,8 @@ #include -#include "src/core/load_balancing/backend_metric_data.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/load_balancing/backend_metric_data.h" #include "src/core/load_balancing/subchannel_interface.h" namespace grpc_core { diff --git a/src/core/client_channel/service_config_channel_arg_filter.cc b/src/core/service_config/service_config_channel_arg_filter.cc similarity index 100% rename from src/core/client_channel/service_config_channel_arg_filter.cc rename to src/core/service_config/service_config_channel_arg_filter.cc diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index f0827017e9f..78472d72eb9 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -15,7 +15,6 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_core_dependencies.py.template`!!! CORE_SOURCE_FILES = [ - 'src/core/client_channel/backend_metric.cc', 'src/core/client_channel/backup_poller.cc', 'src/core/client_channel/channel_connectivity.cc', 'src/core/client_channel/client_channel_channelz.cc', @@ -32,7 +31,6 @@ CORE_SOURCE_FILES = [ 'src/core/client_channel/retry_filter_legacy_call_data.cc', 'src/core/client_channel/retry_service_config.cc', 'src/core/client_channel/retry_throttle.cc', - 'src/core/client_channel/service_config_channel_arg_filter.cc', 'src/core/client_channel/subchannel.cc', 'src/core/client_channel/subchannel_pool_interface.cc', 'src/core/client_channel/subchannel_stream_client.cc', @@ -780,6 +778,7 @@ CORE_SOURCE_FILES = [ 'src/core/lib/transport/transport_op_string.cc', 'src/core/lib/uri/uri_parser.cc', 'src/core/load_balancing/address_filtering.cc', + 'src/core/load_balancing/backend_metric_parser.cc', 'src/core/load_balancing/child_policy_handler.cc', 'src/core/load_balancing/endpoint_list.cc', 'src/core/load_balancing/grpclb/client_load_reporting_filter.cc', @@ -828,6 +827,7 @@ CORE_SOURCE_FILES = [ 'src/core/resolver/xds/xds_dependency_manager.cc', 'src/core/resolver/xds/xds_resolver.cc', 'src/core/resolver/xds/xds_resolver_trace.cc', + 'src/core/service_config/service_config_channel_arg_filter.cc', 'src/core/service_config/service_config_impl.cc', 'src/core/service_config/service_config_parser.cc', 'src/core/tsi/alts/crypt/aes_gcm.cc', diff --git a/test/core/client_channel/BUILD b/test/core/client_channel/BUILD index 48c8d7295d2..db32f642365 100644 --- a/test/core/client_channel/BUILD +++ b/test/core/client_channel/BUILD @@ -28,6 +28,7 @@ grpc_cc_test( deps = [ "//:grpc_client_channel", "//src/core:channel_args", + "//src/core:subchannel_pool_interface", "//test/core/util:grpc_test_util", ], ) diff --git a/test/core/client_channel/lb_policy/BUILD b/test/core/client_channel/lb_policy/BUILD index ca181c2b2e8..d0422a50a40 100644 --- a/test/core/client_channel/lb_policy/BUILD +++ b/test/core/client_channel/lb_policy/BUILD @@ -32,8 +32,11 @@ grpc_cc_library( ], language = "C++", deps = [ + "//:oob_backend_metric", + "//src/core:client_channel_internal_header", "//src/core:lb_policy", "//src/core:subchannel_interface", + "//src/core:subchannel_pool_interface", "//test/core/event_engine:event_engine_test_utils", "//test/core/event_engine/fuzzing_event_engine", ], @@ -127,6 +130,7 @@ grpc_cc_test( uses_polling = False, deps = [ "//:grpc", + "//src/core:client_channel_service_config", "//test/core/util:grpc_test_util", ], ) diff --git a/test/core/util/BUILD b/test/core/util/BUILD index e902bd2def0..2de9ece5fff 100644 --- a/test/core/util/BUILD +++ b/test/core/util/BUILD @@ -311,6 +311,7 @@ grpc_cc_library( "//:gpr", "//:grpc", "//:grpc_client_channel", + "//:oob_backend_metric", "//:orphanable", "//:parse_address", "//:ref_counted_ptr", diff --git a/test/cpp/end2end/BUILD b/test/cpp/end2end/BUILD index b69adaf4654..c06aafc882e 100644 --- a/test/cpp/end2end/BUILD +++ b/test/cpp/end2end/BUILD @@ -532,6 +532,7 @@ grpc_cc_test( "//:grpcpp_call_metric_recorder", "//:grpcpp_orca_service", "//src/core:channel_args", + "//src/core:config_selector", "//src/proto/grpc/health/v1:health_proto", "//src/proto/grpc/testing:echo_messages_proto", "//src/proto/grpc/testing:echo_proto", diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index f92d69c3080..c197f62a38a 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1081,8 +1081,6 @@ include/grpcpp/support/time.h \ include/grpcpp/support/validate_service_config.h \ include/grpcpp/version_info.h \ include/grpcpp/xds_server_builder.h \ -src/core/client_channel/backend_metric.cc \ -src/core/client_channel/backend_metric.h \ src/core/client_channel/backup_poller.cc \ src/core/client_channel/backup_poller.h \ src/core/client_channel/channel_connectivity.cc \ @@ -1115,7 +1113,6 @@ src/core/client_channel/retry_service_config.cc \ src/core/client_channel/retry_service_config.h \ src/core/client_channel/retry_throttle.cc \ src/core/client_channel/retry_throttle.h \ -src/core/client_channel/service_config_channel_arg_filter.cc \ src/core/client_channel/subchannel.cc \ src/core/client_channel/subchannel.h \ src/core/client_channel/subchannel_interface_internal.h \ @@ -2850,6 +2847,8 @@ src/core/lib/uri/uri_parser.h \ src/core/load_balancing/address_filtering.cc \ src/core/load_balancing/address_filtering.h \ src/core/load_balancing/backend_metric_data.h \ +src/core/load_balancing/backend_metric_parser.cc \ +src/core/load_balancing/backend_metric_parser.h \ src/core/load_balancing/child_policy_handler.cc \ src/core/load_balancing/child_policy_handler.h \ src/core/load_balancing/delegating_helper.h \ @@ -2940,6 +2939,7 @@ src/core/resolver/xds/xds_resolver_trace.cc \ src/core/resolver/xds/xds_resolver_trace.h \ src/core/service_config/service_config.h \ src/core/service_config/service_config_call_data.h \ +src/core/service_config/service_config_channel_arg_filter.cc \ src/core/service_config/service_config_impl.cc \ src/core/service_config/service_config_impl.h \ src/core/service_config/service_config_parser.cc \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 03621790ee7..8b61684a971 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -885,8 +885,6 @@ include/grpc/support/time.h \ include/grpc/support/workaround_list.h \ src/core/README.md \ src/core/client_channel/README.md \ -src/core/client_channel/backend_metric.cc \ -src/core/client_channel/backend_metric.h \ src/core/client_channel/backup_poller.cc \ src/core/client_channel/backup_poller.h \ src/core/client_channel/channel_connectivity.cc \ @@ -919,7 +917,6 @@ src/core/client_channel/retry_service_config.cc \ src/core/client_channel/retry_service_config.h \ src/core/client_channel/retry_throttle.cc \ src/core/client_channel/retry_throttle.h \ -src/core/client_channel/service_config_channel_arg_filter.cc \ src/core/client_channel/subchannel.cc \ src/core/client_channel/subchannel.h \ src/core/client_channel/subchannel_interface_internal.h \ @@ -2627,6 +2624,8 @@ src/core/lib/uri/uri_parser.h \ src/core/load_balancing/address_filtering.cc \ src/core/load_balancing/address_filtering.h \ src/core/load_balancing/backend_metric_data.h \ +src/core/load_balancing/backend_metric_parser.cc \ +src/core/load_balancing/backend_metric_parser.h \ src/core/load_balancing/child_policy_handler.cc \ src/core/load_balancing/child_policy_handler.h \ src/core/load_balancing/delegating_helper.h \ @@ -2721,6 +2720,7 @@ src/core/resolver/xds/xds_resolver_trace.cc \ src/core/resolver/xds/xds_resolver_trace.h \ src/core/service_config/service_config.h \ src/core/service_config/service_config_call_data.h \ +src/core/service_config/service_config_channel_arg_filter.cc \ src/core/service_config/service_config_impl.cc \ src/core/service_config/service_config_impl.h \ src/core/service_config/service_config_parser.cc \