client channel: create a header file for internal interfaces (#32423)

This is just a bit of a code reorganization, no functional changes.
pull/32451/head
Mark D. Roth 2 years ago committed by GitHub
parent 50e6af14ff
commit 3faeb3af80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      BUILD
  2. 4
      build_autogenerated.yaml
  3. 4
      gRPC-C++.podspec
  4. 4
      gRPC-Core.podspec
  5. 2
      grpc.gemspec
  6. 2
      package.xml
  7. 22
      src/core/ext/filters/client_channel/client_channel.cc
  8. 85
      src/core/ext/filters/client_channel/client_channel.h
  9. 114
      src/core/ext/filters/client_channel/client_channel_internal.h
  10. 39
      src/core/ext/filters/client_channel/lb_call_state_internal.h
  11. 5
      src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
  12. 5
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
  13. 4
      src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc
  14. 1
      src/core/ext/filters/client_channel/retry_filter.cc
  15. 4
      test/core/client_channel/lb_policy/lb_policy_test_lib.h
  16. 2
      tools/doxygen/Doxyfile.c++.internal
  17. 2
      tools/doxygen/Doxyfile.core.internal

@ -2769,6 +2769,7 @@ grpc_cc_library(
"//src/core:ext/filters/client_channel/client_channel.h",
"//src/core:ext/filters/client_channel/client_channel_channelz.h",
"//src/core:ext/filters/client_channel/client_channel_factory.h",
"//src/core:ext/filters/client_channel/client_channel_internal.h",
"//src/core:ext/filters/client_channel/client_channel_service_config.h",
"//src/core:ext/filters/client_channel/config_selector.h",
"//src/core:ext/filters/client_channel/connector.h",
@ -2776,7 +2777,6 @@ grpc_cc_library(
"//src/core:ext/filters/client_channel/global_subchannel_pool.h",
"//src/core:ext/filters/client_channel/health/health_check_client.h",
"//src/core:ext/filters/client_channel/http_proxy.h",
"//src/core:ext/filters/client_channel/lb_call_state_internal.h",
"//src/core:ext/filters/client_channel/lb_policy/child_policy_handler.h",
"//src/core:ext/filters/client_channel/lb_policy/oob_backend_metric.h",
"//src/core:ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h",

@ -335,6 +335,7 @@ libs:
- src/core/ext/filters/client_channel/client_channel.h
- src/core/ext/filters/client_channel/client_channel_channelz.h
- src/core/ext/filters/client_channel/client_channel_factory.h
- src/core/ext/filters/client_channel/client_channel_internal.h
- src/core/ext/filters/client_channel/client_channel_service_config.h
- src/core/ext/filters/client_channel/config_selector.h
- src/core/ext/filters/client_channel/connector.h
@ -342,7 +343,6 @@ libs:
- src/core/ext/filters/client_channel/global_subchannel_pool.h
- src/core/ext/filters/client_channel/health/health_check_client.h
- src/core/ext/filters/client_channel/http_proxy.h
- src/core/ext/filters/client_channel/lb_call_state_internal.h
- src/core/ext/filters/client_channel/lb_policy/address_filtering.h
- src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h
- src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h
@ -2005,6 +2005,7 @@ libs:
- src/core/ext/filters/client_channel/client_channel.h
- src/core/ext/filters/client_channel/client_channel_channelz.h
- src/core/ext/filters/client_channel/client_channel_factory.h
- src/core/ext/filters/client_channel/client_channel_internal.h
- src/core/ext/filters/client_channel/client_channel_service_config.h
- src/core/ext/filters/client_channel/config_selector.h
- src/core/ext/filters/client_channel/connector.h
@ -2012,7 +2013,6 @@ libs:
- src/core/ext/filters/client_channel/global_subchannel_pool.h
- src/core/ext/filters/client_channel/health/health_check_client.h
- src/core/ext/filters/client_channel/http_proxy.h
- src/core/ext/filters/client_channel/lb_call_state_internal.h
- src/core/ext/filters/client_channel/lb_policy/address_filtering.h
- src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h
- src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h

4
gRPC-C++.podspec generated

@ -248,6 +248,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/filters/client_channel/client_channel_channelz.h',
'src/core/ext/filters/client_channel/client_channel_factory.h',
'src/core/ext/filters/client_channel/client_channel_internal.h',
'src/core/ext/filters/client_channel/client_channel_service_config.h',
'src/core/ext/filters/client_channel/config_selector.h',
'src/core/ext/filters/client_channel/connector.h',
@ -255,7 +256,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/global_subchannel_pool.h',
'src/core/ext/filters/client_channel/health/health_check_client.h',
'src/core/ext/filters/client_channel/http_proxy.h',
'src/core/ext/filters/client_channel/lb_call_state_internal.h',
'src/core/ext/filters/client_channel/lb_policy/address_filtering.h',
'src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h',
'src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h',
@ -1199,6 +1199,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/filters/client_channel/client_channel_channelz.h',
'src/core/ext/filters/client_channel/client_channel_factory.h',
'src/core/ext/filters/client_channel/client_channel_internal.h',
'src/core/ext/filters/client_channel/client_channel_service_config.h',
'src/core/ext/filters/client_channel/config_selector.h',
'src/core/ext/filters/client_channel/connector.h',
@ -1206,7 +1207,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/global_subchannel_pool.h',
'src/core/ext/filters/client_channel/health/health_check_client.h',
'src/core/ext/filters/client_channel/http_proxy.h',
'src/core/ext/filters/client_channel/lb_call_state_internal.h',
'src/core/ext/filters/client_channel/lb_policy/address_filtering.h',
'src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h',
'src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h',

4
gRPC-Core.podspec generated

@ -225,6 +225,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/client_channel_channelz.h',
'src/core/ext/filters/client_channel/client_channel_factory.cc',
'src/core/ext/filters/client_channel/client_channel_factory.h',
'src/core/ext/filters/client_channel/client_channel_internal.h',
'src/core/ext/filters/client_channel/client_channel_plugin.cc',
'src/core/ext/filters/client_channel/client_channel_service_config.cc',
'src/core/ext/filters/client_channel/client_channel_service_config.h',
@ -239,7 +240,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/health/health_check_client.h',
'src/core/ext/filters/client_channel/http_proxy.cc',
'src/core/ext/filters/client_channel/http_proxy.h',
'src/core/ext/filters/client_channel/lb_call_state_internal.h',
'src/core/ext/filters/client_channel/lb_policy/address_filtering.cc',
'src/core/ext/filters/client_channel/lb_policy/address_filtering.h',
'src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h',
@ -1905,6 +1905,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/filters/client_channel/client_channel_channelz.h',
'src/core/ext/filters/client_channel/client_channel_factory.h',
'src/core/ext/filters/client_channel/client_channel_internal.h',
'src/core/ext/filters/client_channel/client_channel_service_config.h',
'src/core/ext/filters/client_channel/config_selector.h',
'src/core/ext/filters/client_channel/connector.h',
@ -1912,7 +1913,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/global_subchannel_pool.h',
'src/core/ext/filters/client_channel/health/health_check_client.h',
'src/core/ext/filters/client_channel/http_proxy.h',
'src/core/ext/filters/client_channel/lb_call_state_internal.h',
'src/core/ext/filters/client_channel/lb_policy/address_filtering.h',
'src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h',
'src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h',

2
grpc.gemspec generated

@ -134,6 +134,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/client_channel_channelz.h )
s.files += %w( src/core/ext/filters/client_channel/client_channel_factory.cc )
s.files += %w( src/core/ext/filters/client_channel/client_channel_factory.h )
s.files += %w( src/core/ext/filters/client_channel/client_channel_internal.h )
s.files += %w( src/core/ext/filters/client_channel/client_channel_plugin.cc )
s.files += %w( src/core/ext/filters/client_channel/client_channel_service_config.cc )
s.files += %w( src/core/ext/filters/client_channel/client_channel_service_config.h )
@ -148,7 +149,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/health/health_check_client.h )
s.files += %w( src/core/ext/filters/client_channel/http_proxy.cc )
s.files += %w( src/core/ext/filters/client_channel/http_proxy.h )
s.files += %w( src/core/ext/filters/client_channel/lb_call_state_internal.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/address_filtering.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/address_filtering.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h )

2
package.xml generated

@ -116,6 +116,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel_channelz.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel_factory.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel_internal.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel_plugin.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel_service_config.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/client_channel_service_config.h" role="src" />
@ -130,7 +131,6 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/health/health_check_client.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/http_proxy.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/http_proxy.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_call_state_internal.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/address_filtering.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/address_filtering.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h" role="src" />

@ -25,6 +25,7 @@
#include <functional>
#include <new>
#include <type_traits>
#include <utility>
#include <vector>
#include "absl/cleanup/cleanup.h"
@ -48,6 +49,7 @@
#include "src/core/ext/filters/client_channel/backend_metric.h"
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/ext/filters/client_channel/client_channel_channelz.h"
#include "src/core/ext/filters/client_channel/client_channel_internal.h"
#include "src/core/ext/filters/client_channel/client_channel_service_config.h"
#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/dynamic_filters.h"
@ -68,6 +70,7 @@
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/gprpp/work_serializer.h"
#include "src/core/lib/handshaker/proxy_mapper_registry.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@ -2341,6 +2344,25 @@ void ClientChannel::FilterBasedCallData::
error);
}
//
// ClientChannel::LoadBalancedCall::LbCallState
//
class ClientChannel::LoadBalancedCall::LbCallState
: public ClientChannelLbCallState {
public:
explicit LbCallState(LoadBalancedCall* lb_call) : lb_call_(lb_call) {}
void* Alloc(size_t size) override { return lb_call_->arena()->Alloc(size); }
// Internal API to allow first-party LB policies to access per-call
// attributes set by the ConfigSelector.
absl::string_view GetCallAttribute(UniqueTypeName type) override;
private:
LoadBalancedCall* lb_call_;
};
//
// ClientChannel::LoadBalancedCall::Metadata
//

