From 0498124f8ebead73d71fefdfc63e9b29d0da7a8f Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 1 Dec 2016 11:53:08 -0800 Subject: Add files --- BUILD | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'BUILD') diff --git a/BUILD b/BUILD index ab0fc237b7..54eda959fc 100644 --- a/BUILD +++ b/BUILD @@ -1422,6 +1422,8 @@ cc_library( "include/grpc++/completion_queue.h", "include/grpc++/create_channel.h", "include/grpc++/create_channel_posix.h", + "include/grpc++/ext/health_check_service_interface.h", + "include/grpc++/ext/health_check_service_server_builder_option.h", "include/grpc++/generic/async_generic_service.h", "include/grpc++/generic/generic_stub.h", "include/grpc++/grpc++.h", @@ -1884,6 +1886,8 @@ cc_library( "include/grpc++/completion_queue.h", "include/grpc++/create_channel.h", "include/grpc++/create_channel_posix.h", + "include/grpc++/ext/health_check_service_interface.h", + "include/grpc++/ext/health_check_service_server_builder_option.h", "include/grpc++/generic/async_generic_service.h", "include/grpc++/generic/generic_stub.h", "include/grpc++/grpc++.h", @@ -2060,6 +2064,8 @@ cc_library( "include/grpc++/completion_queue.h", "include/grpc++/create_channel.h", "include/grpc++/create_channel_posix.h", + "include/grpc++/ext/health_check_service_interface.h", + "include/grpc++/ext/health_check_service_server_builder_option.h", "include/grpc++/generic/async_generic_service.h", "include/grpc++/generic/generic_stub.h", "include/grpc++/grpc++.h", -- cgit v1.2.3 From 64868839401b48a68afca187b28bc772043a2e1b Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 1 Dec 2016 12:15:50 -0800 Subject: Add more files --- BUILD | 3 ++ CMakeLists.txt | 3 ++ Makefile | 3 ++ build.yaml | 1 + .../health_check_service_server_builder_option.h | 8 ++- .../health_check_service_server_builder_option.cc | 59 ++++++++++++++++++++++ tools/doxygen/Doxyfile.c++.internal | 1 + tools/run_tests/generated/sources_and_headers.json | 1 + vsprojects/vcxproj/grpc++/grpc++.vcxproj | 2 + vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters | 3 ++ .../grpc++_unsecure/grpc++_unsecure.vcxproj | 2 + .../grpc++_unsecure.vcxproj.filters | 3 ++ 12 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 src/cpp/ext/health_check_service_server_builder_option.cc (limited to 'BUILD') diff --git a/BUILD b/BUILD index 54eda959fc..fcd2742a8f 100644 --- a/BUILD +++ b/BUILD @@ -1396,6 +1396,7 @@ cc_library( "src/cpp/common/channel_filter.cc", "src/cpp/common/completion_queue_cc.cc", "src/cpp/common/core_codegen.cc", + "src/cpp/common/health_check_service_server_builder_option.cc", "src/cpp/common/resource_quota_cc.cc", "src/cpp/common/rpc_method.cc", "src/cpp/common/version_cc.cc", @@ -1688,6 +1689,7 @@ cc_library( "src/cpp/common/channel_filter.cc", "src/cpp/common/completion_queue_cc.cc", "src/cpp/common/core_codegen.cc", + "src/cpp/common/health_check_service_server_builder_option.cc", "src/cpp/common/resource_quota_cc.cc", "src/cpp/common/rpc_method.cc", "src/cpp/common/version_cc.cc", @@ -2038,6 +2040,7 @@ cc_library( "src/cpp/common/channel_filter.cc", "src/cpp/common/completion_queue_cc.cc", "src/cpp/common/core_codegen.cc", + "src/cpp/common/health_check_service_server_builder_option.cc", "src/cpp/common/resource_quota_cc.cc", "src/cpp/common/rpc_method.cc", "src/cpp/common/version_cc.cc", diff --git a/CMakeLists.txt b/CMakeLists.txt index 90cf1cdc77..e90e8426cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1085,6 +1085,7 @@ add_library(grpc++ src/cpp/common/channel_filter.cc src/cpp/common/completion_queue_cc.cc src/cpp/common/core_codegen.cc + src/cpp/common/health_check_service_server_builder_option.cc src/cpp/common/resource_quota_cc.cc src/cpp/common/rpc_method.cc src/cpp/common/version_cc.cc @@ -1245,6 +1246,7 @@ add_library(grpc++_cronet src/cpp/common/channel_filter.cc src/cpp/common/completion_queue_cc.cc src/cpp/common/core_codegen.cc + src/cpp/common/health_check_service_server_builder_option.cc src/cpp/common/resource_quota_cc.cc src/cpp/common/rpc_method.cc src/cpp/common/version_cc.cc @@ -1628,6 +1630,7 @@ add_library(grpc++_unsecure src/cpp/common/channel_filter.cc src/cpp/common/completion_queue_cc.cc src/cpp/common/core_codegen.cc + src/cpp/common/health_check_service_server_builder_option.cc src/cpp/common/resource_quota_cc.cc src/cpp/common/rpc_method.cc src/cpp/common/version_cc.cc diff --git a/Makefile b/Makefile index 85074b5b81..45d3cb2963 100644 --- a/Makefile +++ b/Makefile @@ -3779,6 +3779,7 @@ LIBGRPC++_SRC = \ src/cpp/common/channel_filter.cc \ src/cpp/common/completion_queue_cc.cc \ src/cpp/common/core_codegen.cc \ + src/cpp/common/health_check_service_server_builder_option.cc \ src/cpp/common/resource_quota_cc.cc \ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ @@ -3968,6 +3969,7 @@ LIBGRPC++_CRONET_SRC = \ src/cpp/common/channel_filter.cc \ src/cpp/common/completion_queue_cc.cc \ src/cpp/common/core_codegen.cc \ + src/cpp/common/health_check_service_server_builder_option.cc \ src/cpp/common/resource_quota_cc.cc \ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ @@ -4678,6 +4680,7 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/common/channel_filter.cc \ src/cpp/common/completion_queue_cc.cc \ src/cpp/common/core_codegen.cc \ + src/cpp/common/health_check_service_server_builder_option.cc \ src/cpp/common/resource_quota_cc.cc \ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ diff --git a/build.yaml b/build.yaml index 25c4dd7fbf..25dc9e0fcb 100644 --- a/build.yaml +++ b/build.yaml @@ -774,6 +774,7 @@ filegroups: - src/cpp/common/channel_filter.cc - src/cpp/common/completion_queue_cc.cc - src/cpp/common/core_codegen.cc + - src/cpp/common/health_check_service_server_builder_option.cc - src/cpp/common/resource_quota_cc.cc - src/cpp/common/rpc_method.cc - src/cpp/common/version_cc.cc diff --git a/include/grpc++/ext/health_check_service_server_builder_option.h b/include/grpc++/ext/health_check_service_server_builder_option.h index 9da1d18c98..fb5263d742 100644 --- a/include/grpc++/ext/health_check_service_server_builder_option.h +++ b/include/grpc++/ext/health_check_service_server_builder_option.h @@ -36,21 +36,25 @@ #include +#include +#include #include namespace grpc { -class HealthCheckServiceInterface; - class HealthCheckServiceServerBuilderOption : public ServerBuilderOption { public: explicit HealthCheckServiceServerBuilderOption( std::unique_ptr hc); + ~HealthCheckServiceServerBuilderOption() {} void UpdateArguments(ChannelArguments* args) override; + void UpdatePlugins(std::vector>* plugins) override; private: std::unique_ptr hc_; }; +void EnableDefaultHealthCheckService(bool enable); + } // namespace grpc #endif // GRPCXX_EXT_HEALTH_CHECK_SERVICE_SERVER_BUILDER_OPTION_H diff --git a/src/cpp/ext/health_check_service_server_builder_option.cc b/src/cpp/ext/health_check_service_server_builder_option.cc new file mode 100644 index 0000000000..dab5731e89 --- /dev/null +++ b/src/cpp/ext/health_check_service_server_builder_option.cc @@ -0,0 +1,59 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include + +namespace grpc { +namespace { +bool g_grpc_default_health_check_service_enabled = false; +const char kDefaultHealthCheckServiceInterfaceArg[] = "grpc.default_health_check_service_interface"; +} // namesapce + +HealthCheckServiceServerBuilderOption::HealthCheckServiceServerBuilderOption( + std::unique_ptr hc) : hc_(std::move(hc)) { } + +HealthCheckServiceServerBuilderOption::UpdateArguments(ChannelArguments* args) override { + args->SetPointer(kDefaultHealthCheckServiceInterfaceArg, hc_.release()); +} + +void HealthCheckServiceServerBuilderOption::UpdatePlugins(std::vector>* plugins) override { + +} + +void EnableDefaultHealthCheckService(bool enable) { + g_grpc_default_health_check_service_enabled = enable; +} + +} // namespace grpc + + diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index f2e871e7bd..ac20f0fc02 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -877,6 +877,7 @@ src/cpp/common/channel_arguments.cc \ src/cpp/common/channel_filter.cc \ src/cpp/common/completion_queue_cc.cc \ src/cpp/common/core_codegen.cc \ +src/cpp/common/health_check_service_server_builder_option.cc \ src/cpp/common/resource_quota_cc.cc \ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 4fd90ed24e..cb92999b26 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -7723,6 +7723,7 @@ "src/cpp/common/channel_filter.h", "src/cpp/common/completion_queue_cc.cc", "src/cpp/common/core_codegen.cc", + "src/cpp/common/health_check_service_server_builder_option.cc", "src/cpp/common/resource_quota_cc.cc", "src/cpp/common/rpc_method.cc", "src/cpp/common/version_cc.cc", diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj b/vsprojects/vcxproj/grpc++/grpc++.vcxproj index b8d4176f8a..468accbd23 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj @@ -398,6 +398,8 @@ + + diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters index b7eae651bd..d21b97b8df 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters @@ -58,6 +58,9 @@ src\cpp\common + + src\cpp\common + src\cpp\common diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj index 4b6d448f91..f0e3f3a23e 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj @@ -384,6 +384,8 @@ + + diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters index deec6d7105..6076dbc693 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters @@ -43,6 +43,9 @@ src\cpp\common + + src\cpp\common + src\cpp\common -- cgit v1.2.3 From 8d668d8324c3aa24353b3774a8f6ce35edbf20b7 Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 1 Dec 2016 15:09:28 -0800 Subject: default service --- BUILD | 9 +++ CMakeLists.txt | 6 ++ Makefile | 6 ++ build.yaml | 3 + .../grpc++/ext/health_check_service_interface.h | 52 ----------------- .../health_check_service_server_builder_option.h | 5 +- include/grpc++/health_check_service_interface.h | 63 ++++++++++++++++++++ include/grpc++/server.h | 9 +++ .../health_check_service_server_builder_option.cc | 12 +--- src/cpp/server/default_health_check_service.cc | 67 ++++++++++++++++++++++ src/cpp/server/default_health_check_service.h | 59 +++++++++++++++++++ src/cpp/server/health_check_service.cc | 49 ++++++++++++++++ src/cpp/server/server_cc.cc | 33 ++++++++++- tools/doxygen/Doxyfile.c++.internal | 3 + tools/run_tests/generated/sources_and_headers.json | 4 ++ vsprojects/vcxproj/grpc++/grpc++.vcxproj | 5 ++ vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters | 9 +++ .../grpc++_unsecure/grpc++_unsecure.vcxproj | 5 ++ .../grpc++_unsecure.vcxproj.filters | 9 +++ 19 files changed, 341 insertions(+), 67 deletions(-) delete mode 100644 include/grpc++/ext/health_check_service_interface.h create mode 100644 include/grpc++/health_check_service_interface.h create mode 100644 src/cpp/server/default_health_check_service.cc create mode 100644 src/cpp/server/default_health_check_service.h create mode 100644 src/cpp/server/health_check_service.cc (limited to 'BUILD') diff --git a/BUILD b/BUILD index fcd2742a8f..be1e23007b 100644 --- a/BUILD +++ b/BUILD @@ -1374,6 +1374,7 @@ cc_library( "src/cpp/server/secure_server_credentials.h", "src/cpp/client/create_channel_internal.h", "src/cpp/common/channel_filter.h", + "src/cpp/server/default_health_check_service.h", "src/cpp/server/dynamic_thread_pool.h", "src/cpp/server/thread_pool_interface.h", "src/cpp/thread_manager/thread_manager.h", @@ -1402,7 +1403,9 @@ cc_library( "src/cpp/common/version_cc.cc", "src/cpp/server/async_generic_service.cc", "src/cpp/server/create_default_thread_pool.cc", + "src/cpp/server/default_health_check_service.cc", "src/cpp/server/dynamic_thread_pool.cc", + "src/cpp/server/health_check_service.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", @@ -1525,6 +1528,7 @@ cc_library( srcs = [ "src/cpp/client/create_channel_internal.h", "src/cpp/common/channel_filter.h", + "src/cpp/server/default_health_check_service.h", "src/cpp/server/dynamic_thread_pool.h", "src/cpp/server/thread_pool_interface.h", "src/cpp/thread_manager/thread_manager.h", @@ -1695,7 +1699,9 @@ cc_library( "src/cpp/common/version_cc.cc", "src/cpp/server/async_generic_service.cc", "src/cpp/server/create_default_thread_pool.cc", + "src/cpp/server/default_health_check_service.cc", "src/cpp/server/dynamic_thread_pool.cc", + "src/cpp/server/health_check_service.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", @@ -2023,6 +2029,7 @@ cc_library( srcs = [ "src/cpp/client/create_channel_internal.h", "src/cpp/common/channel_filter.h", + "src/cpp/server/default_health_check_service.h", "src/cpp/server/dynamic_thread_pool.h", "src/cpp/server/thread_pool_interface.h", "src/cpp/thread_manager/thread_manager.h", @@ -2046,7 +2053,9 @@ cc_library( "src/cpp/common/version_cc.cc", "src/cpp/server/async_generic_service.cc", "src/cpp/server/create_default_thread_pool.cc", + "src/cpp/server/default_health_check_service.cc", "src/cpp/server/dynamic_thread_pool.cc", + "src/cpp/server/health_check_service.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", diff --git a/CMakeLists.txt b/CMakeLists.txt index e90e8426cc..049f7fdaca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1091,7 +1091,9 @@ add_library(grpc++ src/cpp/common/version_cc.cc src/cpp/server/async_generic_service.cc src/cpp/server/create_default_thread_pool.cc + src/cpp/server/default_health_check_service.cc src/cpp/server/dynamic_thread_pool.cc + src/cpp/server/health_check_service.cc src/cpp/server/server_builder.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc @@ -1252,7 +1254,9 @@ add_library(grpc++_cronet src/cpp/common/version_cc.cc src/cpp/server/async_generic_service.cc src/cpp/server/create_default_thread_pool.cc + src/cpp/server/default_health_check_service.cc src/cpp/server/dynamic_thread_pool.cc + src/cpp/server/health_check_service.cc src/cpp/server/server_builder.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc @@ -1636,7 +1640,9 @@ add_library(grpc++_unsecure src/cpp/common/version_cc.cc src/cpp/server/async_generic_service.cc src/cpp/server/create_default_thread_pool.cc + src/cpp/server/default_health_check_service.cc src/cpp/server/dynamic_thread_pool.cc + src/cpp/server/health_check_service.cc src/cpp/server/server_builder.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc diff --git a/Makefile b/Makefile index 45d3cb2963..63f5d2ad31 100644 --- a/Makefile +++ b/Makefile @@ -3785,7 +3785,9 @@ LIBGRPC++_SRC = \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ src/cpp/server/create_default_thread_pool.cc \ + src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ + src/cpp/server/health_check_service.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ @@ -3975,7 +3977,9 @@ LIBGRPC++_CRONET_SRC = \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ src/cpp/server/create_default_thread_pool.cc \ + src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ + src/cpp/server/health_check_service.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ @@ -4686,7 +4690,9 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ src/cpp/server/create_default_thread_pool.cc \ + src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ + src/cpp/server/health_check_service.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ diff --git a/build.yaml b/build.yaml index 25dc9e0fcb..925c73b729 100644 --- a/build.yaml +++ b/build.yaml @@ -759,6 +759,7 @@ filegroups: headers: - src/cpp/client/create_channel_internal.h - src/cpp/common/channel_filter.h + - src/cpp/server/default_health_check_service.h - src/cpp/server/dynamic_thread_pool.h - src/cpp/server/thread_pool_interface.h - src/cpp/thread_manager/thread_manager.h @@ -780,7 +781,9 @@ filegroups: - src/cpp/common/version_cc.cc - src/cpp/server/async_generic_service.cc - src/cpp/server/create_default_thread_pool.cc + - src/cpp/server/default_health_check_service.cc - src/cpp/server/dynamic_thread_pool.cc + - src/cpp/server/health_check_service.cc - src/cpp/server/server_builder.cc - src/cpp/server/server_cc.cc - src/cpp/server/server_context.cc diff --git a/include/grpc++/ext/health_check_service_interface.h b/include/grpc++/ext/health_check_service_interface.h deleted file mode 100644 index b9f4ebb87f..0000000000 --- a/include/grpc++/ext/health_check_service_interface.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPCXX_EXT_HEALTH_CHECK_SERVICE_INTERFACE_H -#define GRPCXX_EXT_HEALTH_CHECK_SERVICE_INTERFACE_H - -#include - -namespace grpc { - -class HealthCheckServiceInterface { - public: - virtual ~HealthCheckServiceInterface() { } - virtual void SetServingStatus(const grpc::string& service_name, bool serving) = 0; - // Apply to all registered service names. - virtual void SetServingStatus(bool serving) = 0; -}; - - -} // namespace grpc - -#endif // GRPCXX_EXT_HEALTH_CHECK_SERVICE_INTERFACE_H diff --git a/include/grpc++/ext/health_check_service_server_builder_option.h b/include/grpc++/ext/health_check_service_server_builder_option.h index fb5263d742..e00c4c3dd5 100644 --- a/include/grpc++/ext/health_check_service_server_builder_option.h +++ b/include/grpc++/ext/health_check_service_server_builder_option.h @@ -36,7 +36,7 @@ #include -#include +#include #include #include @@ -44,6 +44,7 @@ namespace grpc { class HealthCheckServiceServerBuilderOption : public ServerBuilderOption { public: + // Use nullptr to disable default service. explicit HealthCheckServiceServerBuilderOption( std::unique_ptr hc); ~HealthCheckServiceServerBuilderOption() {} @@ -53,8 +54,6 @@ class HealthCheckServiceServerBuilderOption : public ServerBuilderOption { std::unique_ptr hc_; }; -void EnableDefaultHealthCheckService(bool enable); - } // namespace grpc #endif // GRPCXX_EXT_HEALTH_CHECK_SERVICE_SERVER_BUILDER_OPTION_H diff --git a/include/grpc++/health_check_service_interface.h b/include/grpc++/health_check_service_interface.h new file mode 100644 index 0000000000..70153d65cb --- /dev/null +++ b/include/grpc++/health_check_service_interface.h @@ -0,0 +1,63 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPCXX_HEALTH_CHECK_SERVICE_INTERFACE_H +#define GRPCXX_HEALTH_CHECK_SERVICE_INTERFACE_H + +#include + +namespace grpc { + +const char kDefaultHealthCheckServiceInterfaceArg[] = + "grpc.default_health_check_service_interface"; + +class HealthCheckServiceInterface { + public: + virtual ~HealthCheckServiceInterface() {} + virtual void SetServingStatus(const grpc::string& service_name, + bool serving) = 0; + // Apply to all registered service names. + virtual void SetServingStatus(bool serving) = 0; +}; + +bool DefaultHealthCheckServiceEnabled(); + +// Enable/disable the default health checking service. This applies to all C++ +// servers created afterwards. For each server, user can override the default +// with a HealthCheckServiceServerBuilderOption. +// NOT thread safe. +void EnableDefaultHealthCheckService(bool enable); + +} // namespace grpc + +#endif // GRPCXX_HEALTH_CHECK_SERVICE_INTERFACE_H diff --git a/include/grpc++/server.h b/include/grpc++/server.h index fba9952e6e..511dc35564 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -97,6 +97,11 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen { // Returns a \em raw pointer to the underlying grpc_server instance. grpc_server* c_server(); + /// Returns the health check service. + HealthCheckServiceInterface* GetHealthCheckService() const { + return hc_.get(); + } + private: friend class AsyncGenericService; friend class ServerBuilder; @@ -214,6 +219,10 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen { grpc_server* server_; std::unique_ptr server_initializer_; + + std::unique_ptr health_check_service_; + // User explicitly disabled health check service. + bool health_check_service_disabled_; }; } // namespace grpc diff --git a/src/cpp/ext/health_check_service_server_builder_option.cc b/src/cpp/ext/health_check_service_server_builder_option.cc index dab5731e89..4afc82dc14 100644 --- a/src/cpp/ext/health_check_service_server_builder_option.cc +++ b/src/cpp/ext/health_check_service_server_builder_option.cc @@ -34,26 +34,16 @@ #include namespace grpc { -namespace { -bool g_grpc_default_health_check_service_enabled = false; -const char kDefaultHealthCheckServiceInterfaceArg[] = "grpc.default_health_check_service_interface"; -} // namesapce HealthCheckServiceServerBuilderOption::HealthCheckServiceServerBuilderOption( std::unique_ptr hc) : hc_(std::move(hc)) { } HealthCheckServiceServerBuilderOption::UpdateArguments(ChannelArguments* args) override { - args->SetPointer(kDefaultHealthCheckServiceInterfaceArg, hc_.release()); + args->SetPointer(DefaultHealthCheckServiceInterfaceArg(), hc_.release()); } void HealthCheckServiceServerBuilderOption::UpdatePlugins(std::vector>* plugins) override { - -} - -void EnableDefaultHealthCheckService(bool enable) { - g_grpc_default_health_check_service_enabled = enable; } } // namespace grpc - diff --git a/src/cpp/server/default_health_check_service.cc b/src/cpp/server/default_health_check_service.cc new file mode 100644 index 0000000000..eec7e2cd58 --- /dev/null +++ b/src/cpp/server/default_health_check_service.cc @@ -0,0 +1,67 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/cpp/server/default_health_check_service.h" + +namespace grpc { + +DefaultHealthCheckService::DefaultHealthCheckService() { + services_map_.insert("", true); +} + +void DefaultHealthCheckService::SetServingStatus( + const grpc::string& service_name, bool serving) override { + std::lock_guard lock(mu_); + services_map_[service_name] = serving; +} + +void SetServingStatus(bool serving) override { + std::lock_guard lock(mu_); + for (auto& iter = services_map_.begin(); iter != services_map_.end(); + ++iter) { + iter->second = serving; + } +} + +ServingStatus GetServingStatus(const grpc::string& service_name) const { + std::lock_guard lock(mu_); + const auto& iter = services_map_.find(service_name); + if (iter == services_map_.end()) { + return NOT_FOUND; + } + return iter->second ? SERVING : NOT_SERVING; +} + +} // namespace grpc + +#endif // GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H diff --git a/src/cpp/server/default_health_check_service.h b/src/cpp/server/default_health_check_service.h new file mode 100644 index 0000000000..51afa6491e --- /dev/null +++ b/src/cpp/server/default_health_check_service.h @@ -0,0 +1,59 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H +#define GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H + +#include + +#include + +namespace grpc { + +class DefaultHealthCheckService : public HealthCheckServiceInterface { + public: + DefaultHealthCheckService(); + void SetServingStatus(const grpc::string& service_name, + bool serving) override; + void SetServingStatus(bool serving) override; + enum ServingStatus { NOT_FOUND, SERVING, NOT_SERVING }; + ServingStatus GetServingStatus(const grpc::string& service_name) const; + + private: + std::mutex mu_; + std::map services_map_; +}; + +} // namespace grpc + +#endif // GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H diff --git a/src/cpp/server/health_check_service.cc b/src/cpp/server/health_check_service.cc new file mode 100644 index 0000000000..cca68c5549 --- /dev/null +++ b/src/cpp/server/health_check_service.cc @@ -0,0 +1,49 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include + +namespace grpc { +namespace { +bool g_grpc_default_health_check_service_enabled = false; +} // namesapce + +bool DefaultHealthCheckServiceEnabled() { + return g_grpc_default_health_check_service_enabled; +} + +void EnableDefaultHealthCheckService(bool enable) { + g_grpc_default_health_check_service_enabled = enable; +} + +} // namespace grpc diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 817d85a81c..037da2b301 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -342,6 +343,7 @@ class Server::SyncRequestThreadManager : public ThreadManager { int cq_timeout_msec_; std::vector> sync_requests_; std::unique_ptr unknown_method_; + std::unique_ptr health_check_; std::shared_ptr global_callbacks_; }; @@ -358,7 +360,8 @@ Server::Server( shutdown_notified_(false), has_generic_service_(false), server_(nullptr), - server_initializer_(new ServerInitializer(this)) { + server_initializer_(new ServerInitializer(this)), + health_check_service_disabled_(false) { g_gli_initializer.summon(); gpr_once_init(&g_once_init_callbacks, InitGlobalCallbacks); global_callbacks_ = g_callbacks; @@ -374,6 +377,18 @@ Server::Server( grpc_channel_args channel_args; args->SetChannelArgs(&channel_args); + for (size_t i = 0; i < channel_args.num_args; i++) { + if (0 == strcmp(channel_args.args[i].key, + kDefaultHealthCheckServiceInterfaceArg)) { + if (channel_args.args[i].value == nullptr) { + health_check_service_disabled_ = true; + } else { + health_check_service_.reset(channel_args.args[i].value); + } + break; + } + } + server_ = grpc_server_create(&channel_args, nullptr); } @@ -481,6 +496,22 @@ bool Server::Start(ServerCompletionQueue** cqs, size_t num_cqs) { started_ = true; grpc_server_start(server_); + // Only create default health check service when user did not provide an + // explicit one. + if (health_check_service_ == nullptr && !health_check_service_disabled_ && + EnableDefaultHealthCheckService()) { + health_check_service_.reset(CreateDefaultHealthCheckService()); + for (auto it = sync_req_mgrs_.begin(); it != sync_req_mgrs_.end(); it++) { + (*it)->AddHealthCheckSyncMethod(); + } + + for (size_t i = 0; i < num_cqs; i++) { + if (cqs[i]->IsFrequentlyPolled()) { + // new UnimplementedAsyncRequest(this, cqs[i]); + } + } + } + if (!has_generic_service_) { for (auto it = sync_req_mgrs_.begin(); it != sync_req_mgrs_.end(); it++) { (*it)->AddUnknownSyncMethod(); diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index ac20f0fc02..aa79aedeb9 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -855,6 +855,7 @@ src/cpp/common/secure_auth_context.h \ src/cpp/server/secure_server_credentials.h \ src/cpp/client/create_channel_internal.h \ src/cpp/common/channel_filter.h \ +src/cpp/server/default_health_check_service.h \ src/cpp/server/dynamic_thread_pool.h \ src/cpp/server/thread_pool_interface.h \ src/cpp/thread_manager/thread_manager.h \ @@ -883,7 +884,9 @@ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ src/cpp/server/create_default_thread_pool.cc \ +src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ +src/cpp/server/health_check_service.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index cb92999b26..860a151f48 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -7658,6 +7658,7 @@ "include/grpc++/support/time.h", "src/cpp/client/create_channel_internal.h", "src/cpp/common/channel_filter.h", + "src/cpp/server/default_health_check_service.h", "src/cpp/server/dynamic_thread_pool.h", "src/cpp/server/thread_pool_interface.h", "src/cpp/thread_manager/thread_manager.h" @@ -7729,8 +7730,11 @@ "src/cpp/common/version_cc.cc", "src/cpp/server/async_generic_service.cc", "src/cpp/server/create_default_thread_pool.cc", + "src/cpp/server/default_health_check_service.cc", + "src/cpp/server/default_health_check_service.h", "src/cpp/server/dynamic_thread_pool.cc", "src/cpp/server/dynamic_thread_pool.h", + "src/cpp/server/health_check_service.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj b/vsprojects/vcxproj/grpc++/grpc++.vcxproj index 468accbd23..a57ed0e2e5 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj @@ -355,6 +355,7 @@ + @@ -410,8 +411,12 @@ + + + + diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters index d21b97b8df..e455636abe 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters @@ -76,9 +76,15 @@ src\cpp\server + + src\cpp\server + src\cpp\server + + src\cpp\server + src\cpp\server @@ -404,6 +410,9 @@ src\cpp\common + + src\cpp\server + src\cpp\server diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj index f0e3f3a23e..10c9be3339 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj @@ -351,6 +351,7 @@ + @@ -396,8 +397,12 @@ + + + + diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters index 6076dbc693..0b65ff3fe8 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters @@ -61,9 +61,15 @@ src\cpp\server + + src\cpp\server + src\cpp\server + + src\cpp\server + src\cpp\server @@ -377,6 +383,9 @@ src\cpp\common + + src\cpp\server + src\cpp\server -- cgit v1.2.3 From c9d2954e556db3f102a858d97e339edb9db0388c Mon Sep 17 00:00:00 2001 From: yang-g Date: Tue, 6 Dec 2016 14:20:17 -0800 Subject: more --- BUILD | 6 +-- CMakeLists.txt | 6 +-- Makefile | 6 +-- build.yaml | 2 +- include/grpc++/server.h | 8 +--- src/cpp/server/default_health_check_service.cc | 23 ++++++++++ src/cpp/server/default_health_check_service.h | 22 ++++++++-- .../health_check_service_server_builder_option.cc | 50 ++++++++++++++++++++++ src/cpp/server/server_cc.cc | 29 +++++-------- tools/doxygen/Doxyfile.c++.internal | 2 +- tools/run_tests/generated/sources_and_headers.json | 2 +- vsprojects/vcxproj/grpc++/grpc++.vcxproj | 4 +- vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters | 6 +-- .../grpc++_unsecure/grpc++_unsecure.vcxproj | 4 +- .../grpc++_unsecure.vcxproj.filters | 6 +-- 15 files changed, 127 insertions(+), 49 deletions(-) create mode 100644 src/cpp/server/health_check_service_server_builder_option.cc (limited to 'BUILD') diff --git a/BUILD b/BUILD index be1e23007b..6e786607cc 100644 --- a/BUILD +++ b/BUILD @@ -1397,7 +1397,6 @@ cc_library( "src/cpp/common/channel_filter.cc", "src/cpp/common/completion_queue_cc.cc", "src/cpp/common/core_codegen.cc", - "src/cpp/common/health_check_service_server_builder_option.cc", "src/cpp/common/resource_quota_cc.cc", "src/cpp/common/rpc_method.cc", "src/cpp/common/version_cc.cc", @@ -1406,6 +1405,7 @@ cc_library( "src/cpp/server/default_health_check_service.cc", "src/cpp/server/dynamic_thread_pool.cc", "src/cpp/server/health_check_service.cc", + "src/cpp/server/health_check_service_server_builder_option.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", @@ -1693,7 +1693,6 @@ cc_library( "src/cpp/common/channel_filter.cc", "src/cpp/common/completion_queue_cc.cc", "src/cpp/common/core_codegen.cc", - "src/cpp/common/health_check_service_server_builder_option.cc", "src/cpp/common/resource_quota_cc.cc", "src/cpp/common/rpc_method.cc", "src/cpp/common/version_cc.cc", @@ -1702,6 +1701,7 @@ cc_library( "src/cpp/server/default_health_check_service.cc", "src/cpp/server/dynamic_thread_pool.cc", "src/cpp/server/health_check_service.cc", + "src/cpp/server/health_check_service_server_builder_option.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", @@ -2047,7 +2047,6 @@ cc_library( "src/cpp/common/channel_filter.cc", "src/cpp/common/completion_queue_cc.cc", "src/cpp/common/core_codegen.cc", - "src/cpp/common/health_check_service_server_builder_option.cc", "src/cpp/common/resource_quota_cc.cc", "src/cpp/common/rpc_method.cc", "src/cpp/common/version_cc.cc", @@ -2056,6 +2055,7 @@ cc_library( "src/cpp/server/default_health_check_service.cc", "src/cpp/server/dynamic_thread_pool.cc", "src/cpp/server/health_check_service.cc", + "src/cpp/server/health_check_service_server_builder_option.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", diff --git a/CMakeLists.txt b/CMakeLists.txt index 049f7fdaca..c32a4aaf96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1085,7 +1085,6 @@ add_library(grpc++ src/cpp/common/channel_filter.cc src/cpp/common/completion_queue_cc.cc src/cpp/common/core_codegen.cc - src/cpp/common/health_check_service_server_builder_option.cc src/cpp/common/resource_quota_cc.cc src/cpp/common/rpc_method.cc src/cpp/common/version_cc.cc @@ -1094,6 +1093,7 @@ add_library(grpc++ src/cpp/server/default_health_check_service.cc src/cpp/server/dynamic_thread_pool.cc src/cpp/server/health_check_service.cc + src/cpp/server/health_check_service_server_builder_option.cc src/cpp/server/server_builder.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc @@ -1248,7 +1248,6 @@ add_library(grpc++_cronet src/cpp/common/channel_filter.cc src/cpp/common/completion_queue_cc.cc src/cpp/common/core_codegen.cc - src/cpp/common/health_check_service_server_builder_option.cc src/cpp/common/resource_quota_cc.cc src/cpp/common/rpc_method.cc src/cpp/common/version_cc.cc @@ -1257,6 +1256,7 @@ add_library(grpc++_cronet src/cpp/server/default_health_check_service.cc src/cpp/server/dynamic_thread_pool.cc src/cpp/server/health_check_service.cc + src/cpp/server/health_check_service_server_builder_option.cc src/cpp/server/server_builder.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc @@ -1634,7 +1634,6 @@ add_library(grpc++_unsecure src/cpp/common/channel_filter.cc src/cpp/common/completion_queue_cc.cc src/cpp/common/core_codegen.cc - src/cpp/common/health_check_service_server_builder_option.cc src/cpp/common/resource_quota_cc.cc src/cpp/common/rpc_method.cc src/cpp/common/version_cc.cc @@ -1643,6 +1642,7 @@ add_library(grpc++_unsecure src/cpp/server/default_health_check_service.cc src/cpp/server/dynamic_thread_pool.cc src/cpp/server/health_check_service.cc + src/cpp/server/health_check_service_server_builder_option.cc src/cpp/server/server_builder.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc diff --git a/Makefile b/Makefile index 63f5d2ad31..43ef3c4f06 100644 --- a/Makefile +++ b/Makefile @@ -3779,7 +3779,6 @@ LIBGRPC++_SRC = \ src/cpp/common/channel_filter.cc \ src/cpp/common/completion_queue_cc.cc \ src/cpp/common/core_codegen.cc \ - src/cpp/common/health_check_service_server_builder_option.cc \ src/cpp/common/resource_quota_cc.cc \ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ @@ -3788,6 +3787,7 @@ LIBGRPC++_SRC = \ src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ src/cpp/server/health_check_service.cc \ + src/cpp/server/health_check_service_server_builder_option.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ @@ -3971,7 +3971,6 @@ LIBGRPC++_CRONET_SRC = \ src/cpp/common/channel_filter.cc \ src/cpp/common/completion_queue_cc.cc \ src/cpp/common/core_codegen.cc \ - src/cpp/common/health_check_service_server_builder_option.cc \ src/cpp/common/resource_quota_cc.cc \ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ @@ -3980,6 +3979,7 @@ LIBGRPC++_CRONET_SRC = \ src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ src/cpp/server/health_check_service.cc \ + src/cpp/server/health_check_service_server_builder_option.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ @@ -4684,7 +4684,6 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/common/channel_filter.cc \ src/cpp/common/completion_queue_cc.cc \ src/cpp/common/core_codegen.cc \ - src/cpp/common/health_check_service_server_builder_option.cc \ src/cpp/common/resource_quota_cc.cc \ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ @@ -4693,6 +4692,7 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ src/cpp/server/health_check_service.cc \ + src/cpp/server/health_check_service_server_builder_option.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ diff --git a/build.yaml b/build.yaml index 925c73b729..f02142717d 100644 --- a/build.yaml +++ b/build.yaml @@ -775,7 +775,6 @@ filegroups: - src/cpp/common/channel_filter.cc - src/cpp/common/completion_queue_cc.cc - src/cpp/common/core_codegen.cc - - src/cpp/common/health_check_service_server_builder_option.cc - src/cpp/common/resource_quota_cc.cc - src/cpp/common/rpc_method.cc - src/cpp/common/version_cc.cc @@ -784,6 +783,7 @@ filegroups: - src/cpp/server/default_health_check_service.cc - src/cpp/server/dynamic_thread_pool.cc - src/cpp/server/health_check_service.cc + - src/cpp/server/health_check_service_server_builder_option.cc - src/cpp/server/server_builder.cc - src/cpp/server/server_cc.cc - src/cpp/server/server_context.cc diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 511dc35564..dc97a0ec4c 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -55,12 +55,10 @@ struct grpc_server; namespace grpc { -class GenericServerContext; class AsyncGenericService; -class ServerAsyncStreamingInterface; +class HealthCheckServiceInterface; class ServerContext; class ServerInitializer; -class ThreadPoolInterface; /// Models a gRPC server. /// @@ -99,7 +97,7 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen { /// Returns the health check service. HealthCheckServiceInterface* GetHealthCheckService() const { - return hc_.get(); + return health_check_service_.get(); } private: @@ -221,8 +219,6 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen { std::unique_ptr server_initializer_; std::unique_ptr health_check_service_; - // User explicitly disabled health check service. - bool health_check_service_disabled_; }; } // namespace grpc diff --git a/src/cpp/server/default_health_check_service.cc b/src/cpp/server/default_health_check_service.cc index eec7e2cd58..45f51a97b6 100644 --- a/src/cpp/server/default_health_check_service.cc +++ b/src/cpp/server/default_health_check_service.cc @@ -34,6 +34,29 @@ #include "src/cpp/server/default_health_check_service.h" namespace grpc { +namespace { + +const char kHealthCheckMethodName[] = "/grpc.health.v1.Health/Check"; + +} // namespace + +SyncHealthCheckServiceImpl::SyncHealthCheckServiceImpl( + DefaultHealthCheckService* service) + : service_(service) { + auto* handler = + new RpcMethodHandler( + std::mem_fn(&SyncHealthCheckServiceImpl::Check), this); + auto* method = new RpcServiceMethod(kHealthCheckMethodName, + RpcMethod::NORMAL_RPC, handler); + AddMethod(mehtod); +} + +Status SyncHealthCheckServiceImpl::Check(ServerContext* context, + const ByteBuffer* request, + ByteBuffer* response) { + // TODO nanopb + return Status::OK; +} DefaultHealthCheckService::DefaultHealthCheckService() { services_map_.insert("", true); diff --git a/src/cpp/server/default_health_check_service.h b/src/cpp/server/default_health_check_service.h index 51afa6491e..a2545c50e7 100644 --- a/src/cpp/server/default_health_check_service.h +++ b/src/cpp/server/default_health_check_service.h @@ -37,21 +37,37 @@ #include #include +#include namespace grpc { +class SyncHealthCheckServiceImpl : public Service { + public: + explicit SyncHealthCheckServiceImpl(DefaultHealthCheckService* service); + Status Check(ServerContext* context, const ByteBuffer* request, + ByteBuffer* response); + + private: + const DefaultHealthCheckService* service_; +}; + +// Default implementation of HealthCheckServiceInterface. Server will create and +// own it. class DefaultHealthCheckService : public HealthCheckServiceInterface { public: DefaultHealthCheckService(); - void SetServingStatus(const grpc::string& service_name, - bool serving) override; - void SetServingStatus(bool serving) override; + void SetServingStatus(const grpc::string& service_name, bool serving) final; + void SetServingStatus(bool serving) final; enum ServingStatus { NOT_FOUND, SERVING, NOT_SERVING }; ServingStatus GetServingStatus(const grpc::string& service_name) const; + SyncHealthCheckServiceImpl* GetSyncHealthCheckService() const { + return sync_service_.get(); + } private: std::mutex mu_; std::map services_map_; + std::unique_ptr sync_service_; }; } // namespace grpc diff --git a/src/cpp/server/health_check_service_server_builder_option.cc b/src/cpp/server/health_check_service_server_builder_option.cc new file mode 100644 index 0000000000..80004b77fa --- /dev/null +++ b/src/cpp/server/health_check_service_server_builder_option.cc @@ -0,0 +1,50 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include + +namespace grpc { + +HealthCheckServiceServerBuilderOption::HealthCheckServiceServerBuilderOption( + std::unique_ptr hc) + : hc_(std::move(hc)) {} +// Hand over hc_ to the server. +void HealthCheckServiceServerBuilderOption::UpdateArguments( + ChannelArguments* args) override { + args->SetPointer(kDefaultHealthCheckServiceInterfaceArg, hc_.release()); +} + +void HealthCheckServiceServerBuilderOption::UpdatePlugins( + std::vector>* plugins) override {} + +} // namespace grpc diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 5d4da92f2b..03210883bf 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -370,8 +370,7 @@ Server::Server( shutdown_notified_(false), has_generic_service_(false), server_(nullptr), - server_initializer_(new ServerInitializer(this)), - health_check_service_disabled_(false) { + server_initializer_(new ServerInitializer(this)) { g_gli_initializer.summon(); gpr_once_init(&g_once_init_callbacks, InitGlobalCallbacks); global_callbacks_ = g_callbacks; @@ -387,6 +386,7 @@ Server::Server( grpc_channel_args channel_args; args->SetChannelArgs(&channel_args); + bool health_check_service_disabled = false; for (size_t i = 0; i < channel_args.num_args; i++) { if (0 == strcmp(channel_args.args[i].key, kDefaultHealthCheckServiceInterfaceArg)) { @@ -398,6 +398,15 @@ Server::Server( break; } } + // Only create default health check service when user did not provide an + // explicit one. + if (health_check_service_ == nullptr && !health_check_service_disabled && + EnableDefaultHealthCheckService()) { + health_check_service_.reset(new DefaultHealthCheckService); + if (!sync_server_cqs->empty()) { // Has sync methods. + RegisterService(health_check_service_->GetSyncHealthCheckService()); + } + } server_ = grpc_server_create(&channel_args, nullptr); } @@ -506,22 +515,6 @@ bool Server::Start(ServerCompletionQueue** cqs, size_t num_cqs) { started_ = true; grpc_server_start(server_); - // Only create default health check service when user did not provide an - // explicit one. - if (health_check_service_ == nullptr && !health_check_service_disabled_ && - EnableDefaultHealthCheckService()) { - health_check_service_.reset(new DefaultHealthCheckService); - for (auto it = sync_req_mgrs_.begin(); it != sync_req_mgrs_.end(); it++) { - (*it)->AddHealthCheckSyncMethod(); - } - - for (size_t i = 0; i < num_cqs; i++) { - if (cqs[i]->IsFrequentlyPolled()) { - // new UnimplementedAsyncRequest(this, cqs[i]); - } - } - } - if (!has_generic_service_) { for (auto it = sync_req_mgrs_.begin(); it != sync_req_mgrs_.end(); it++) { (*it)->AddUnknownSyncMethod(); diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index aa79aedeb9..5e3f226603 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -878,7 +878,6 @@ src/cpp/common/channel_arguments.cc \ src/cpp/common/channel_filter.cc \ src/cpp/common/completion_queue_cc.cc \ src/cpp/common/core_codegen.cc \ -src/cpp/common/health_check_service_server_builder_option.cc \ src/cpp/common/resource_quota_cc.cc \ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ @@ -887,6 +886,7 @@ src/cpp/server/create_default_thread_pool.cc \ src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ src/cpp/server/health_check_service.cc \ +src/cpp/server/health_check_service_server_builder_option.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 860a151f48..84fc1ad3b1 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -7724,7 +7724,6 @@ "src/cpp/common/channel_filter.h", "src/cpp/common/completion_queue_cc.cc", "src/cpp/common/core_codegen.cc", - "src/cpp/common/health_check_service_server_builder_option.cc", "src/cpp/common/resource_quota_cc.cc", "src/cpp/common/rpc_method.cc", "src/cpp/common/version_cc.cc", @@ -7735,6 +7734,7 @@ "src/cpp/server/dynamic_thread_pool.cc", "src/cpp/server/dynamic_thread_pool.h", "src/cpp/server/health_check_service.cc", + "src/cpp/server/health_check_service_server_builder_option.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj b/vsprojects/vcxproj/grpc++/grpc++.vcxproj index a57ed0e2e5..4af3454e39 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj @@ -399,8 +399,6 @@ - - @@ -417,6 +415,8 @@ + + diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters index e455636abe..17ea98381a 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters @@ -58,9 +58,6 @@ src\cpp\common - - src\cpp\common - src\cpp\common @@ -85,6 +82,9 @@ src\cpp\server + + src\cpp\server + src\cpp\server diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj index 10c9be3339..060f2818e3 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj @@ -385,8 +385,6 @@ - - @@ -403,6 +401,8 @@ + + diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters index 0b65ff3fe8..8aa4a77d40 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters @@ -43,9 +43,6 @@ src\cpp\common - - src\cpp\common - src\cpp\common @@ -70,6 +67,9 @@ src\cpp\server + + src\cpp\server + src\cpp\server -- cgit v1.2.3 From c3c475fd144b3d43a775b569dad36610014e08e4 Mon Sep 17 00:00:00 2001 From: yang-g Date: Tue, 27 Dec 2016 10:37:26 -0800 Subject: move files to subdir and add generated files --- BUILD | 30 +++--- CMakeLists.txt | 21 ++-- Makefile | 34 ++++-- build.yaml | 10 +- src/cpp/server/default_health_check_service.cc | 96 ----------------- src/cpp/server/default_health_check_service.h | 76 ------------- src/cpp/server/health.pb.c | 62 ----------- src/cpp/server/health.pb.h | 104 ------------------ .../server/health/default_health_check_service.cc | 96 +++++++++++++++++ .../server/health/default_health_check_service.h | 76 +++++++++++++ src/cpp/server/health/health.pb.c | 62 +++++++++++ src/cpp/server/health/health.pb.h | 104 ++++++++++++++++++ src/cpp/server/health/health_check_service.cc | 49 +++++++++ .../health_check_service_server_builder_option.cc | 50 +++++++++ src/cpp/server/health_check_service.cc | 49 --------- .../health_check_service_server_builder_option.cc | 50 --------- src/cpp/server/server_cc.cc | 2 +- tools/doxygen/Doxyfile.c++.internal | 10 +- tools/run_tests/generated/sources_and_headers.json | 36 +++++-- vsprojects/vcxproj/benchmark/benchmark.vcxproj | 48 ++++++++- .../vcxproj/benchmark/benchmark.vcxproj.filters | 118 +++++++++++++++++++++ vsprojects/vcxproj/grpc++/grpc++.vcxproj | 13 ++- vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters | 29 +++-- .../grpc++_unsecure/grpc++_unsecure.vcxproj | 13 ++- .../grpc++_unsecure.vcxproj.filters | 29 +++-- 25 files changed, 754 insertions(+), 513 deletions(-) delete mode 100644 src/cpp/server/default_health_check_service.cc delete mode 100644 src/cpp/server/default_health_check_service.h delete mode 100644 src/cpp/server/health.pb.c delete mode 100644 src/cpp/server/health.pb.h create mode 100644 src/cpp/server/health/default_health_check_service.cc create mode 100644 src/cpp/server/health/default_health_check_service.h create mode 100644 src/cpp/server/health/health.pb.c create mode 100644 src/cpp/server/health/health.pb.h create mode 100644 src/cpp/server/health/health_check_service.cc create mode 100644 src/cpp/server/health/health_check_service_server_builder_option.cc delete mode 100644 src/cpp/server/health_check_service.cc delete mode 100644 src/cpp/server/health_check_service_server_builder_option.cc (limited to 'BUILD') diff --git a/BUILD b/BUILD index 6e786607cc..c680232d24 100644 --- a/BUILD +++ b/BUILD @@ -1374,8 +1374,9 @@ cc_library( "src/cpp/server/secure_server_credentials.h", "src/cpp/client/create_channel_internal.h", "src/cpp/common/channel_filter.h", - "src/cpp/server/default_health_check_service.h", "src/cpp/server/dynamic_thread_pool.h", + "src/cpp/server/health/default_health_check_service.h", + "src/cpp/server/health/health.pb.h", "src/cpp/server/thread_pool_interface.h", "src/cpp/thread_manager/thread_manager.h", "src/cpp/client/insecure_credentials.cc", @@ -1402,10 +1403,11 @@ cc_library( "src/cpp/common/version_cc.cc", "src/cpp/server/async_generic_service.cc", "src/cpp/server/create_default_thread_pool.cc", - "src/cpp/server/default_health_check_service.cc", "src/cpp/server/dynamic_thread_pool.cc", - "src/cpp/server/health_check_service.cc", - "src/cpp/server/health_check_service_server_builder_option.cc", + "src/cpp/server/health/default_health_check_service.cc", + "src/cpp/server/health/health.pb.c", + "src/cpp/server/health/health_check_service.cc", + "src/cpp/server/health/health_check_service_server_builder_option.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", @@ -1528,8 +1530,9 @@ cc_library( srcs = [ "src/cpp/client/create_channel_internal.h", "src/cpp/common/channel_filter.h", - "src/cpp/server/default_health_check_service.h", "src/cpp/server/dynamic_thread_pool.h", + "src/cpp/server/health/default_health_check_service.h", + "src/cpp/server/health/health.pb.h", "src/cpp/server/thread_pool_interface.h", "src/cpp/thread_manager/thread_manager.h", "src/core/ext/transport/chttp2/client/chttp2_connector.h", @@ -1698,10 +1701,11 @@ cc_library( "src/cpp/common/version_cc.cc", "src/cpp/server/async_generic_service.cc", "src/cpp/server/create_default_thread_pool.cc", - "src/cpp/server/default_health_check_service.cc", "src/cpp/server/dynamic_thread_pool.cc", - "src/cpp/server/health_check_service.cc", - "src/cpp/server/health_check_service_server_builder_option.cc", + "src/cpp/server/health/default_health_check_service.cc", + "src/cpp/server/health/health.pb.c", + "src/cpp/server/health/health_check_service.cc", + "src/cpp/server/health/health_check_service_server_builder_option.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", @@ -2029,8 +2033,9 @@ cc_library( srcs = [ "src/cpp/client/create_channel_internal.h", "src/cpp/common/channel_filter.h", - "src/cpp/server/default_health_check_service.h", "src/cpp/server/dynamic_thread_pool.h", + "src/cpp/server/health/default_health_check_service.h", + "src/cpp/server/health/health.pb.h", "src/cpp/server/thread_pool_interface.h", "src/cpp/thread_manager/thread_manager.h", "src/cpp/client/insecure_credentials.cc", @@ -2052,10 +2057,11 @@ cc_library( "src/cpp/common/version_cc.cc", "src/cpp/server/async_generic_service.cc", "src/cpp/server/create_default_thread_pool.cc", - "src/cpp/server/default_health_check_service.cc", "src/cpp/server/dynamic_thread_pool.cc", - "src/cpp/server/health_check_service.cc", - "src/cpp/server/health_check_service_server_builder_option.cc", + "src/cpp/server/health/default_health_check_service.cc", + "src/cpp/server/health/health.pb.c", + "src/cpp/server/health/health_check_service.cc", + "src/cpp/server/health/health_check_service_server_builder_option.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", diff --git a/CMakeLists.txt b/CMakeLists.txt index c32a4aaf96..3f19143179 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1090,10 +1090,11 @@ add_library(grpc++ src/cpp/common/version_cc.cc src/cpp/server/async_generic_service.cc src/cpp/server/create_default_thread_pool.cc - src/cpp/server/default_health_check_service.cc src/cpp/server/dynamic_thread_pool.cc - src/cpp/server/health_check_service.cc - src/cpp/server/health_check_service_server_builder_option.cc + src/cpp/server/health/default_health_check_service.cc + src/cpp/server/health/health.pb.c + src/cpp/server/health/health_check_service.cc + src/cpp/server/health/health_check_service_server_builder_option.cc src/cpp/server/server_builder.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc @@ -1253,10 +1254,11 @@ add_library(grpc++_cronet src/cpp/common/version_cc.cc src/cpp/server/async_generic_service.cc src/cpp/server/create_default_thread_pool.cc - src/cpp/server/default_health_check_service.cc src/cpp/server/dynamic_thread_pool.cc - src/cpp/server/health_check_service.cc - src/cpp/server/health_check_service_server_builder_option.cc + src/cpp/server/health/default_health_check_service.cc + src/cpp/server/health/health.pb.c + src/cpp/server/health/health_check_service.cc + src/cpp/server/health/health_check_service_server_builder_option.cc src/cpp/server/server_builder.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc @@ -1639,10 +1641,11 @@ add_library(grpc++_unsecure src/cpp/common/version_cc.cc src/cpp/server/async_generic_service.cc src/cpp/server/create_default_thread_pool.cc - src/cpp/server/default_health_check_service.cc src/cpp/server/dynamic_thread_pool.cc - src/cpp/server/health_check_service.cc - src/cpp/server/health_check_service_server_builder_option.cc + src/cpp/server/health/default_health_check_service.cc + src/cpp/server/health/health.pb.c + src/cpp/server/health/health_check_service.cc + src/cpp/server/health/health_check_service_server_builder_option.cc src/cpp/server/server_builder.cc src/cpp/server/server_cc.cc src/cpp/server/server_context.cc diff --git a/Makefile b/Makefile index 6c7a0c1518..6ee9085649 100644 --- a/Makefile +++ b/Makefile @@ -3804,10 +3804,11 @@ LIBGRPC++_SRC = \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ src/cpp/server/create_default_thread_pool.cc \ - src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ - src/cpp/server/health_check_service.cc \ - src/cpp/server/health_check_service_server_builder_option.cc \ + src/cpp/server/health/default_health_check_service.cc \ + src/cpp/server/health/health.pb.c \ + src/cpp/server/health/health_check_service.cc \ + src/cpp/server/health/health_check_service_server_builder_option.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ @@ -3996,10 +3997,11 @@ LIBGRPC++_CRONET_SRC = \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ src/cpp/server/create_default_thread_pool.cc \ - src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ - src/cpp/server/health_check_service.cc \ - src/cpp/server/health_check_service_server_builder_option.cc \ + src/cpp/server/health/default_health_check_service.cc \ + src/cpp/server/health/health.pb.c \ + src/cpp/server/health/health_check_service.cc \ + src/cpp/server/health/health_check_service_server_builder_option.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ @@ -4710,10 +4712,11 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ src/cpp/server/create_default_thread_pool.cc \ - src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ - src/cpp/server/health_check_service.cc \ - src/cpp/server/health_check_service_server_builder_option.cc \ + src/cpp/server/health/default_health_check_service.cc \ + src/cpp/server/health/health.pb.c \ + src/cpp/server/health/health_check_service.cc \ + src/cpp/server/health/health_check_service_server_builder_option.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ @@ -7035,6 +7038,19 @@ endif LIBBENCHMARK_SRC = \ + third_party/benchmark/src/benchmark.cc \ + third_party/benchmark/src/benchmark_register.cc \ + third_party/benchmark/src/colorprint.cc \ + third_party/benchmark/src/commandlineflags.cc \ + third_party/benchmark/src/complexity.cc \ + third_party/benchmark/src/console_reporter.cc \ + third_party/benchmark/src/csv_reporter.cc \ + third_party/benchmark/src/json_reporter.cc \ + third_party/benchmark/src/reporter.cc \ + third_party/benchmark/src/sleep.cc \ + third_party/benchmark/src/string_util.cc \ + third_party/benchmark/src/sysinfo.cc \ + third_party/benchmark/src/timers.cc \ PUBLIC_HEADERS_CXX += \ diff --git a/build.yaml b/build.yaml index 8be83187b1..4a33891e33 100644 --- a/build.yaml +++ b/build.yaml @@ -759,8 +759,9 @@ filegroups: headers: - src/cpp/client/create_channel_internal.h - src/cpp/common/channel_filter.h - - src/cpp/server/default_health_check_service.h - src/cpp/server/dynamic_thread_pool.h + - src/cpp/server/health/default_health_check_service.h + - src/cpp/server/health/health.pb.h - src/cpp/server/thread_pool_interface.h - src/cpp/thread_manager/thread_manager.h src: @@ -780,10 +781,11 @@ filegroups: - src/cpp/common/version_cc.cc - src/cpp/server/async_generic_service.cc - src/cpp/server/create_default_thread_pool.cc - - src/cpp/server/default_health_check_service.cc - src/cpp/server/dynamic_thread_pool.cc - - src/cpp/server/health_check_service.cc - - src/cpp/server/health_check_service_server_builder_option.cc + - src/cpp/server/health/default_health_check_service.cc + - src/cpp/server/health/health.pb.c + - src/cpp/server/health/health_check_service.cc + - src/cpp/server/health/health_check_service_server_builder_option.cc - src/cpp/server/server_builder.cc - src/cpp/server/server_cc.cc - src/cpp/server/server_context.cc diff --git a/src/cpp/server/default_health_check_service.cc b/src/cpp/server/default_health_check_service.cc deleted file mode 100644 index 1bd5973e47..0000000000 --- a/src/cpp/server/default_health_check_service.cc +++ /dev/null @@ -1,96 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include - -#include -#include - -#include "src/cpp/server/default_health_check_service.h" -#include "third_party/nanopb/pb_encode.h" -#include "third_party/nanopb/pb_decode.h" - -namespace grpc { -namespace { - -const char kHealthCheckMethodName[] = "/grpc.health.v1.Health/Check"; - -} // namespace - -DefaultHealthCheckService::SyncHealthCheckServiceImpl:: - SyncHealthCheckServiceImpl(DefaultHealthCheckService* service) - : service_(service) { - auto* handler = - new RpcMethodHandler( - std::mem_fn(&SyncHealthCheckServiceImpl::Check), this); - auto* method = new RpcServiceMethod(kHealthCheckMethodName, - RpcMethod::NORMAL_RPC, handler); - AddMethod(method); -} - -Status DefaultHealthCheckService::SyncHealthCheckServiceImpl::Check( - ServerContext* context, const ByteBuffer* request, ByteBuffer* response) { - - return Status::OK; -} - -DefaultHealthCheckService::DefaultHealthCheckService() - : sync_service_(new SyncHealthCheckServiceImpl(this)) { - services_map_.emplace("", true); -} - -void DefaultHealthCheckService::SetServingStatus( - const grpc::string& service_name, bool serving) { - std::lock_guard lock(mu_); - services_map_[service_name] = serving; -} - -void DefaultHealthCheckService::SetServingStatus(bool serving) { - std::lock_guard lock(mu_); - for (auto iter = services_map_.begin(); iter != services_map_.end(); ++iter) { - iter->second = serving; - } -} - -DefaultHealthCheckService::ServingStatus -DefaultHealthCheckService::GetServingStatus(const grpc::string& service_name) { - std::lock_guard lock(mu_); - const auto& iter = services_map_.find(service_name); - if (iter == services_map_.end()) { - return NOT_FOUND; - } - return iter->second ? SERVING : NOT_SERVING; -} - -} // namespace grpc diff --git a/src/cpp/server/default_health_check_service.h b/src/cpp/server/default_health_check_service.h deleted file mode 100644 index 23ee1cb7dc..0000000000 --- a/src/cpp/server/default_health_check_service.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H -#define GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H - -#include - -#include -#include -#include - -namespace grpc { - -// Default implementation of HealthCheckServiceInterface. Server will create and -// own it. -class DefaultHealthCheckService : public HealthCheckServiceInterface { - public: - class SyncHealthCheckServiceImpl : public Service { - public: - explicit SyncHealthCheckServiceImpl(DefaultHealthCheckService* service); - Status Check(ServerContext* context, const ByteBuffer* request, - ByteBuffer* response); - - private: - const DefaultHealthCheckService* service_; - }; - - DefaultHealthCheckService(); - void SetServingStatus(const grpc::string& service_name, bool serving) final; - void SetServingStatus(bool serving) final; - enum ServingStatus { NOT_FOUND, SERVING, NOT_SERVING }; - ServingStatus GetServingStatus(const grpc::string& service_name); - SyncHealthCheckServiceImpl* GetSyncHealthCheckService() const { - return sync_service_.get(); - } - - private: - std::mutex mu_; - std::map services_map_; - std::unique_ptr sync_service_; -}; - -} // namespace grpc - -#endif // GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H diff --git a/src/cpp/server/health.pb.c b/src/cpp/server/health.pb.c deleted file mode 100644 index cfd06b496f..0000000000 --- a/src/cpp/server/health.pb.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.7-dev */ - -#include "/usr/local/google/home/yangg/github/grpc/src/cpp/server//health.pb.h" - -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t grpc_health_v1_HealthCheckRequest_fields[2] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_health_v1_HealthCheckRequest, service, service, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_health_v1_HealthCheckResponse_fields[2] = { - PB_FIELD( 1, UENUM , OPTIONAL, STATIC , FIRST, grpc_health_v1_HealthCheckResponse, status, status, 0), - PB_LAST_FIELD -}; - - -/* Check that field information fits in pb_field_t */ -#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -#error Field descriptor for grpc_health_v1_HealthCheckRequest.service is too large. Define PB_FIELD_16BIT to fix this. -#endif - - -/* @@protoc_insertion_point(eof) */ diff --git a/src/cpp/server/health.pb.h b/src/cpp/server/health.pb.h deleted file mode 100644 index 5782b9c198..0000000000 --- a/src/cpp/server/health.pb.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.7-dev */ - -#ifndef PB_GRPC_HEALTH_V1_HEALTH_PB_H_INCLUDED -#define PB_GRPC_HEALTH_V1_HEALTH_PB_H_INCLUDED -#include "third_party/nanopb/pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Enum definitions */ -typedef enum _grpc_health_v1_HealthCheckResponse_ServingStatus { - grpc_health_v1_HealthCheckResponse_ServingStatus_UNKNOWN = 0, - grpc_health_v1_HealthCheckResponse_ServingStatus_SERVING = 1, - grpc_health_v1_HealthCheckResponse_ServingStatus_NOT_SERVING = 2 -} grpc_health_v1_HealthCheckResponse_ServingStatus; -#define _grpc_health_v1_HealthCheckResponse_ServingStatus_MIN grpc_health_v1_HealthCheckResponse_ServingStatus_UNKNOWN -#define _grpc_health_v1_HealthCheckResponse_ServingStatus_MAX grpc_health_v1_HealthCheckResponse_ServingStatus_NOT_SERVING -#define _grpc_health_v1_HealthCheckResponse_ServingStatus_ARRAYSIZE ((grpc_health_v1_HealthCheckResponse_ServingStatus)(grpc_health_v1_HealthCheckResponse_ServingStatus_NOT_SERVING+1)) - -/* Struct definitions */ -typedef struct _grpc_health_v1_HealthCheckRequest { - bool has_service; - char service[2048]; -/* @@protoc_insertion_point(struct:grpc_health_v1_HealthCheckRequest) */ -} grpc_health_v1_HealthCheckRequest; - -typedef struct _grpc_health_v1_HealthCheckResponse { - bool has_status; - grpc_health_v1_HealthCheckResponse_ServingStatus status; -/* @@protoc_insertion_point(struct:grpc_health_v1_HealthCheckResponse) */ -} grpc_health_v1_HealthCheckResponse; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define grpc_health_v1_HealthCheckRequest_init_default {false, ""} -#define grpc_health_v1_HealthCheckResponse_init_default {false, (grpc_health_v1_HealthCheckResponse_ServingStatus)0} -#define grpc_health_v1_HealthCheckRequest_init_zero {false, ""} -#define grpc_health_v1_HealthCheckResponse_init_zero {false, (grpc_health_v1_HealthCheckResponse_ServingStatus)0} - -/* Field tags (for use in manual encoding/decoding) */ -#define grpc_health_v1_HealthCheckRequest_service_tag 1 -#define grpc_health_v1_HealthCheckResponse_status_tag 1 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t grpc_health_v1_HealthCheckRequest_fields[2]; -extern const pb_field_t grpc_health_v1_HealthCheckResponse_fields[2]; - -/* Maximum encoded size of messages (where known) */ -#define grpc_health_v1_HealthCheckRequest_size 2051 -#define grpc_health_v1_HealthCheckResponse_size 2 - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define HEALTH_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif -/* @@protoc_insertion_point(eof) */ - -#endif diff --git a/src/cpp/server/health/default_health_check_service.cc b/src/cpp/server/health/default_health_check_service.cc new file mode 100644 index 0000000000..bc6087f1ca --- /dev/null +++ b/src/cpp/server/health/default_health_check_service.cc @@ -0,0 +1,96 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include + +#include +#include + +#include "src/cpp/server/health/default_health_check_service.h" +#include "third_party/nanopb/pb_encode.h" +#include "third_party/nanopb/pb_decode.h" + +namespace grpc { +namespace { + +const char kHealthCheckMethodName[] = "/grpc.health.v1.Health/Check"; + +} // namespace + +DefaultHealthCheckService::SyncHealthCheckServiceImpl:: + SyncHealthCheckServiceImpl(DefaultHealthCheckService* service) + : service_(service) { + auto* handler = + new RpcMethodHandler( + std::mem_fn(&SyncHealthCheckServiceImpl::Check), this); + auto* method = new RpcServiceMethod(kHealthCheckMethodName, + RpcMethod::NORMAL_RPC, handler); + AddMethod(method); +} + +Status DefaultHealthCheckService::SyncHealthCheckServiceImpl::Check( + ServerContext* context, const ByteBuffer* request, ByteBuffer* response) { + + return Status::OK; +} + +DefaultHealthCheckService::DefaultHealthCheckService() + : sync_service_(new SyncHealthCheckServiceImpl(this)) { + services_map_.emplace("", true); +} + +void DefaultHealthCheckService::SetServingStatus( + const grpc::string& service_name, bool serving) { + std::lock_guard lock(mu_); + services_map_[service_name] = serving; +} + +void DefaultHealthCheckService::SetServingStatus(bool serving) { + std::lock_guard lock(mu_); + for (auto iter = services_map_.begin(); iter != services_map_.end(); ++iter) { + iter->second = serving; + } +} + +DefaultHealthCheckService::ServingStatus +DefaultHealthCheckService::GetServingStatus(const grpc::string& service_name) { + std::lock_guard lock(mu_); + const auto& iter = services_map_.find(service_name); + if (iter == services_map_.end()) { + return NOT_FOUND; + } + return iter->second ? SERVING : NOT_SERVING; +} + +} // namespace grpc diff --git a/src/cpp/server/health/default_health_check_service.h b/src/cpp/server/health/default_health_check_service.h new file mode 100644 index 0000000000..23ee1cb7dc --- /dev/null +++ b/src/cpp/server/health/default_health_check_service.h @@ -0,0 +1,76 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H +#define GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H + +#include + +#include +#include +#include + +namespace grpc { + +// Default implementation of HealthCheckServiceInterface. Server will create and +// own it. +class DefaultHealthCheckService : public HealthCheckServiceInterface { + public: + class SyncHealthCheckServiceImpl : public Service { + public: + explicit SyncHealthCheckServiceImpl(DefaultHealthCheckService* service); + Status Check(ServerContext* context, const ByteBuffer* request, + ByteBuffer* response); + + private: + const DefaultHealthCheckService* service_; + }; + + DefaultHealthCheckService(); + void SetServingStatus(const grpc::string& service_name, bool serving) final; + void SetServingStatus(bool serving) final; + enum ServingStatus { NOT_FOUND, SERVING, NOT_SERVING }; + ServingStatus GetServingStatus(const grpc::string& service_name); + SyncHealthCheckServiceImpl* GetSyncHealthCheckService() const { + return sync_service_.get(); + } + + private: + std::mutex mu_; + std::map services_map_; + std::unique_ptr sync_service_; +}; + +} // namespace grpc + +#endif // GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H diff --git a/src/cpp/server/health/health.pb.c b/src/cpp/server/health/health.pb.c new file mode 100644 index 0000000000..cfd06b496f --- /dev/null +++ b/src/cpp/server/health/health.pb.c @@ -0,0 +1,62 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.7-dev */ + +#include "/usr/local/google/home/yangg/github/grpc/src/cpp/server//health.pb.h" + +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + + + +const pb_field_t grpc_health_v1_HealthCheckRequest_fields[2] = { + PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_health_v1_HealthCheckRequest, service, service, 0), + PB_LAST_FIELD +}; + +const pb_field_t grpc_health_v1_HealthCheckResponse_fields[2] = { + PB_FIELD( 1, UENUM , OPTIONAL, STATIC , FIRST, grpc_health_v1_HealthCheckResponse, status, status, 0), + PB_LAST_FIELD +}; + + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +#error Field descriptor for grpc_health_v1_HealthCheckRequest.service is too large. Define PB_FIELD_16BIT to fix this. +#endif + + +/* @@protoc_insertion_point(eof) */ diff --git a/src/cpp/server/health/health.pb.h b/src/cpp/server/health/health.pb.h new file mode 100644 index 0000000000..5782b9c198 --- /dev/null +++ b/src/cpp/server/health/health.pb.h @@ -0,0 +1,104 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.7-dev */ + +#ifndef PB_GRPC_HEALTH_V1_HEALTH_PB_H_INCLUDED +#define PB_GRPC_HEALTH_V1_HEALTH_PB_H_INCLUDED +#include "third_party/nanopb/pb.h" +/* @@protoc_insertion_point(includes) */ +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Enum definitions */ +typedef enum _grpc_health_v1_HealthCheckResponse_ServingStatus { + grpc_health_v1_HealthCheckResponse_ServingStatus_UNKNOWN = 0, + grpc_health_v1_HealthCheckResponse_ServingStatus_SERVING = 1, + grpc_health_v1_HealthCheckResponse_ServingStatus_NOT_SERVING = 2 +} grpc_health_v1_HealthCheckResponse_ServingStatus; +#define _grpc_health_v1_HealthCheckResponse_ServingStatus_MIN grpc_health_v1_HealthCheckResponse_ServingStatus_UNKNOWN +#define _grpc_health_v1_HealthCheckResponse_ServingStatus_MAX grpc_health_v1_HealthCheckResponse_ServingStatus_NOT_SERVING +#define _grpc_health_v1_HealthCheckResponse_ServingStatus_ARRAYSIZE ((grpc_health_v1_HealthCheckResponse_ServingStatus)(grpc_health_v1_HealthCheckResponse_ServingStatus_NOT_SERVING+1)) + +/* Struct definitions */ +typedef struct _grpc_health_v1_HealthCheckRequest { + bool has_service; + char service[2048]; +/* @@protoc_insertion_point(struct:grpc_health_v1_HealthCheckRequest) */ +} grpc_health_v1_HealthCheckRequest; + +typedef struct _grpc_health_v1_HealthCheckResponse { + bool has_status; + grpc_health_v1_HealthCheckResponse_ServingStatus status; +/* @@protoc_insertion_point(struct:grpc_health_v1_HealthCheckResponse) */ +} grpc_health_v1_HealthCheckResponse; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define grpc_health_v1_HealthCheckRequest_init_default {false, ""} +#define grpc_health_v1_HealthCheckResponse_init_default {false, (grpc_health_v1_HealthCheckResponse_ServingStatus)0} +#define grpc_health_v1_HealthCheckRequest_init_zero {false, ""} +#define grpc_health_v1_HealthCheckResponse_init_zero {false, (grpc_health_v1_HealthCheckResponse_ServingStatus)0} + +/* Field tags (for use in manual encoding/decoding) */ +#define grpc_health_v1_HealthCheckRequest_service_tag 1 +#define grpc_health_v1_HealthCheckResponse_status_tag 1 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t grpc_health_v1_HealthCheckRequest_fields[2]; +extern const pb_field_t grpc_health_v1_HealthCheckResponse_fields[2]; + +/* Maximum encoded size of messages (where known) */ +#define grpc_health_v1_HealthCheckRequest_size 2051 +#define grpc_health_v1_HealthCheckResponse_size 2 + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define HEALTH_MESSAGES \ + + +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif +/* @@protoc_insertion_point(eof) */ + +#endif diff --git a/src/cpp/server/health/health_check_service.cc b/src/cpp/server/health/health_check_service.cc new file mode 100644 index 0000000000..cca68c5549 --- /dev/null +++ b/src/cpp/server/health/health_check_service.cc @@ -0,0 +1,49 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include + +namespace grpc { +namespace { +bool g_grpc_default_health_check_service_enabled = false; +} // namesapce + +bool DefaultHealthCheckServiceEnabled() { + return g_grpc_default_health_check_service_enabled; +} + +void EnableDefaultHealthCheckService(bool enable) { + g_grpc_default_health_check_service_enabled = enable; +} + +} // namespace grpc diff --git a/src/cpp/server/health/health_check_service_server_builder_option.cc b/src/cpp/server/health/health_check_service_server_builder_option.cc new file mode 100644 index 0000000000..6680bed2e2 --- /dev/null +++ b/src/cpp/server/health/health_check_service_server_builder_option.cc @@ -0,0 +1,50 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include + +namespace grpc { + +HealthCheckServiceServerBuilderOption::HealthCheckServiceServerBuilderOption( + std::unique_ptr hc) + : hc_(std::move(hc)) {} +// Hand over hc_ to the server. +void HealthCheckServiceServerBuilderOption::UpdateArguments( + ChannelArguments* args) { + args->SetPointer(kDefaultHealthCheckServiceInterfaceArg, hc_.release()); +} + +void HealthCheckServiceServerBuilderOption::UpdatePlugins( + std::vector>* plugins) {} + +} // namespace grpc diff --git a/src/cpp/server/health_check_service.cc b/src/cpp/server/health_check_service.cc deleted file mode 100644 index cca68c5549..0000000000 --- a/src/cpp/server/health_check_service.cc +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include - -namespace grpc { -namespace { -bool g_grpc_default_health_check_service_enabled = false; -} // namesapce - -bool DefaultHealthCheckServiceEnabled() { - return g_grpc_default_health_check_service_enabled; -} - -void EnableDefaultHealthCheckService(bool enable) { - g_grpc_default_health_check_service_enabled = enable; -} - -} // namespace grpc diff --git a/src/cpp/server/health_check_service_server_builder_option.cc b/src/cpp/server/health_check_service_server_builder_option.cc deleted file mode 100644 index 6680bed2e2..0000000000 --- a/src/cpp/server/health_check_service_server_builder_option.cc +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include - -namespace grpc { - -HealthCheckServiceServerBuilderOption::HealthCheckServiceServerBuilderOption( - std::unique_ptr hc) - : hc_(std::move(hc)) {} -// Hand over hc_ to the server. -void HealthCheckServiceServerBuilderOption::UpdateArguments( - ChannelArguments* args) { - args->SetPointer(kDefaultHealthCheckServiceInterfaceArg, hc_.release()); -} - -void HealthCheckServiceServerBuilderOption::UpdatePlugins( - std::vector>* plugins) {} - -} // namespace grpc diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index b8558cfc3d..c50c076bdc 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -51,7 +51,7 @@ #include #include "src/core/lib/profiling/timers.h" -#include "src/cpp/server/default_health_check_service.h" +#include "src/cpp/server/health/default_health_check_service.h" #include "src/cpp/thread_manager/thread_manager.h" namespace grpc { diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 5e3f226603..c2dbfb68f9 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -855,8 +855,9 @@ src/cpp/common/secure_auth_context.h \ src/cpp/server/secure_server_credentials.h \ src/cpp/client/create_channel_internal.h \ src/cpp/common/channel_filter.h \ -src/cpp/server/default_health_check_service.h \ src/cpp/server/dynamic_thread_pool.h \ +src/cpp/server/health/default_health_check_service.h \ +src/cpp/server/health/health.pb.h \ src/cpp/server/thread_pool_interface.h \ src/cpp/thread_manager/thread_manager.h \ src/cpp/client/insecure_credentials.cc \ @@ -883,10 +884,11 @@ src/cpp/common/rpc_method.cc \ src/cpp/common/version_cc.cc \ src/cpp/server/async_generic_service.cc \ src/cpp/server/create_default_thread_pool.cc \ -src/cpp/server/default_health_check_service.cc \ src/cpp/server/dynamic_thread_pool.cc \ -src/cpp/server/health_check_service.cc \ -src/cpp/server/health_check_service_server_builder_option.cc \ +src/cpp/server/health/default_health_check_service.cc \ +src/cpp/server/health/health.pb.c \ +src/cpp/server/health/health_check_service.cc \ +src/cpp/server/health/health_check_service_server_builder_option.cc \ src/cpp/server/server_builder.cc \ src/cpp/server/server_cc.cc \ src/cpp/server/server_context.cc \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 9366e3366b..86986a99a6 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -6227,7 +6227,28 @@ }, { "deps": [], - "headers": [], + "headers": [ + "third_party/benchmark/include/benchmark/benchmark.h", + "third_party/benchmark/include/benchmark/benchmark_api.h", + "third_party/benchmark/include/benchmark/macros.h", + "third_party/benchmark/include/benchmark/reporter.h", + "third_party/benchmark/src/arraysize.h", + "third_party/benchmark/src/benchmark_api_internal.h", + "third_party/benchmark/src/check.h", + "third_party/benchmark/src/colorprint.h", + "third_party/benchmark/src/commandlineflags.h", + "third_party/benchmark/src/complexity.h", + "third_party/benchmark/src/cycleclock.h", + "third_party/benchmark/src/internal_macros.h", + "third_party/benchmark/src/log.h", + "third_party/benchmark/src/mutex.h", + "third_party/benchmark/src/re.h", + "third_party/benchmark/src/sleep.h", + "third_party/benchmark/src/stat.h", + "third_party/benchmark/src/string_util.h", + "third_party/benchmark/src/sysinfo.h", + "third_party/benchmark/src/timers.h" + ], "is_filegroup": false, "language": "c++", "name": "benchmark", @@ -7658,8 +7679,9 @@ "include/grpc++/support/time.h", "src/cpp/client/create_channel_internal.h", "src/cpp/common/channel_filter.h", - "src/cpp/server/default_health_check_service.h", "src/cpp/server/dynamic_thread_pool.h", + "src/cpp/server/health/default_health_check_service.h", + "src/cpp/server/health/health.pb.h", "src/cpp/server/thread_pool_interface.h", "src/cpp/thread_manager/thread_manager.h" ], @@ -7729,12 +7751,14 @@ "src/cpp/common/version_cc.cc", "src/cpp/server/async_generic_service.cc", "src/cpp/server/create_default_thread_pool.cc", - "src/cpp/server/default_health_check_service.cc", - "src/cpp/server/default_health_check_service.h", "src/cpp/server/dynamic_thread_pool.cc", "src/cpp/server/dynamic_thread_pool.h", - "src/cpp/server/health_check_service.cc", - "src/cpp/server/health_check_service_server_builder_option.cc", + "src/cpp/server/health/default_health_check_service.cc", + "src/cpp/server/health/default_health_check_service.h", + "src/cpp/server/health/health.pb.c", + "src/cpp/server/health/health.pb.h", + "src/cpp/server/health/health_check_service.cc", + "src/cpp/server/health/health_check_service_server_builder_option.cc", "src/cpp/server/server_builder.cc", "src/cpp/server/server_cc.cc", "src/cpp/server/server_context.cc", diff --git a/vsprojects/vcxproj/benchmark/benchmark.vcxproj b/vsprojects/vcxproj/benchmark/benchmark.vcxproj index 811317595f..9f262b3b00 100644 --- a/vsprojects/vcxproj/benchmark/benchmark.vcxproj +++ b/vsprojects/vcxproj/benchmark/benchmark.vcxproj @@ -147,7 +147,53 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsprojects/vcxproj/benchmark/benchmark.vcxproj.filters b/vsprojects/vcxproj/benchmark/benchmark.vcxproj.filters index 00e4276f1d..ccc9ca2cae 100644 --- a/vsprojects/vcxproj/benchmark/benchmark.vcxproj.filters +++ b/vsprojects/vcxproj/benchmark/benchmark.vcxproj.filters @@ -1,7 +1,125 @@ + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + + + third_party\benchmark\include\benchmark + + + third_party\benchmark\include\benchmark + + + third_party\benchmark\include\benchmark + + + third_party\benchmark\include\benchmark + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + third_party\benchmark\src + + + + {7b593518-9fee-107e-6b64-24bdce73f939} + + + {f0d35de1-6b41-778d-0ba0-faad514fb0f4} + + + {cbc02dfa-face-8cc6-0efb-efacc0c3369c} + + + {4f2f03fc-b82d-df33-63ee-bedebeb2c0ee} + + + {f42a8e0a-5a76-0e6f-d708-f0306858f673} + diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj b/vsprojects/vcxproj/grpc++/grpc++.vcxproj index 4af3454e39..0f0949cbd1 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj @@ -355,8 +355,9 @@ - + + @@ -409,13 +410,15 @@ - - - + + + + + - + diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters index 17ea98381a..fc64c44e08 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters @@ -73,17 +73,20 @@ src\cpp\server - - src\cpp\server - src\cpp\server - - src\cpp\server + + src\cpp\server\health - - src\cpp\server + + src\cpp\server\health + + + src\cpp\server\health + + + src\cpp\server\health src\cpp\server @@ -410,12 +413,15 @@ src\cpp\common - - src\cpp\server - src\cpp\server + + src\cpp\server\health + + + src\cpp\server\health + src\cpp\server @@ -479,6 +485,9 @@ {321b0980-74ad-e8ca-f23b-deffa5d6bb8f} + + {5bc9ef4e-78c1-159e-4e4e-30ddfce3e140} + {23f9df56-8604-52a0-e6a2-f01b8e68d0e7} diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj index 060f2818e3..0c53d641c7 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj @@ -351,8 +351,9 @@ - + + @@ -395,13 +396,15 @@ - - - + + + + + - + diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters index 8aa4a77d40..a1ac870226 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters @@ -58,17 +58,20 @@ src\cpp\server - - src\cpp\server - src\cpp\server - - src\cpp\server + + src\cpp\server\health - - src\cpp\server + + src\cpp\server\health + + + src\cpp\server\health + + + src\cpp\server\health src\cpp\server @@ -383,12 +386,15 @@ src\cpp\common - - src\cpp\server - src\cpp\server + + src\cpp\server\health + + + src\cpp\server\health + src\cpp\server @@ -452,6 +458,9 @@ {8a54a279-d14b-4237-0df3-1ffe1ef5a7af} + + {a003cb5c-7249-106c-8ee5-de5e11a6692c} + {e5b55f25-d99f-b8e5-9981-7da7fa7ba628} -- cgit v1.2.3 From 1accb12408d89160055e687d49b3b346e57ad14a Mon Sep 17 00:00:00 2001 From: yang-g Date: Wed, 28 Dec 2016 10:38:04 -0800 Subject: fix path --- BUILD | 6 +++--- CMakeLists.txt | 6 +++--- Makefile | 6 +++--- build.yaml | 2 +- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- tools/run_tests/generated/sources_and_headers.json | 4 ++-- vsprojects/vcxproj/grpc++/grpc++.vcxproj | 2 +- vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters | 6 +++--- vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj | 2 +- vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters | 6 +++--- 11 files changed, 22 insertions(+), 22 deletions(-) (limited to 'BUILD') diff --git a/BUILD b/BUILD index c680232d24..0d4f290e32 100644 --- a/BUILD +++ b/BUILD @@ -1428,11 +1428,11 @@ cc_library( "include/grpc++/completion_queue.h", "include/grpc++/create_channel.h", "include/grpc++/create_channel_posix.h", - "include/grpc++/ext/health_check_service_interface.h", "include/grpc++/ext/health_check_service_server_builder_option.h", "include/grpc++/generic/async_generic_service.h", "include/grpc++/generic/generic_stub.h", "include/grpc++/grpc++.h", + "include/grpc++/health_check_service_interface.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/codegen/core_codegen.h", @@ -1898,11 +1898,11 @@ cc_library( "include/grpc++/completion_queue.h", "include/grpc++/create_channel.h", "include/grpc++/create_channel_posix.h", - "include/grpc++/ext/health_check_service_interface.h", "include/grpc++/ext/health_check_service_server_builder_option.h", "include/grpc++/generic/async_generic_service.h", "include/grpc++/generic/generic_stub.h", "include/grpc++/grpc++.h", + "include/grpc++/health_check_service_interface.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/codegen/core_codegen.h", @@ -2082,11 +2082,11 @@ cc_library( "include/grpc++/completion_queue.h", "include/grpc++/create_channel.h", "include/grpc++/create_channel_posix.h", - "include/grpc++/ext/health_check_service_interface.h", "include/grpc++/ext/health_check_service_server_builder_option.h", "include/grpc++/generic/async_generic_service.h", "include/grpc++/generic/generic_stub.h", "include/grpc++/grpc++.h", + "include/grpc++/health_check_service_interface.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/codegen/core_codegen.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f19143179..5a2d368d59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1132,11 +1132,11 @@ foreach(_hdr include/grpc++/completion_queue.h include/grpc++/create_channel.h include/grpc++/create_channel_posix.h - include/grpc++/ext/health_check_service_interface.h include/grpc++/ext/health_check_service_server_builder_option.h include/grpc++/generic/async_generic_service.h include/grpc++/generic/generic_stub.h include/grpc++/grpc++.h + include/grpc++/health_check_service_interface.h include/grpc++/impl/call.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/codegen/core_codegen.h @@ -1471,11 +1471,11 @@ foreach(_hdr include/grpc++/completion_queue.h include/grpc++/create_channel.h include/grpc++/create_channel_posix.h - include/grpc++/ext/health_check_service_interface.h include/grpc++/ext/health_check_service_server_builder_option.h include/grpc++/generic/async_generic_service.h include/grpc++/generic/generic_stub.h include/grpc++/grpc++.h + include/grpc++/health_check_service_interface.h include/grpc++/impl/call.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/codegen/core_codegen.h @@ -1683,11 +1683,11 @@ foreach(_hdr include/grpc++/completion_queue.h include/grpc++/create_channel.h include/grpc++/create_channel_posix.h - include/grpc++/ext/health_check_service_interface.h include/grpc++/ext/health_check_service_server_builder_option.h include/grpc++/generic/async_generic_service.h include/grpc++/generic/generic_stub.h include/grpc++/grpc++.h + include/grpc++/health_check_service_interface.h include/grpc++/impl/call.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/codegen/core_codegen.h diff --git a/Makefile b/Makefile index 6ee9085649..e7a2c653dc 100644 --- a/Makefile +++ b/Makefile @@ -3829,11 +3829,11 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/completion_queue.h \ include/grpc++/create_channel.h \ include/grpc++/create_channel_posix.h \ - include/grpc++/ext/health_check_service_interface.h \ include/grpc++/ext/health_check_service_server_builder_option.h \ include/grpc++/generic/async_generic_service.h \ include/grpc++/generic/generic_stub.h \ include/grpc++/grpc++.h \ + include/grpc++/health_check_service_interface.h \ include/grpc++/impl/call.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/codegen/core_codegen.h \ @@ -4197,11 +4197,11 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/completion_queue.h \ include/grpc++/create_channel.h \ include/grpc++/create_channel_posix.h \ - include/grpc++/ext/health_check_service_interface.h \ include/grpc++/ext/health_check_service_server_builder_option.h \ include/grpc++/generic/async_generic_service.h \ include/grpc++/generic/generic_stub.h \ include/grpc++/grpc++.h \ + include/grpc++/health_check_service_interface.h \ include/grpc++/impl/call.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/codegen/core_codegen.h \ @@ -4737,11 +4737,11 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/completion_queue.h \ include/grpc++/create_channel.h \ include/grpc++/create_channel_posix.h \ - include/grpc++/ext/health_check_service_interface.h \ include/grpc++/ext/health_check_service_server_builder_option.h \ include/grpc++/generic/async_generic_service.h \ include/grpc++/generic/generic_stub.h \ include/grpc++/grpc++.h \ + include/grpc++/health_check_service_interface.h \ include/grpc++/impl/call.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/codegen/core_codegen.h \ diff --git a/build.yaml b/build.yaml index 4a33891e33..634394a1ad 100644 --- a/build.yaml +++ b/build.yaml @@ -718,11 +718,11 @@ filegroups: - include/grpc++/completion_queue.h - include/grpc++/create_channel.h - include/grpc++/create_channel_posix.h - - include/grpc++/ext/health_check_service_interface.h - include/grpc++/ext/health_check_service_server_builder_option.h - include/grpc++/generic/async_generic_service.h - include/grpc++/generic/generic_stub.h - include/grpc++/grpc++.h + - include/grpc++/health_check_service_interface.h - include/grpc++/impl/call.h - include/grpc++/impl/client_unary_call.h - include/grpc++/impl/codegen/core_codegen.h diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 77e9c7fc9a..6d4f128cbb 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -766,11 +766,11 @@ include/grpc++/client_context.h \ include/grpc++/completion_queue.h \ include/grpc++/create_channel.h \ include/grpc++/create_channel_posix.h \ -include/grpc++/ext/health_check_service_interface.h \ include/grpc++/ext/health_check_service_server_builder_option.h \ include/grpc++/generic/async_generic_service.h \ include/grpc++/generic/generic_stub.h \ include/grpc++/grpc++.h \ +include/grpc++/health_check_service_interface.h \ include/grpc++/impl/call.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/codegen/core_codegen.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index c2dbfb68f9..7f24e84a5a 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -766,11 +766,11 @@ include/grpc++/client_context.h \ include/grpc++/completion_queue.h \ include/grpc++/create_channel.h \ include/grpc++/create_channel_posix.h \ -include/grpc++/ext/health_check_service_interface.h \ include/grpc++/ext/health_check_service_server_builder_option.h \ include/grpc++/generic/async_generic_service.h \ include/grpc++/generic/generic_stub.h \ include/grpc++/grpc++.h \ +include/grpc++/health_check_service_interface.h \ include/grpc++/impl/call.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/codegen/core_codegen.h \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 86986a99a6..a8157ffb9a 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -7639,11 +7639,11 @@ "include/grpc++/completion_queue.h", "include/grpc++/create_channel.h", "include/grpc++/create_channel_posix.h", - "include/grpc++/ext/health_check_service_interface.h", "include/grpc++/ext/health_check_service_server_builder_option.h", "include/grpc++/generic/async_generic_service.h", "include/grpc++/generic/generic_stub.h", "include/grpc++/grpc++.h", + "include/grpc++/health_check_service_interface.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/codegen/core_codegen.h", @@ -7695,11 +7695,11 @@ "include/grpc++/completion_queue.h", "include/grpc++/create_channel.h", "include/grpc++/create_channel_posix.h", - "include/grpc++/ext/health_check_service_interface.h", "include/grpc++/ext/health_check_service_server_builder_option.h", "include/grpc++/generic/async_generic_service.h", "include/grpc++/generic/generic_stub.h", "include/grpc++/grpc++.h", + "include/grpc++/health_check_service_interface.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/codegen/core_codegen.h", diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj b/vsprojects/vcxproj/grpc++/grpc++.vcxproj index 0f0949cbd1..9d98447a70 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj @@ -264,11 +264,11 @@ - + diff --git a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters index fc64c44e08..a9acb5c588 100644 --- a/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++/grpc++.vcxproj.filters @@ -144,9 +144,6 @@ include\grpc++ - - include\grpc++\ext - include\grpc++\ext @@ -159,6 +156,9 @@ include\grpc++ + + include\grpc++ + include\grpc++\impl diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj index 0c53d641c7..a9786a1c84 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj @@ -264,11 +264,11 @@ - + diff --git a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters index a1ac870226..f43e859eee 100644 --- a/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++_unsecure/grpc++_unsecure.vcxproj.filters @@ -129,9 +129,6 @@ include\grpc++ - - include\grpc++\ext - include\grpc++\ext @@ -144,6 +141,9 @@ include\grpc++ + + include\grpc++ + include\grpc++\impl -- cgit v1.2.3 From 850fcb97d235a5fe977d5aa8489fbcab5c837c50 Mon Sep 17 00:00:00 2001 From: yang-g Date: Wed, 11 Jan 2017 14:26:15 -0800 Subject: typo --- BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BUILD') diff --git a/BUILD b/BUILD index 350ed1baf0..9842015b06 100644 --- a/BUILD +++ b/BUILD @@ -1100,7 +1100,7 @@ grpc_cc_library( "src/cpp/client/create_channel_internal.h", "src/cpp/common/channel_filter.h", "src/cpp/server/dynamic_thread_pool.h", - "src/cpp/server/health/defult_health_check_service.h", + "src/cpp/server/health/default_health_check_service.h", "src/cpp/server/health/health.pb.h", "src/cpp/server/thread_pool_interface.h", "src/cpp/thread_manager/thread_manager.h", -- cgit v1.2.3 From 8fe20bf093a96a50d0e1021e51f26c9e418fcb65 Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 12 Jan 2017 10:33:12 -0800 Subject: typo --- BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BUILD') diff --git a/BUILD b/BUILD index 9842015b06..9738085ee3 100644 --- a/BUILD +++ b/BUILD @@ -1117,7 +1117,7 @@ grpc_cc_library( "include/grpc++/generic/async_generic_service.h", "include/grpc++/generic/generic_stub.h", "include/grpc++/grpc++.h", - "include/grpc++/health_check_service_interfac.h", + "include/grpc++/health_check_service_interface.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/codegen/core_codegen.h", -- cgit v1.2.3 From 113b094c690bb3afd3d1d68034c7490b95b12998 Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 26 Jan 2017 15:40:05 -0800 Subject: typo --- BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BUILD') diff --git a/BUILD b/BUILD index 1b5a53f6d1..5ef46e70df 100644 --- a/BUILD +++ b/BUILD @@ -1122,7 +1122,7 @@ grpc_cc_library( "include/grpc++/completion_queue.h", "include/grpc++/create_channel.h", "include/grpc++/create_channel_posix.h", - "include/grpc++/ext/health_check_service_server_buieder_option.h", + "include/grpc++/ext/health_check_service_server_builder_option.h", "include/grpc++/generic/async_generic_service.h", "include/grpc++/generic/generic_stub.h", "include/grpc++/grpc++.h", -- cgit v1.2.3 From 5481a58da79977423b6ce8fe9bafbd01b19999a1 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 14 Feb 2017 16:11:42 -0800 Subject: Added to BUILD --- BUILD | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'BUILD') diff --git a/BUILD b/BUILD index ba92279b8e..9ea885a390 100644 --- a/BUILD +++ b/BUILD @@ -526,13 +526,13 @@ grpc_cc_library( "src/core/lib/surface/server.c", "src/core/lib/surface/validate_metadata.c", "src/core/lib/surface/version.c", + "src/core/lib/transport/bdp_estimator.c", "src/core/lib/transport/byte_stream.c", "src/core/lib/transport/connectivity_state.c", "src/core/lib/transport/error_utils.c", "src/core/lib/transport/metadata.c", "src/core/lib/transport/metadata_batch.c", "src/core/lib/transport/pid_controller.c", - "src/core/lib/transport/bdp_estimator.c", "src/core/lib/transport/service_config.c", "src/core/lib/transport/static_metadata.c", "src/core/lib/transport/status_conversion.c", @@ -633,6 +633,7 @@ grpc_cc_library( "src/core/lib/surface/lame_client.h", "src/core/lib/surface/server.h", "src/core/lib/surface/validate_metadata.h", + "src/core/lib/transport/bdp_estimator.h", "src/core/lib/transport/byte_stream.h", "src/core/lib/transport/connectivity_state.h", "src/core/lib/transport/error_utils.h", @@ -640,7 +641,6 @@ grpc_cc_library( "src/core/lib/transport/metadata.h", "src/core/lib/transport/metadata_batch.h", "src/core/lib/transport/pid_controller.h", - "src/core/lib/transport/bdp_estimator.h", "src/core/lib/transport/service_config.h", "src/core/lib/transport/static_metadata.h", "src/core/lib/transport/status_conversion.h", @@ -656,6 +656,7 @@ grpc_cc_library( "include/grpc/byte_buffer.h", "include/grpc/byte_buffer_reader.h", "include/grpc/compression.h", + "include/grpc/load_reporting.h", "include/grpc/grpc.h", "include/grpc/grpc_posix.h", "include/grpc/grpc_security_constants.h", @@ -869,8 +870,8 @@ grpc_cc_library( "src/core/lib/security/credentials/plugin/plugin_credentials.c", "src/core/lib/security/credentials/ssl/ssl_credentials.c", "src/core/lib/security/transport/client_auth_filter.c", - "src/core/lib/security/transport/secure_endpoint.c", "src/core/lib/security/transport/lb_targets_info.c", + "src/core/lib/security/transport/secure_endpoint.c", "src/core/lib/security/transport/security_connector.c", "src/core/lib/security/transport/security_handshaker.c", "src/core/lib/security/transport/server_auth_filter.c", @@ -893,8 +894,8 @@ grpc_cc_library( "src/core/lib/security/credentials/plugin/plugin_credentials.h", "src/core/lib/security/credentials/ssl/ssl_credentials.h", "src/core/lib/security/transport/auth_filters.h", - "src/core/lib/security/transport/secure_endpoint.h", "src/core/lib/security/transport/lb_targets_info.h", + "src/core/lib/security/transport/secure_endpoint.h", "src/core/lib/security/transport/security_connector.h", "src/core/lib/security/transport/security_handshaker.h", "src/core/lib/security/transport/tsi_error.h", @@ -1267,13 +1268,13 @@ grpc_cc_library( grpc_cc_library( name = "grpc++_config_proto", + external_deps = [ + "protobuf", + ], language = "c++", public_hdrs = [ "include/grpc++/impl/codegen/config_protobuf.h", ], - external_deps = [ - "protobuf", - ], ) grpc_cc_library( -- cgit v1.2.3