Move HealthCheckInterface from ::grpc_impl to ::grpc

Revert #18371
pull/23183/head
Karthik Ravi Shankar 5 years ago
parent c483ece5dd
commit ac68bf72b6
  1. 1
      BUILD
  2. 1
      BUILD.gn
  3. 2
      CMakeLists.txt
  4. 2
      Makefile
  5. 39
      include/grpcpp/health_check_service_interface.h
  6. 55
      include/grpcpp/health_check_service_interface_impl.h
  7. 6
      src/cpp/server/health/health_check_service.cc
  8. 1
      tools/doxygen/Doxyfile.c++
  9. 1
      tools/doxygen/Doxyfile.c++.internal

@ -233,7 +233,6 @@ GRPCXX_PUBLIC_HDRS = [
"include/grpcpp/generic/generic_stub_impl.h", "include/grpcpp/generic/generic_stub_impl.h",
"include/grpcpp/grpcpp.h", "include/grpcpp/grpcpp.h",
"include/grpcpp/health_check_service_interface.h", "include/grpcpp/health_check_service_interface.h",
"include/grpcpp/health_check_service_interface_impl.h",
"include/grpcpp/impl/call.h", "include/grpcpp/impl/call.h",
"include/grpcpp/impl/channel_argument_option.h", "include/grpcpp/impl/channel_argument_option.h",
"include/grpcpp/impl/client_unary_call.h", "include/grpcpp/impl/client_unary_call.h",

@ -1100,7 +1100,6 @@ config("grpc_config") {
"include/grpcpp/generic/generic_stub_impl.h", "include/grpcpp/generic/generic_stub_impl.h",
"include/grpcpp/grpcpp.h", "include/grpcpp/grpcpp.h",
"include/grpcpp/health_check_service_interface.h", "include/grpcpp/health_check_service_interface.h",
"include/grpcpp/health_check_service_interface_impl.h",
"include/grpcpp/impl/call.h", "include/grpcpp/impl/call.h",
"include/grpcpp/impl/channel_argument_option.h", "include/grpcpp/impl/channel_argument_option.h",
"include/grpcpp/impl/client_unary_call.h", "include/grpcpp/impl/client_unary_call.h",

@ -2662,7 +2662,6 @@ foreach(_hdr
include/grpcpp/generic/generic_stub_impl.h include/grpcpp/generic/generic_stub_impl.h
include/grpcpp/grpcpp.h include/grpcpp/grpcpp.h
include/grpcpp/health_check_service_interface.h include/grpcpp/health_check_service_interface.h
include/grpcpp/health_check_service_interface_impl.h
include/grpcpp/impl/call.h include/grpcpp/impl/call.h
include/grpcpp/impl/channel_argument_option.h include/grpcpp/impl/channel_argument_option.h
include/grpcpp/impl/client_unary_call.h include/grpcpp/impl/client_unary_call.h
@ -3356,7 +3355,6 @@ foreach(_hdr
include/grpcpp/generic/generic_stub_impl.h include/grpcpp/generic/generic_stub_impl.h
include/grpcpp/grpcpp.h include/grpcpp/grpcpp.h
include/grpcpp/health_check_service_interface.h include/grpcpp/health_check_service_interface.h
include/grpcpp/health_check_service_interface_impl.h
include/grpcpp/impl/call.h include/grpcpp/impl/call.h
include/grpcpp/impl/channel_argument_option.h include/grpcpp/impl/channel_argument_option.h
include/grpcpp/impl/client_unary_call.h include/grpcpp/impl/client_unary_call.h

@ -4858,7 +4858,6 @@ PUBLIC_HEADERS_CXX += \
include/grpcpp/generic/generic_stub_impl.h \ include/grpcpp/generic/generic_stub_impl.h \
include/grpcpp/grpcpp.h \ include/grpcpp/grpcpp.h \
include/grpcpp/health_check_service_interface.h \ include/grpcpp/health_check_service_interface.h \
include/grpcpp/health_check_service_interface_impl.h \
include/grpcpp/impl/call.h \ include/grpcpp/impl/call.h \
include/grpcpp/impl/channel_argument_option.h \ include/grpcpp/impl/channel_argument_option.h \
include/grpcpp/impl/client_unary_call.h \ include/grpcpp/impl/client_unary_call.h \
@ -5557,7 +5556,6 @@ PUBLIC_HEADERS_CXX += \
include/grpcpp/generic/generic_stub_impl.h \ include/grpcpp/generic/generic_stub_impl.h \
include/grpcpp/grpcpp.h \ include/grpcpp/grpcpp.h \
include/grpcpp/health_check_service_interface.h \ include/grpcpp/health_check_service_interface.h \
include/grpcpp/health_check_service_interface_impl.h \
include/grpcpp/impl/call.h \ include/grpcpp/impl/call.h \
include/grpcpp/impl/channel_argument_option.h \ include/grpcpp/impl/channel_argument_option.h \
include/grpcpp/impl/client_unary_call.h \ include/grpcpp/impl/client_unary_call.h \

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2019 gRPC authors. * Copyright 2016 gRPC authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -19,22 +19,39 @@
#ifndef GRPCPP_HEALTH_CHECK_SERVICE_INTERFACE_H #ifndef GRPCPP_HEALTH_CHECK_SERVICE_INTERFACE_H
#define GRPCPP_HEALTH_CHECK_SERVICE_INTERFACE_H #define GRPCPP_HEALTH_CHECK_SERVICE_INTERFACE_H
#include <grpcpp/health_check_service_interface_impl.h> #include <grpcpp/support/config.h>
namespace grpc { namespace grpc {
const char kHealthCheckServiceInterfaceArg[] = const char kHealthCheckServiceInterfaceArg[] =
"grpc.health_check_service_interface"; "grpc.health_check_service_interface";
typedef ::grpc_impl::HealthCheckServiceInterface HealthCheckServiceInterface; /// The gRPC server uses this interface to expose the health checking service
/// without depending on protobuf.
static inline void EnableDefaultHealthCheckService(bool enable) { class HealthCheckServiceInterface {
::grpc_impl::EnableDefaultHealthCheckService(enable); public:
} virtual ~HealthCheckServiceInterface() {}
static inline bool DefaultHealthCheckServiceEnabled() { /// Set or change the serving status of the given \a service_name.
return ::grpc_impl::DefaultHealthCheckServiceEnabled(); virtual void SetServingStatus(const grpc::string& service_name,
} bool serving) = 0;
/// Apply to all registered service names.
virtual void SetServingStatus(bool serving) = 0;
/// Set all registered service names to not serving and prevent future
/// state changes.
virtual void Shutdown() {}
};
/// 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);
/// Returns whether the default health checking service is enabled.
/// NOT thread safe.
bool DefaultHealthCheckServiceEnabled();
} // namespace grpc } // namespace grpc

@ -1,55 +0,0 @@
/*
*
* Copyright 2016 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPCPP_HEALTH_CHECK_SERVICE_INTERFACE_IMPL_H
#define GRPCPP_HEALTH_CHECK_SERVICE_INTERFACE_IMPL_H
#include <grpcpp/support/config.h>
namespace grpc_impl {
/// The gRPC server uses this interface to expose the health checking service
/// without depending on protobuf.
class HealthCheckServiceInterface {
public:
virtual ~HealthCheckServiceInterface() {}
/// Set or change the serving status of the given \a service_name.
virtual void SetServingStatus(const grpc::string& service_name,
bool serving) = 0;
/// Apply to all registered service names.
virtual void SetServingStatus(bool serving) = 0;
/// Set all registered service names to not serving and prevent future
/// state changes.
virtual void Shutdown() {}
};
/// 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);
/// Returns whether the default health checking service is enabled.
/// NOT thread safe.
bool DefaultHealthCheckServiceEnabled();
} // namespace grpc_impl
#endif // GRPCPP_HEALTH_CHECK_SERVICE_INTERFACE_IMPL_H

@ -16,9 +16,9 @@
* *
*/ */
#include <grpcpp/health_check_service_interface_impl.h> #include <grpcpp/health_check_service_interface.h>
namespace grpc_impl { namespace grpc {
namespace { namespace {
bool g_grpc_default_health_check_service_enabled = false; bool g_grpc_default_health_check_service_enabled = false;
} // namespace } // namespace
@ -31,4 +31,4 @@ void EnableDefaultHealthCheckService(bool enable) {
g_grpc_default_health_check_service_enabled = enable; g_grpc_default_health_check_service_enabled = enable;
} }
} // namespace grpc_impl } // namespace grpc

@ -948,7 +948,6 @@ include/grpcpp/generic/generic_stub.h \
include/grpcpp/generic/generic_stub_impl.h \ include/grpcpp/generic/generic_stub_impl.h \
include/grpcpp/grpcpp.h \ include/grpcpp/grpcpp.h \
include/grpcpp/health_check_service_interface.h \ include/grpcpp/health_check_service_interface.h \
include/grpcpp/health_check_service_interface_impl.h \
include/grpcpp/impl/call.h \ include/grpcpp/impl/call.h \
include/grpcpp/impl/channel_argument_option.h \ include/grpcpp/impl/channel_argument_option.h \
include/grpcpp/impl/client_unary_call.h \ include/grpcpp/impl/client_unary_call.h \

@ -948,7 +948,6 @@ include/grpcpp/generic/generic_stub.h \
include/grpcpp/generic/generic_stub_impl.h \ include/grpcpp/generic/generic_stub_impl.h \
include/grpcpp/grpcpp.h \ include/grpcpp/grpcpp.h \
include/grpcpp/health_check_service_interface.h \ include/grpcpp/health_check_service_interface.h \
include/grpcpp/health_check_service_interface_impl.h \
include/grpcpp/impl/call.h \ include/grpcpp/impl/call.h \
include/grpcpp/impl/channel_argument_option.h \ include/grpcpp/impl/channel_argument_option.h \
include/grpcpp/impl/client_unary_call.h \ include/grpcpp/impl/client_unary_call.h \

Loading…
Cancel
Save