diff options
author | dvshkurko <dvshkurko@yandex-team.ru> | 2022-02-10 16:45:52 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:52 +0300 |
commit | c768a99151e47c3a4bb7b92c514d256abd301c4d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc | |
parent | 321ee9bce31ec6e238be26dbcbe539cffa2c3309 (diff) | |
download | ydb-c768a99151e47c3a4bb7b92c514d256abd301c4d.tar.gz |
Restoring authorship annotation for <dvshkurko@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc')
-rw-r--r-- | contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc b/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc index e061c62ef4..6dcf84bf40 100644 --- a/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc +++ b/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc @@ -27,25 +27,25 @@ namespace grpc { namespace { -grpc::protobuf::util::Status ParseJson(const char* json_str, - grpc::protobuf::Message* message) { - grpc::protobuf::json::JsonParseOptions options; +grpc::protobuf::util::Status ParseJson(const char* json_str, + grpc::protobuf::Message* message) { + grpc::protobuf::json::JsonParseOptions options; options.case_insensitive_enum_parsing = true; - return grpc::protobuf::json::JsonStringToMessage(json_str, message, options); -} + return grpc::protobuf::json::JsonStringToMessage(json_str, message, options); +} } // namespace Status ChannelzService::GetTopChannels( - ServerContext* /*unused*/, - const channelz::v1::GetTopChannelsRequest* request, + ServerContext* /*unused*/, + const channelz::v1::GetTopChannelsRequest* request, channelz::v1::GetTopChannelsResponse* response) { char* json_str = grpc_channelz_get_top_channels(request->start_channel_id()); if (json_str == nullptr) { return Status(StatusCode::INTERNAL, "grpc_channelz_get_top_channels returned null"); } - grpc::protobuf::util::Status s = ParseJson(json_str, response); + grpc::protobuf::util::Status s = ParseJson(json_str, response); gpr_free(json_str); if (!s.ok()) { return Status(StatusCode::INTERNAL, s.ToString()); @@ -54,14 +54,14 @@ Status ChannelzService::GetTopChannels( } Status ChannelzService::GetServers( - ServerContext* /*unused*/, const channelz::v1::GetServersRequest* request, + ServerContext* /*unused*/, const channelz::v1::GetServersRequest* request, channelz::v1::GetServersResponse* response) { char* json_str = grpc_channelz_get_servers(request->start_server_id()); if (json_str == nullptr) { return Status(StatusCode::INTERNAL, "grpc_channelz_get_servers returned null"); } - grpc::protobuf::util::Status s = ParseJson(json_str, response); + grpc::protobuf::util::Status s = ParseJson(json_str, response); gpr_free(json_str); if (!s.ok()) { return Status(StatusCode::INTERNAL, s.ToString()); @@ -69,7 +69,7 @@ Status ChannelzService::GetServers( return Status::OK; } -Status ChannelzService::GetServer(ServerContext* /*unused*/, +Status ChannelzService::GetServer(ServerContext* /*unused*/, const channelz::v1::GetServerRequest* request, channelz::v1::GetServerResponse* response) { char* json_str = grpc_channelz_get_server(request->server_id()); @@ -77,7 +77,7 @@ Status ChannelzService::GetServer(ServerContext* /*unused*/, return Status(StatusCode::INTERNAL, "grpc_channelz_get_server returned null"); } - grpc::protobuf::util::Status s = ParseJson(json_str, response); + grpc::protobuf::util::Status s = ParseJson(json_str, response); gpr_free(json_str); if (!s.ok()) { return Status(StatusCode::INTERNAL, s.ToString()); @@ -86,8 +86,8 @@ Status ChannelzService::GetServer(ServerContext* /*unused*/, } Status ChannelzService::GetServerSockets( - ServerContext* /*unused*/, - const channelz::v1::GetServerSocketsRequest* request, + ServerContext* /*unused*/, + const channelz::v1::GetServerSocketsRequest* request, channelz::v1::GetServerSocketsResponse* response) { char* json_str = grpc_channelz_get_server_sockets( request->server_id(), request->start_socket_id(), request->max_results()); @@ -95,7 +95,7 @@ Status ChannelzService::GetServerSockets( return Status(StatusCode::INTERNAL, "grpc_channelz_get_server_sockets returned null"); } - grpc::protobuf::util::Status s = ParseJson(json_str, response); + grpc::protobuf::util::Status s = ParseJson(json_str, response); gpr_free(json_str); if (!s.ok()) { return Status(StatusCode::INTERNAL, s.ToString()); @@ -104,13 +104,13 @@ Status ChannelzService::GetServerSockets( } Status ChannelzService::GetChannel( - ServerContext* /*unused*/, const channelz::v1::GetChannelRequest* request, + ServerContext* /*unused*/, const channelz::v1::GetChannelRequest* request, channelz::v1::GetChannelResponse* response) { char* json_str = grpc_channelz_get_channel(request->channel_id()); if (json_str == nullptr) { return Status(StatusCode::NOT_FOUND, "No object found for that ChannelId"); } - grpc::protobuf::util::Status s = ParseJson(json_str, response); + grpc::protobuf::util::Status s = ParseJson(json_str, response); gpr_free(json_str); if (!s.ok()) { return Status(StatusCode::INTERNAL, s.ToString()); @@ -119,15 +119,15 @@ Status ChannelzService::GetChannel( } Status ChannelzService::GetSubchannel( - ServerContext* /*unused*/, - const channelz::v1::GetSubchannelRequest* request, + ServerContext* /*unused*/, + const channelz::v1::GetSubchannelRequest* request, channelz::v1::GetSubchannelResponse* response) { char* json_str = grpc_channelz_get_subchannel(request->subchannel_id()); if (json_str == nullptr) { return Status(StatusCode::NOT_FOUND, "No object found for that SubchannelId"); } - grpc::protobuf::util::Status s = ParseJson(json_str, response); + grpc::protobuf::util::Status s = ParseJson(json_str, response); gpr_free(json_str); if (!s.ok()) { return Status(StatusCode::INTERNAL, s.ToString()); @@ -135,14 +135,14 @@ Status ChannelzService::GetSubchannel( return Status::OK; } -Status ChannelzService::GetSocket(ServerContext* /*unused*/, +Status ChannelzService::GetSocket(ServerContext* /*unused*/, const channelz::v1::GetSocketRequest* request, channelz::v1::GetSocketResponse* response) { char* json_str = grpc_channelz_get_socket(request->socket_id()); if (json_str == nullptr) { return Status(StatusCode::NOT_FOUND, "No object found for that SocketId"); } - grpc::protobuf::util::Status s = ParseJson(json_str, response); + grpc::protobuf::util::Status s = ParseJson(json_str, response); gpr_free(json_str); if (!s.ok()) { return Status(StatusCode::INTERNAL, s.ToString()); |