@ -25,7 +25,6 @@
#include <map>
#include <memory>
#include <string>
#include <utility>
#include "absl/base/thread_annotations.h"
#include "absl/container/flat_hash_set.h"
@ -40,7 +39,6 @@
#include "src/core/ext/filters/client_channel/client_channel_factory.h"
#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/dynamic_filters.h"
#include "src/core/ext/filters/client_channel/lb_call_state_internal.h"
#include "src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h"
#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/ext/filters/client_channel/subchannel_pool_interface.h"
@ -56,7 +54,6 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/gprpp/work_serializer.h"
#include "src/core/lib/iomgr/call_combiner.h"
#include "src/core/lib/iomgr/closure.h"
@ -67,8 +64,6 @@
#include "src/core/lib/resolver/resolver.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/service_config/service_config.h"
#include "src/core/lib/service_config/service_config_call_data.h"
#include "src/core/lib/service_config/service_config_parser.h"
#include "src/core/lib/slice/slice_buffer.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/connectivity_state.h"
@ -372,21 +367,6 @@ class ClientChannel {
class ClientChannel::LoadBalancedCall
: public InternallyRefCounted<LoadBalancedCall, kUnrefCallDtor> {
public:
// TODO(roth): Make this private.
class LbCallState : public LbCallStateInternal {
public:
explicit LbCallState(LoadBalancedCall* lb_call) : lb_call_(lb_call) {}
void* Alloc(size_t size) override { return lb_call_->arena()->Alloc(size); }
// Internal API to allow first-party LB policies to access per-call
// attributes set by the ConfigSelector.
absl::string_view GetCallAttribute(UniqueTypeName type) override;
private:
LoadBalancedCall* lb_call_;
};
LoadBalancedCall(
ClientChannel* chand, grpc_call_context_element* call_context,
ConfigSelector::CallDispatchController* call_dispatch_controller,
@ -439,6 +419,7 @@ class ClientChannel::LoadBalancedCall
absl::string_view peer_address);
private:
class LbCallState;
class Metadata;
class BackendMetricAccessor;
@ -612,70 +593,6 @@ class ClientChannel::FilterBasedLoadBalancedCall
grpc_transport_stream_op_batch* pending_batches_[MAX_PENDING_BATCHES] = {};
};
// A sub-class of ServiceConfigCallData used to access the
// CallDispatchController. Allocated on the arena, stored in the call
// context, and destroyed when the call is destroyed.
// TODO(roth): Combine this with lb_call_state_internal.h.
class ClientChannelServiceConfigCallData : public ServiceConfigCallData {
public:
ClientChannelServiceConfigCallData(
RefCountedPtr<ServiceConfig> service_config,
const ServiceConfigParser::ParsedConfigVector* method_configs,
ServiceConfigCallData::CallAttributes call_attributes,
ConfigSelector::CallDispatchController* call_dispatch_controller,
grpc_call_context_element* call_context)
: ServiceConfigCallData(std::move(service_config), method_configs,
std::move(call_attributes)),
call_dispatch_controller_(call_dispatch_controller) {
call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = this;
call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].destroy = Destroy;
}
ConfigSelector::CallDispatchController* call_dispatch_controller() {
return &call_dispatch_controller_;
}
private:
// A wrapper for the CallDispatchController returned by the ConfigSelector.
// Handles the case where the ConfigSelector doees not return any
// CallDispatchController.
// Also ensures that we call Commit() at most once, which allows the
// client channel code to call Commit() when the call is complete in case
// it wasn't called earlier, without needing to know whether or not it was.
class CallDispatchControllerWrapper
: public ConfigSelector::CallDispatchController {
public:
explicit CallDispatchControllerWrapper(
ConfigSelector::CallDispatchController* call_dispatch_controller)
: call_dispatch_controller_(call_dispatch_controller) {}
bool ShouldRetry() override {
if (call_dispatch_controller_ != nullptr) {
return call_dispatch_controller_->ShouldRetry();
}
return true;
}
void Commit() override {
if (call_dispatch_controller_ != nullptr && !commit_called_) {
call_dispatch_controller_->Commit();
commit_called_ = true;
}
}
private:
ConfigSelector::CallDispatchController* call_dispatch_controller_;
bool commit_called_ = false;
};
static void Destroy(void* ptr) {
auto* self = static_cast<ClientChannelServiceConfigCallData*>(ptr);
self->~ClientChannelServiceConfigCallData();
}
CallDispatchControllerWrapper call_dispatch_controller_;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H

@ -0,0 +1,114 @@
//
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_INTERNAL_H
#define GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_INTERNAL_H
#include <grpc/support/port_platform.h>
#include <utility>
#include "absl/strings/string_view.h"
#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/load_balancing/lb_policy.h"
#include "src/core/lib/service_config/service_config.h"
#include "src/core/lib/service_config/service_config_call_data.h"
#include "src/core/lib/service_config/service_config_parser.h"
//
// This file contains internal interfaces used to allow various plugins
// (filters, LB policies, etc) to access internal data provided by the
// ClientChannel that is not normally accessible via external APIs.
//
namespace grpc_core {
// Internal type for LB call state interface. Provides an interface for
// LB policies to access internal call attributes.
class ClientChannelLbCallState : public LoadBalancingPolicy::CallState {
public:
virtual absl::string_view GetCallAttribute(UniqueTypeName type) = 0;
};
// Internal type for ServiceConfigCallData. Provides access to the
// CallDispatchController.
class ClientChannelServiceConfigCallData : public ServiceConfigCallData {
public:
ClientChannelServiceConfigCallData(
RefCountedPtr<ServiceConfig> service_config,
const ServiceConfigParser::ParsedConfigVector* method_configs,
ServiceConfigCallData::CallAttributes call_attributes,
ConfigSelector::CallDispatchController* call_dispatch_controller,
grpc_call_context_element* call_context)
: ServiceConfigCallData(std::move(service_config), method_configs,
std::move(call_attributes)),
call_dispatch_controller_(call_dispatch_controller) {
call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = this;
call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].destroy = Destroy;
}
ConfigSelector::CallDispatchController* call_dispatch_controller() {
return &call_dispatch_controller_;
}
private:
// A wrapper for the CallDispatchController returned by the ConfigSelector.
// Handles the case where the ConfigSelector doees not return any
// CallDispatchController.
// Also ensures that we call Commit() at most once, which allows the
// client channel code to call Commit() when the call is complete in case
// it wasn't called earlier, without needing to know whether or not it was.
class CallDispatchControllerWrapper
: public ConfigSelector::CallDispatchController {
public:
explicit CallDispatchControllerWrapper(
ConfigSelector::CallDispatchController* call_dispatch_controller)
: call_dispatch_controller_(call_dispatch_controller) {}
bool ShouldRetry() override {
if (call_dispatch_controller_ != nullptr) {
return call_dispatch_controller_->ShouldRetry();
}
return true;
}
void Commit() override {
if (call_dispatch_controller_ != nullptr && !commit_called_) {
call_dispatch_controller_->Commit();
commit_called_ = true;
}
}
private:
ConfigSelector::CallDispatchController* call_dispatch_controller_;
bool commit_called_ = false;
};
static void Destroy(void* ptr) {
auto* self = static_cast<ClientChannelServiceConfigCallData*>(ptr);
self->~ClientChannelServiceConfigCallData();
}
CallDispatchControllerWrapper call_dispatch_controller_;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_INTERNAL_H

@ -1,39 +0,0 @@
//
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_CALL_STATE_INTERNAL_H
#define GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_CALL_STATE_INTERNAL_H
#include <grpc/support/port_platform.h>
#include "absl/strings/string_view.h"
#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/load_balancing/lb_policy.h"
namespace grpc_core {
//
// LbCallStateInternal
//
class LbCallStateInternal : public LoadBalancingPolicy::CallState {
public:
virtual absl::string_view GetCallAttribute(UniqueTypeName type) = 0;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_CALL_STATE_INTERNAL_H

@ -44,7 +44,7 @@
#include <grpc/impl/connectivity_state.h>
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/client_channel_internal.h"
#include "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
@ -340,8 +340,7 @@ class RingHash : public LoadBalancingPolicy {
//
RingHash::PickResult RingHash::Picker::Pick(PickArgs args) {
auto* call_state = static_cast<ClientChannel::LoadBalancedCall::LbCallState*>(
args.call_state);
auto* call_state = static_cast<ClientChannelLbCallState*>(args.call_state);
auto hash = call_state->GetCallAttribute(RequestHashAttributeName());
uint64_t h;
if (!absl::SimpleAtoi(hash, &h)) {

@ -37,7 +37,7 @@
#include <grpc/impl/connectivity_state.h>
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/client_channel_internal.h"
#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
#include "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h"
#include "src/core/lib/channel/channel_args.h"
@ -229,8 +229,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
XdsClusterManagerLb::PickResult XdsClusterManagerLb::ClusterPicker::Pick(
PickArgs args) {
auto* call_state = static_cast<ClientChannel::LoadBalancedCall::LbCallState*>(
args.call_state);
auto* call_state = static_cast<ClientChannelLbCallState*>(args.call_state);
auto cluster_name =
call_state->GetCallAttribute(XdsClusterAttributeTypeName());
auto it = cluster_map_.find(std::string(cluster_name));

@ -43,7 +43,7 @@
#include <grpc/impl/connectivity_state.h>
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/lb_call_state_internal.h"
#include "src/core/ext/filters/client_channel/client_channel_internal.h"
#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
#include "src/core/ext/filters/stateful_session/stateful_session_filter.h"
#include "src/core/ext/xds/xds_health_status.h"
@ -369,7 +369,7 @@ XdsOverrideHostLb::Picker::PickOverridenHost(absl::string_view override_host) {
LoadBalancingPolicy::PickResult XdsOverrideHostLb::Picker::Pick(
LoadBalancingPolicy::PickArgs args) {
auto* call_state = static_cast<LbCallStateInternal*>(args.call_state);
auto* call_state = static_cast<ClientChannelLbCallState*>(args.call_state);
auto override_host = call_state->GetCallAttribute(XdsOverrideHostTypeName());
auto overridden_host_pick = PickOverridenHost(override_host);
if (overridden_host_pick.has_value()) {

@ -42,6 +42,7 @@
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/client_channel_internal.h"
#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/retry_service_config.h"
#include "src/core/ext/filters/client_channel/retry_throttle.h"

@ -51,7 +51,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/lb_call_state_internal.h"
#include "src/core/ext/filters/client_channel/client_channel_internal.h"
#include "src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h"
#include "src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h"
#include "src/core/ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h"
@ -462,7 +462,7 @@ class LoadBalancingPolicyTest : public ::testing::Test {
};
// A fake CallState implementation, for use in PickArgs.
class FakeCallState : public LbCallStateInternal {
class FakeCallState : public ClientChannelLbCallState {
public:
explicit FakeCallState(
const std::map<UniqueTypeName, absl::string_view>& attributes) {

@ -1091,6 +1091,7 @@ src/core/ext/filters/client_channel/client_channel_channelz.cc \
src/core/ext/filters/client_channel/client_channel_channelz.h \
src/core/ext/filters/client_channel/client_channel_factory.cc \
src/core/ext/filters/client_channel/client_channel_factory.h \
src/core/ext/filters/client_channel/client_channel_internal.h \
src/core/ext/filters/client_channel/client_channel_plugin.cc \
src/core/ext/filters/client_channel/client_channel_service_config.cc \
src/core/ext/filters/client_channel/client_channel_service_config.h \
@ -1105,7 +1106,6 @@ src/core/ext/filters/client_channel/health/health_check_client.cc \
src/core/ext/filters/client_channel/health/health_check_client.h \
src/core/ext/filters/client_channel/http_proxy.cc \
src/core/ext/filters/client_channel/http_proxy.h \
src/core/ext/filters/client_channel/lb_call_state_internal.h \
src/core/ext/filters/client_channel/lb_policy/address_filtering.cc \
src/core/ext/filters/client_channel/lb_policy/address_filtering.h \
src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h \

@ -897,6 +897,7 @@ src/core/ext/filters/client_channel/client_channel_channelz.cc \
src/core/ext/filters/client_channel/client_channel_channelz.h \
src/core/ext/filters/client_channel/client_channel_factory.cc \
src/core/ext/filters/client_channel/client_channel_factory.h \
src/core/ext/filters/client_channel/client_channel_internal.h \
src/core/ext/filters/client_channel/client_channel_plugin.cc \
src/core/ext/filters/client_channel/client_channel_service_config.cc \
src/core/ext/filters/client_channel/client_channel_service_config.h \
@ -911,7 +912,6 @@ src/core/ext/filters/client_channel/health/health_check_client.cc \
src/core/ext/filters/client_channel/health/health_check_client.h \
src/core/ext/filters/client_channel/http_proxy.cc \
src/core/ext/filters/client_channel/http_proxy.h \
src/core/ext/filters/client_channel/lb_call_state_internal.h \
src/core/ext/filters/client_channel/lb_policy/address_filtering.cc \
src/core/ext/filters/client_channel/lb_policy/address_filtering.h \
src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h \

Loading…
Cancel
Save