Go to the documentation of this file.
25 #include "absl/status/status.h"
26 #include "absl/strings/str_cat.h"
27 #include "absl/strings/string_view.h"
55 if (
parent_->shutting_down_)
return nullptr;
57 return parent_->channel_control_helper()->CreateSubchannel(
62 std::unique_ptr<SubchannelPicker> picker)
override {
63 if (
parent_->shutting_down_)
return;
70 "[child_policy_handler %p] helper %p: pending child policy %p "
71 "reports state=%s (%s)",
77 parent_->child_policy_->interested_parties(),
89 if (
parent_->shutting_down_)
return;
94 parent_->pending_child_policy_ !=
nullptr
95 ?
parent_->pending_child_policy_.get()
97 if (
child_ != latest_child_policy)
return;
99 gpr_log(
GPR_INFO,
"[child_policy_handler %p] started name re-resolving",
102 parent_->channel_control_helper()->RequestReresolution();
106 return parent_->channel_control_helper()->GetAuthority();
111 if (
parent_->shutting_down_)
return;
144 gpr_log(
GPR_INFO,
"[child_policy_handler %p] shutting down lb_policy %p",
154 "[child_policy_handler %p] shutting down pending lb_policy %p",
213 const bool create_policy =
231 "[child_policy_handler %p] creating new %schild policy %s",
this,
237 policy_to_update = lb_policy.get();
249 gpr_log(
GPR_INFO,
"[child_policy_handler %p] updating %schild policy %p",
281 std::unique_ptr<ChannelControlHelper>(helper);
292 "[child_policy_handler %p] created new LB policy \"%s\" (%p)",
this,
293 child_policy_name, lb_policy.get());
297 absl::StrCat(
"Created new LB policy \"", child_policy_name,
"\""));
306 return strcmp(old_config->
name(), new_config->
name()) != 0;
RefCountedPtr< ChildPolicyHandler > parent_
TraceSeverity
Adds a trace message associated with the channel.
grpc_pollset_set * interested_parties() const
std::string ToString(StatusToStringMode mode=StatusToStringMode::kDefault) const
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
const grpc_channel_args * args
Channel args.
void RequestReresolution() override
Requests that the resolver re-resolve.
virtual void AddTraceEvent(TraceSeverity severity, absl::string_view message)=0
void AddTraceEvent(TraceSeverity severity, absl::string_view message) override
bool CalledByPendingChild() const
virtual void UpdateLocked(UpdateArgs)=0
void grpc_pollset_set_del_pollset_set(grpc_pollset_set *bag, grpc_pollset_set *item)
#define GRPC_TRACE_FLAG_ENABLED(f)
void ExitIdleLocked() override
virtual bool ConfigChangeRequiresNewPolicyInstance(LoadBalancingPolicy::Config *old_config, LoadBalancingPolicy::Config *new_config) const
void set_child(LoadBalancingPolicy *child)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
RefCountedPtr< LoadBalancingPolicy > Ref() GRPC_MUST_USE_RESULT
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
void UpdateState(grpc_connectivity_state state, const absl::Status &status, std::unique_ptr< SubchannelPicker > picker) override
ChannelControlHelper * channel_control_helper() const
virtual const char * name() const =0
bool CalledByCurrentChild() const
void UpdateLocked(UpdateArgs args) override
RefCountedPtr< LoadBalancingPolicy::Config > current_config_
OrphanablePtr< LoadBalancingPolicy > CreateChildPolicy(const char *child_policy_name, const grpc_channel_args &args)
Args used to instantiate an LB policy.
@ GRPC_CHANNEL_CONNECTING
static OrphanablePtr< LoadBalancingPolicy > CreateLoadBalancingPolicy(const char *name, LoadBalancingPolicy::Args args)
Creates an LB policy of the type specified by name.
std::shared_ptr< WorkSerializer > work_serializer
The work_serializer under which all LB policy calls will be run.
RefCountedPtr< SubchannelInterface > CreateSubchannel(ServerAddress address, const grpc_channel_args &args) override
Creates a new subchannel with the specified channel args.
LoadBalancingPolicy * child_
const char * ConnectivityStateName(grpc_connectivity_state state)
std::unique_ptr< T, Deleter > OrphanablePtr
OrphanablePtr< LoadBalancingPolicy > child_policy_
void grpc_pollset_set_add_pollset_set(grpc_pollset_set *bag, grpc_pollset_set *item)
std::unique_ptr< ChannelControlHelper > channel_control_helper
std::shared_ptr< WorkSerializer > work_serializer() const
Helper(RefCountedPtr< ChildPolicyHandler > parent)
void ResetBackoffLocked() override
Resets connection backoff.
void ShutdownLocked() override
Shuts down the policy.
virtual OrphanablePtr< LoadBalancingPolicy > CreateLoadBalancingPolicy(const char *name, LoadBalancingPolicy::Args args) const
absl::string_view GetAuthority() override
Returns the channel authority.
OrphanablePtr< LoadBalancingPolicy > pending_child_policy_
const char * name() const override
Returns the name of the LB policy.
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:53