aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/client_channel/lb_policy.h
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-06-29 14:48:05 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-07-11 15:17:35 -0700
commit018498a06be9188bda95b5753e2aa93db2b5a28f (patch)
tree5468fbd971f3a223b112c97026fc6ea6bed21a15 /src/core/ext/filters/client_channel/lb_policy.h
parent4ba4d18960ccc762d5228a314c574050afadddac (diff)
Implements subchannel refs for pick_first
Diffstat (limited to 'src/core/ext/filters/client_channel/lb_policy.h')
-rw-r--r--src/core/ext/filters/client_channel/lb_policy.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h
index dab4466b21..0c5fd2ad9c 100644
--- a/src/core/ext/filters/client_channel/lb_policy.h
+++ b/src/core/ext/filters/client_channel/lb_policy.h
@@ -21,6 +21,7 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/filters/client_channel/client_channel_channelz.h"
#include "src/core/ext/filters/client_channel/client_channel_factory.h"
#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/lib/gprpp/abstract.h"
@@ -28,6 +29,7 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/combiner.h"
#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/json/json.h"
#include "src/core/lib/transport/connectivity_state.h"
extern grpc_core::DebugOnlyTraceFlag grpc_trace_lb_policy_refcount;
@@ -157,6 +159,13 @@ class LoadBalancingPolicy
request_reresolution_ = request_reresolution;
}
+ /// populates child_subchannels and child_channels with the uuids of this
+ /// LB policies referenced children. This is not invoked from the
+ /// client_channel's combiner. It has its own synchronization. This is
+ /// not abstract, since the behavior is the same for all LB policies.
+ void FillChildRefsForChannelz(ChildRefsList* child_subchannels,
+ ChildRefsList* child_channels);
+
grpc_pollset_set* interested_parties() const { return interested_parties_; }
GRPC_ABSTRACT_BASE_CLASS
@@ -171,6 +180,9 @@ class LoadBalancingPolicy
grpc_client_channel_factory* client_channel_factory() const {
return client_channel_factory_;
}
+ gpr_mu* child_refs_mu() { return &child_refs_mu_; }
+ ChildRefsList* child_subchannels() { return &child_subchannels_; }
+ ChildRefsList* child_channels() { return &child_channels_; }
/// Shuts down the policy. Any pending picks that have not been
/// handed off to a new policy via HandOffPendingPicksLocked() will be
@@ -190,6 +202,11 @@ class LoadBalancingPolicy
/// Combiner under which LB policy actions take place.
grpc_combiner* combiner_;
+ /// Lock and data used to capture snapshots of this channels child
+ /// channels and subchannels. This data is consumed by channelz.
+ gpr_mu child_refs_mu_;
+ ChildRefsList child_subchannels_;
+ ChildRefsList child_channels_;
/// Client channel factory, used to create channels and subchannels.
grpc_client_channel_factory* client_channel_factory_;
/// Owned pointer to interested parties in load balancing decisions.