aboutsummaryrefslogtreecommitdiff
path: root/src/core/ext/filters
diff options
context:
space:
mode:
authorncteisen <ncteisen@gmail.com>2018-07-20 17:55:36 -0700
committerncteisen <ncteisen@gmail.com>2018-07-20 17:55:36 -0700
commitf081cf67d16049dc07141420601272d9f5988b1c (patch)
tree3c7cdfea3813e46d873fae0e4de3ea81fea50972 /src/core/ext/filters
parent835dab6a464b3246f6bdc3b1bb0fe706551a0260 (diff)
downloadgrpc-grpc-f081cf67d16049dc07141420601272d9f5988b1c.tar.gz
refactor
Diffstat (limited to 'src/core/ext/filters')
-rw-r--r--src/core/ext/filters/client_channel/client_channel_channelz.cc16
-rw-r--r--src/core/ext/filters/client_channel/client_channel_channelz.h2
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc2
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/subchannel_list.h2
4 files changed, 8 insertions, 14 deletions
diff --git a/src/core/ext/filters/client_channel/client_channel_channelz.cc b/src/core/ext/filters/client_channel/client_channel_channelz.cc
index a1ecbe75a2..996a871f38 100644
--- a/src/core/ext/filters/client_channel/client_channel_channelz.cc
+++ b/src/core/ext/filters/client_channel/client_channel_channelz.cc
@@ -108,8 +108,8 @@ grpc_json* ClientChannelNode::RenderJson() {
GRPC_JSON_OBJECT, false);
json = json_iterator;
json_iterator = nullptr;
- json_iterator = grpc_json_add_number_string_child(
- json, json_iterator, "channelId", channel_uuid());
+ json_iterator = grpc_json_add_number_string_child(json, json_iterator,
+ "channelId", uuid());
// reset json iterators to top level object
json = top_level_json;
json_iterator = nullptr;
@@ -152,13 +152,9 @@ SubchannelNode::SubchannelNode(grpc_subchannel* subchannel,
channel_tracer_max_nodes),
subchannel_(subchannel),
target_(UniquePtr<char>(
- gpr_strdup(grpc_subchannel_get_target(subchannel_)))) {
- subchannel_uuid_ = ChannelzRegistry::Register(this);
-}
+ gpr_strdup(grpc_subchannel_get_target(subchannel_)))) {}
-SubchannelNode::~SubchannelNode() {
- ChannelzRegistry::Unregister(subchannel_uuid_);
-}
+SubchannelNode::~SubchannelNode() {}
void SubchannelNode::PopulateConnectivityState(grpc_json* json) {
grpc_connectivity_state state;
@@ -182,8 +178,8 @@ grpc_json* SubchannelNode::RenderJson() {
GRPC_JSON_OBJECT, false);
json = json_iterator;
json_iterator = nullptr;
- json_iterator = grpc_json_add_number_string_child(
- json, json_iterator, "subchannelId", subchannel_uuid_);
+ json_iterator = grpc_json_add_number_string_child(json, json_iterator,
+ "subchannelId", uuid());
// reset json iterators to top level object
json = top_level_json;
json_iterator = nullptr;
diff --git a/src/core/ext/filters/client_channel/client_channel_channelz.h b/src/core/ext/filters/client_channel/client_channel_channelz.h
index 73eea7cecf..45df756b91 100644
--- a/src/core/ext/filters/client_channel/client_channel_channelz.h
+++ b/src/core/ext/filters/client_channel/client_channel_channelz.h
@@ -79,8 +79,6 @@ class SubchannelNode : public CallCountingAndTracingNode {
grpc_json* RenderJson() override;
- intptr_t subchannel_uuid() { return subchannel_uuid_; }
-
private:
GPRC_ALLOW_CLASS_TO_USE_NON_PUBLIC_DELETE
GPRC_ALLOW_CLASS_TO_USE_NON_PUBLIC_NEW
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
index 959c7441a3..dc475d3d68 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
@@ -1294,7 +1294,7 @@ void GrpcLb::FillChildRefsForChannelz(ChildRefsList* child_subchannels,
grpc_core::channelz::ChannelNode* channel_node =
grpc_channel_get_channelz_node(lb_channel_);
if (channel_node != nullptr) {
- child_channels->push_back(channel_node->channel_uuid());
+ child_channels->push_back(channel_node->uuid());
}
}
}
diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
index 018ac3bb86..199b9a3c13 100644
--- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
+++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
@@ -196,7 +196,7 @@ class SubchannelList
grpc_core::channelz::SubchannelNode* subchannel_node =
grpc_subchannel_get_channelz_node(subchannels_[i].subchannel());
if (subchannel_node != nullptr) {
- refs_list->push_back(subchannel_node->subchannel_uuid());
+ refs_list->push_back(subchannel_node->uuid());
}
}
}