|
|
|
@ -107,6 +107,11 @@ class SubchannelData { |
|
|
|
|
// being unreffed.
|
|
|
|
|
virtual void UnrefSubchannelLocked(const char* reason); |
|
|
|
|
|
|
|
|
|
// Resets the connection backoff.
|
|
|
|
|
// TODO(roth): This method should go away when we move the backoff
|
|
|
|
|
// code out of the subchannel and into the LB policies.
|
|
|
|
|
void ResetBackoffLocked(); |
|
|
|
|
|
|
|
|
|
// Starts watching the connectivity state of the subchannel.
|
|
|
|
|
// ProcessConnectivityChangeLocked() will be called when the
|
|
|
|
|
// connectivity state changes.
|
|
|
|
@ -206,6 +211,11 @@ class SubchannelList |
|
|
|
|
LoadBalancingPolicy* policy() const { return policy_; } |
|
|
|
|
TraceFlag* tracer() const { return tracer_; } |
|
|
|
|
|
|
|
|
|
// Resets connection backoff of all subchannels.
|
|
|
|
|
// TODO(roth): We will probably need to rethink this as part of moving
|
|
|
|
|
// the backoff code out of subchannels and into LB policies.
|
|
|
|
|
void ResetBackoffLocked(); |
|
|
|
|
|
|
|
|
|
// Note: Caller must ensure that this is invoked inside of the combiner.
|
|
|
|
|
void Orphan() override { |
|
|
|
|
ShutdownLocked(); |
|
|
|
@ -298,6 +308,14 @@ void SubchannelData<SubchannelListType, SubchannelDataType>:: |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template <typename SubchannelListType, typename SubchannelDataType> |
|
|
|
|
void SubchannelData<SubchannelListType, |
|
|
|
|
SubchannelDataType>::ResetBackoffLocked() { |
|
|
|
|
if (subchannel_ != nullptr) { |
|
|
|
|
grpc_subchannel_reset_backoff(subchannel_); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template <typename SubchannelListType, typename SubchannelDataType> |
|
|
|
|
void SubchannelData<SubchannelListType, |
|
|
|
|
SubchannelDataType>::StartConnectivityWatchLocked() { |
|
|
|
@ -544,6 +562,15 @@ void SubchannelList<SubchannelListType, SubchannelDataType>::ShutdownLocked() { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template <typename SubchannelListType, typename SubchannelDataType> |
|
|
|
|
void SubchannelList<SubchannelListType, |
|
|
|
|
SubchannelDataType>::ResetBackoffLocked() { |
|
|
|
|
for (size_t i = 0; i < subchannels_.size(); i++) { |
|
|
|
|
SubchannelDataType* sd = &subchannels_[i]; |
|
|
|
|
sd->ResetBackoffLocked(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} // namespace grpc_core
|
|
|
|
|
|
|
|
|
|
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_SUBCHANNEL_LIST_H */ |
|
|
|
|