blob: 2ead048a1ff14901c99d715229d20d6b4199d619 [file] [log] [blame]
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001/*
2 *
Sree Kuchibhotla01907122016-04-21 15:09:13 -07003 * Copyright 2015-2016, Google Inc.
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08004 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above
13 * copyright notice, this list of conditions and the following disclaimer
14 * in the documentation and/or other materials provided with the
15 * distribution.
16 * * Neither the name of Google Inc. nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
34#include <grpc++/server_builder.h>
35
Craig Tiller14a65f92015-02-09 13:13:14 -080036#include <grpc++/impl/service_type.h>
Craig Tillerafcc8752016-10-18 16:10:06 -070037#include <grpc++/resource_quota.h>
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080038#include <grpc++/server.h>
Craig Tillerf40df232016-03-25 13:38:14 -070039#include <grpc/support/cpu.h>
40#include <grpc/support/log.h>
David Garcia Quintas468e16d2016-08-31 13:29:40 +020041#include <grpc/support/useful.h>
David Garcia Quintas2d024562016-05-17 23:24:39 -070042
Vijay Paie8a7e302015-08-24 10:52:33 -070043#include "src/cpp/server/thread_pool_interface.h"
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080044
45namespace grpc {
46
Yuchen Zeng7d099a52016-05-06 13:21:36 -070047static std::vector<std::unique_ptr<ServerBuilderPlugin> (*)()>*
48 g_plugin_factory_list;
Yuchen Zeng3b8f3352016-05-03 12:18:13 -070049static gpr_once once_init_plugin_list = GPR_ONCE_INIT;
50
51static void do_plugin_list_init(void) {
Yuchen Zeng7d099a52016-05-06 13:21:36 -070052 g_plugin_factory_list =
53 new std::vector<std::unique_ptr<ServerBuilderPlugin> (*)()>();
Yuchen Zeng3b8f3352016-05-03 12:18:13 -070054}
55
Yang Gao5f4539f2015-03-06 16:11:16 -080056ServerBuilder::ServerBuilder()
Mark D. Roth69803622016-09-06 08:15:36 -070057 : max_receive_message_size_(-1),
58 max_send_message_size_(-1),
Sree Kuchibhotla96766192016-10-13 12:42:54 -070059 sync_server_settings_(SyncServerSettings()),
Craig Tiller20afa3d2016-10-17 14:52:14 -070060 resource_quota_(nullptr),
Mark D. Roth69803622016-09-06 08:15:36 -070061 generic_service_(nullptr) {
Yuchen Zeng3b8f3352016-05-03 12:18:13 -070062 gpr_once_init(&once_init_plugin_list, do_plugin_list_init);
Vijay Paieac07c32016-06-10 01:36:53 -070063 for (auto it = g_plugin_factory_list->begin();
64 it != g_plugin_factory_list->end(); it++) {
Vijay Paib645a2d2016-06-09 18:39:06 -070065 auto& factory = *it;
Vijay Pai15855f32016-06-10 12:25:32 -070066 plugins_.emplace_back(factory());
Yuchen Zeng3b8f3352016-05-03 12:18:13 -070067 }
Sree Kuchibhotla892dbf42016-09-27 19:42:27 -070068
David Garcia Quintas2d024562016-05-17 23:24:39 -070069 // all compression algorithms enabled by default.
70 enabled_compression_algorithms_bitset_ =
71 (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1;
72 memset(&maybe_default_compression_level_, 0,
73 sizeof(maybe_default_compression_level_));
74 memset(&maybe_default_compression_algorithm_, 0,
75 sizeof(maybe_default_compression_algorithm_));
David Garcia Quintasbeac88c2015-08-10 13:39:52 -070076}
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080077
Craig Tillerdb1a5cc2016-09-28 14:22:12 -070078ServerBuilder::~ServerBuilder() {
Craig Tiller20afa3d2016-10-17 14:52:14 -070079 if (resource_quota_ != nullptr) {
80 grpc_resource_quota_unref(resource_quota_);
Craig Tillerdb1a5cc2016-09-28 14:22:12 -070081 }
82}
83
Sree Kuchibhotla1f5e2622016-04-21 12:28:09 -070084std::unique_ptr<ServerCompletionQueue> ServerBuilder::AddCompletionQueue(
85 bool is_frequently_polled) {
Craig Tiller334c4672017-04-11 16:26:07 -070086 ServerCompletionQueue* cq = new ServerCompletionQueue(
87 is_frequently_polled ? GRPC_CQ_DEFAULT_POLLING : GRPC_CQ_NON_LISTENING);
Craig Tillerf9e6adf2015-05-06 11:45:59 -070088 cqs_.push_back(cq);
89 return std::unique_ptr<ServerCompletionQueue>(cq);
90}
91
David Garcia Quintas2d024562016-05-17 23:24:39 -070092ServerBuilder& ServerBuilder::RegisterService(Service* service) {
Craig Tiller15f383c2016-01-07 12:45:32 -080093 services_.emplace_back(new NamedService(service));
David Garcia Quintas2d024562016-05-17 23:24:39 -070094 return *this;
Craig Tiller822d2c72015-07-07 16:08:00 -070095}
96
David Garcia Quintas2d024562016-05-17 23:24:39 -070097ServerBuilder& ServerBuilder::RegisterService(const grpc::string& addr,
98 Service* service) {
Craig Tiller15f383c2016-01-07 12:45:32 -080099 services_.emplace_back(new NamedService(addr, service));
David Garcia Quintas2d024562016-05-17 23:24:39 -0700100 return *this;
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800101}
102
David Garcia Quintas2d024562016-05-17 23:24:39 -0700103ServerBuilder& ServerBuilder::RegisterAsyncGenericService(
104 AsyncGenericService* service) {
Yang Gao005eb882015-03-11 22:17:13 -0700105 if (generic_service_) {
Yang Gao1c402332015-03-05 16:39:25 -0800106 gpr_log(GPR_ERROR,
Yang Gao49996492015-03-12 16:40:19 -0700107 "Adding multiple AsyncGenericService is unsupported for now. "
Yang Gao6baa9b62015-03-17 10:49:39 -0700108 "Dropping the service %p",
Sree Kuchibhotla4028d2c2016-09-21 10:45:33 -0700109 (void*)service);
David Garcia Quintas2d024562016-05-17 23:24:39 -0700110 } else {
111 generic_service_ = service;
Yang Gao1c402332015-03-05 16:39:25 -0800112 }
David Garcia Quintas2d024562016-05-17 23:24:39 -0700113 return *this;
Yang Gao1c402332015-03-05 16:39:25 -0800114}
115
David Garcia Quintas2d024562016-05-17 23:24:39 -0700116ServerBuilder& ServerBuilder::SetOption(
117 std::unique_ptr<ServerBuilderOption> option) {
yang-ga23f17b2015-11-25 10:21:05 -0800118 options_.push_back(std::move(option));
David Garcia Quintas2d024562016-05-17 23:24:39 -0700119 return *this;
yang-ga23f17b2015-11-25 10:21:05 -0800120}
121
Sree Kuchibhotla96766192016-10-13 12:42:54 -0700122ServerBuilder& ServerBuilder::SetSyncServerOption(
123 ServerBuilder::SyncServerOption option, int val) {
124 switch (option) {
125 case NUM_CQS:
126 sync_server_settings_.num_cqs = val;
127 break;
Sree Kuchibhotla96766192016-10-13 12:42:54 -0700128 case MIN_POLLERS:
129 sync_server_settings_.min_pollers = val;
130 break;
131 case MAX_POLLERS:
132 sync_server_settings_.max_pollers = val;
133 break;
134 case CQ_TIMEOUT_MSEC:
135 sync_server_settings_.cq_timeout_msec = val;
136 break;
137 }
138 return *this;
139}
140
David Garcia Quintas2d024562016-05-17 23:24:39 -0700141ServerBuilder& ServerBuilder::SetCompressionAlgorithmSupportStatus(
142 grpc_compression_algorithm algorithm, bool enabled) {
143 if (enabled) {
144 GPR_BITSET(&enabled_compression_algorithms_bitset_, algorithm);
145 } else {
146 GPR_BITCLEAR(&enabled_compression_algorithms_bitset_, algorithm);
147 }
148 return *this;
149}
150
151ServerBuilder& ServerBuilder::SetDefaultCompressionLevel(
152 grpc_compression_level level) {
153 maybe_default_compression_level_.level = level;
154 return *this;
155}
156
157ServerBuilder& ServerBuilder::SetDefaultCompressionAlgorithm(
158 grpc_compression_algorithm algorithm) {
159 maybe_default_compression_algorithm_.is_set = true;
160 maybe_default_compression_algorithm_.algorithm = algorithm;
161 return *this;
162}
163
Craig Tiller20afa3d2016-10-17 14:52:14 -0700164ServerBuilder& ServerBuilder::SetResourceQuota(
165 const grpc::ResourceQuota& resource_quota) {
166 if (resource_quota_ != nullptr) {
167 grpc_resource_quota_unref(resource_quota_);
Craig Tillerdb1a5cc2016-09-28 14:22:12 -0700168 }
Craig Tiller20afa3d2016-10-17 14:52:14 -0700169 resource_quota_ = resource_quota.c_resource_quota();
170 grpc_resource_quota_ref(resource_quota_);
Craig Tillerdb1a5cc2016-09-28 14:22:12 -0700171 return *this;
172}
173
David Garcia Quintas2d024562016-05-17 23:24:39 -0700174ServerBuilder& ServerBuilder::AddListeningPort(
175 const grpc::string& addr, std::shared_ptr<ServerCredentials> creds,
176 int* selected_port) {
Nicolas Noble30862032015-04-24 18:17:45 -0700177 Port port = {addr, creds, selected_port};
178 ports_.push_back(port);
David Garcia Quintas2d024562016-05-17 23:24:39 -0700179 return *this;
yangg9e21f722014-12-08 15:49:52 -0800180}
181
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800182std::unique_ptr<Server> ServerBuilder::BuildAndStart() {
Sree Kuchibhotla2d08f5b2016-09-26 16:11:02 -0700183 ChannelArguments args;
184 for (auto option = options_.begin(); option != options_.end(); ++option) {
185 (*option)->UpdateArguments(&args);
186 (*option)->UpdatePlugins(&plugins_);
187 }
188
189 for (auto plugin = plugins_.begin(); plugin != plugins_.end(); plugin++) {
190 (*plugin)->UpdateChannelArguments(&args);
191 }
192
193 if (max_receive_message_size_ >= 0) {
194 args.SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, max_receive_message_size_);
195 }
196
197 if (max_send_message_size_ >= 0) {
198 args.SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, max_send_message_size_);
199 }
200
201 args.SetInt(GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET,
202 enabled_compression_algorithms_bitset_);
203 if (maybe_default_compression_level_.is_set) {
204 args.SetInt(GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL,
205 maybe_default_compression_level_.level);
206 }
207 if (maybe_default_compression_algorithm_.is_set) {
208 args.SetInt(GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM,
209 maybe_default_compression_algorithm_.algorithm);
210 }
211
Craig Tiller20afa3d2016-10-17 14:52:14 -0700212 if (resource_quota_ != nullptr) {
Craig Tiller153eaa72016-10-21 13:52:36 -0700213 args.SetPointerWithVtable(GRPC_ARG_RESOURCE_QUOTA, resource_quota_,
Craig Tiller20afa3d2016-10-17 14:52:14 -0700214 grpc_resource_quota_arg_vtable());
Craig Tillerdb1a5cc2016-09-28 14:22:12 -0700215 }
Sree Kuchibhotla1e088b42016-10-28 17:34:55 -0700216
Sree Kuchibhotla3ea9e242016-08-22 14:15:43 -0700217 // == Determine if the server has any syncrhonous methods ==
Craig Tiller8a7fe1a2016-05-20 11:17:20 -0700218 bool has_sync_methods = false;
Craig Tiller15f383c2016-01-07 12:45:32 -0800219 for (auto it = services_.begin(); it != services_.end(); ++it) {
220 if ((*it)->service->has_synchronous_methods()) {
Sree Kuchibhotla3ea9e242016-08-22 14:15:43 -0700221 has_sync_methods = true;
222 break;
223 }
224 }
225
226 if (!has_sync_methods) {
227 for (auto plugin = plugins_.begin(); plugin != plugins_.end(); plugin++) {
228 if ((*plugin)->has_sync_methods()) {
Craig Tiller8a7fe1a2016-05-20 11:17:20 -0700229 has_sync_methods = true;
yang-gbef0d872016-01-13 15:27:33 -0800230 break;
Craig Tiller15f383c2016-01-07 12:45:32 -0800231 }
232 }
Craig Tiller0db1bef2015-02-09 13:47:39 -0800233 }
Sree Kuchibhotla3ea9e242016-08-22 14:15:43 -0700234
Sree Kuchibhotlaaabada92016-08-24 10:01:13 -0700235 // If this is a Sync server, i.e a server expositing sync API, then the server
236 // needs to create some completion queues to listen for incoming requests.
237 // 'sync_server_cqs' are those internal completion queues.
238 //
239 // This is different from the completion queues added to the server via
240 // ServerBuilder's AddCompletionQueue() method (those completion queues
241 // are in 'cqs_' member variable of ServerBuilder object)
Sree Kuchibhotla4028d2c2016-09-21 10:45:33 -0700242 std::shared_ptr<std::vector<std::unique_ptr<ServerCompletionQueue>>>
Sree Kuchibhotla61355352016-10-20 11:17:22 -0700243 sync_server_cqs(std::make_shared<
244 std::vector<std::unique_ptr<ServerCompletionQueue>>>());
Sree Kuchibhotlaaabada92016-08-24 10:01:13 -0700245
Craig Tiller75bfb972017-04-11 17:55:12 -0700246 int num_frequently_polled_cqs = 0;
247 for (auto it = cqs_.begin(); it != cqs_.end(); ++it) {
248 if ((*it)->IsFrequentlyPolled()) {
249 num_frequently_polled_cqs++;
250 }
251 }
252
253 const bool is_hybrid_server =
254 has_sync_methods && num_frequently_polled_cqs > 0;
255
Sree Kuchibhotlaaabada92016-08-24 10:01:13 -0700256 if (has_sync_methods) {
Sree Kuchibhotlaa7a21d22016-09-28 12:38:01 -0700257 // This is a Sync server
258 gpr_log(GPR_INFO,
259 "Synchronous server. Num CQs: %d, Min pollers: %d, Max Pollers: "
260 "%d, CQ timeout (msec): %d",
261 sync_server_settings_.num_cqs, sync_server_settings_.min_pollers,
262 sync_server_settings_.max_pollers,
263 sync_server_settings_.cq_timeout_msec);
264
Craig Tiller334c4672017-04-11 16:26:07 -0700265 grpc_cq_polling_type polling_type =
Craig Tiller75bfb972017-04-11 17:55:12 -0700266 is_hybrid_server ? GRPC_CQ_NON_POLLING : GRPC_CQ_DEFAULT_POLLING;
Craig Tiller334c4672017-04-11 16:26:07 -0700267
Sree Kuchibhotlaa7a21d22016-09-28 12:38:01 -0700268 // Create completion queues to listen to incoming rpc requests
Sree Kuchibhotla892dbf42016-09-27 19:42:27 -0700269 for (int i = 0; i < sync_server_settings_.num_cqs; i++) {
Craig Tiller334c4672017-04-11 16:26:07 -0700270 sync_server_cqs->emplace_back(new ServerCompletionQueue(polling_type));
Sree Kuchibhotlaaabada92016-08-24 10:01:13 -0700271 }
272 }
273
Sree Kuchibhotla892dbf42016-09-27 19:42:27 -0700274 std::unique_ptr<Server> server(new Server(
Sree Kuchibhotlae4eb51f2016-10-18 11:51:28 -0700275 max_receive_message_size_, &args, sync_server_cqs,
Sree Kuchibhotla892dbf42016-09-27 19:42:27 -0700276 sync_server_settings_.min_pollers, sync_server_settings_.max_pollers,
277 sync_server_settings_.cq_timeout_msec));
Sree Kuchibhotla3ea9e242016-08-22 14:15:43 -0700278
Yuchen Zenga42ec212016-04-29 13:03:06 -0700279 ServerInitializer* initializer = server->initializer();
Sree Kuchibhotla7def0362016-04-21 14:54:32 -0700280
Sree Kuchibhotlaaabada92016-08-24 10:01:13 -0700281 // Register all the completion queues with the server. i.e
282 // 1. sync_server_cqs: internal completion queues created IF this is a sync
283 // server
284 // 2. cqs_: Completion queues added via AddCompletionQueue() call
Sree Kuchibhotla7def0362016-04-21 14:54:32 -0700285
Sree Kuchibhotlaaabada92016-08-24 10:01:13 -0700286 for (auto it = sync_server_cqs->begin(); it != sync_server_cqs->end(); ++it) {
Craig Tiller11c58322017-04-12 08:21:17 -0700287 grpc_server_register_completion_queue(server->server_, (*it)->cq(),
288 nullptr);
Craig Tiller75bfb972017-04-11 17:55:12 -0700289 num_frequently_polled_cqs++;
Sree Kuchibhotlaaabada92016-08-24 10:01:13 -0700290 }
291
292 // cqs_ contains the completion queue added by calling the ServerBuilder's
293 // AddCompletionQueue() API. Some of them may not be frequently polled (i.e by
294 // calling Next() or AsyncNext()) and hence are not safe to be used for
295 // listening to incoming channels. Such completion queues must be registered
296 // as non-listening queues
297 for (auto it = cqs_.begin(); it != cqs_.end(); ++it) {
Craig Tiller11c58322017-04-12 08:21:17 -0700298 grpc_server_register_completion_queue(server->server_, (*it)->cq(),
299 nullptr);
Craig Tillerf9e6adf2015-05-06 11:45:59 -0700300 }
Sree Kuchibhotla7def0362016-04-21 14:54:32 -0700301
302 if (num_frequently_polled_cqs == 0) {
303 gpr_log(GPR_ERROR,
Craig Tilleraae6c2c2016-05-20 08:58:30 -0700304 "At least one of the completion queues must be frequently polled");
Sree Kuchibhotla7def0362016-04-21 14:54:32 -0700305 return nullptr;
306 }
307
Vijay Pai82dd80a2015-03-24 10:36:08 -0700308 for (auto service = services_.begin(); service != services_.end();
309 service++) {
Craig Tillerd9b6fcf2015-07-07 16:28:20 -0700310 if (!server->RegisterService((*service)->host.get(), (*service)->service)) {
Craig Tiller0db1bef2015-02-09 13:47:39 -0800311 return nullptr;
312 }
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800313 }
Sree Kuchibhotla3ea9e242016-08-22 14:15:43 -0700314
Yuchen Zenga42ec212016-04-29 13:03:06 -0700315 for (auto plugin = plugins_.begin(); plugin != plugins_.end(); plugin++) {
Vijay Pai15855f32016-06-10 12:25:32 -0700316 (*plugin)->InitServer(initializer);
Yuchen Zenga42ec212016-04-29 13:03:06 -0700317 }
Sree Kuchibhotla3ea9e242016-08-22 14:15:43 -0700318
Yang Gao005eb882015-03-11 22:17:13 -0700319 if (generic_service_) {
Yang Gao49996492015-03-12 16:40:19 -0700320 server->RegisterAsyncGenericService(generic_service_);
yang-g1ac6f452016-01-15 11:46:40 -0800321 } else {
322 for (auto it = services_.begin(); it != services_.end(); ++it) {
323 if ((*it)->service->has_generic_methods()) {
324 gpr_log(GPR_ERROR,
325 "Some methods were marked generic but there is no "
326 "generic service registered.");
327 return nullptr;
328 }
329 }
Yang Gao1c402332015-03-05 16:39:25 -0800330 }
Sree Kuchibhotla3ea9e242016-08-22 14:15:43 -0700331
Craig Tiller12352b22017-01-10 15:16:14 -0800332 bool added_port = false;
Vijay Pai82dd80a2015-03-24 10:36:08 -0700333 for (auto port = ports_.begin(); port != ports_.end(); port++) {
334 int r = server->AddListeningPort(port->addr, port->creds.get());
Craig Tiller12352b22017-01-10 15:16:14 -0800335 if (!r) {
336 if (added_port) server->Shutdown();
337 return nullptr;
338 }
339 added_port = true;
Vijay Pai82dd80a2015-03-24 10:36:08 -0700340 if (port->selected_port != nullptr) {
341 *port->selected_port = r;
Craig Tiller0db1bef2015-02-09 13:47:39 -0800342 }
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800343 }
Sree Kuchibhotla3ea9e242016-08-22 14:15:43 -0700344
yang-g61e461e2015-09-03 13:08:59 -0700345 auto cqs_data = cqs_.empty() ? nullptr : &cqs_[0];
Craig Tiller9d9313c2017-04-11 15:05:46 -0700346 server->Start(cqs_data, cqs_.size());
Sree Kuchibhotla3ea9e242016-08-22 14:15:43 -0700347
Yuchen Zenga42ec212016-04-29 13:03:06 -0700348 for (auto plugin = plugins_.begin(); plugin != plugins_.end(); plugin++) {
Vijay Pai15855f32016-06-10 12:25:32 -0700349 (*plugin)->Finish(initializer);
Yuchen Zenga42ec212016-04-29 13:03:06 -0700350 }
Sree Kuchibhotla3ea9e242016-08-22 14:15:43 -0700351
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800352 return server;
353}
354
Yuchen Zeng3b8f3352016-05-03 12:18:13 -0700355void ServerBuilder::InternalAddPluginFactory(
356 std::unique_ptr<ServerBuilderPlugin> (*CreatePlugin)()) {
357 gpr_once_init(&once_init_plugin_list, do_plugin_list_init);
Yuchen Zeng7d099a52016-05-06 13:21:36 -0700358 (*g_plugin_factory_list).push_back(CreatePlugin);
Yuchen Zeng3b8f3352016-05-03 12:18:13 -0700359}
360
Craig Tiller190d3602015-02-18 09:23:38 -0800361} // namespace grpc