Merge pull request #18375 from grpc/grpc_namespace_channelz_service_plugin

Move channelz_service_plugin from grpc to grpc_impl namespace
pull/18572/head
Karthik Ravi Shankar 6 years ago committed by GitHub
commit 4fe664e065
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      BUILD
  2. 1
      CMakeLists.txt
  3. 1
      Makefile
  4. 1
      build.yaml
  5. 13
      include/grpcpp/ext/channelz_service_plugin.h
  6. 41
      include/grpcpp/ext/channelz_service_plugin_impl.h
  7. 12
      src/cpp/server/channelz/channelz_service_plugin.cc
  8. 2
      tools/run_tests/generated/sources_and_headers.json

@ -2220,6 +2220,7 @@ grpc_cc_library(
language = "c++", language = "c++",
public_hdrs = [ public_hdrs = [
"include/grpcpp/ext/channelz_service_plugin.h", "include/grpcpp/ext/channelz_service_plugin.h",
"include/grpcpp/ext/channelz_service_plugin_impl.h",
], ],
deps = [ deps = [
":grpc++", ":grpc++",

@ -4965,6 +4965,7 @@ target_link_libraries(grpcpp_channelz
foreach(_hdr foreach(_hdr
include/grpcpp/ext/channelz_service_plugin.h include/grpcpp/ext/channelz_service_plugin.h
include/grpcpp/ext/channelz_service_plugin_impl.h
) )
string(REPLACE "include/" "" _path ${_hdr}) string(REPLACE "include/" "" _path ${_hdr})
get_filename_component(_path ${_path} PATH) get_filename_component(_path ${_path} PATH)

@ -7218,6 +7218,7 @@ LIBGRPCPP_CHANNELZ_SRC = \
PUBLIC_HEADERS_CXX += \ PUBLIC_HEADERS_CXX += \
include/grpcpp/ext/channelz_service_plugin.h \ include/grpcpp/ext/channelz_service_plugin.h \
include/grpcpp/ext/channelz_service_plugin_impl.h \
LIBGRPCPP_CHANNELZ_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPCPP_CHANNELZ_SRC)))) LIBGRPCPP_CHANNELZ_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPCPP_CHANNELZ_SRC))))

@ -1917,6 +1917,7 @@ libs:
language: c++ language: c++
public_headers: public_headers:
- include/grpcpp/ext/channelz_service_plugin.h - include/grpcpp/ext/channelz_service_plugin.h
- include/grpcpp/ext/channelz_service_plugin_impl.h
headers: headers:
- src/cpp/server/channelz/channelz_service.h - src/cpp/server/channelz/channelz_service.h
src: src:

@ -19,20 +19,15 @@
#ifndef GRPCPP_EXT_CHANNELZ_SERVICE_PLUGIN_H #ifndef GRPCPP_EXT_CHANNELZ_SERVICE_PLUGIN_H
#define GRPCPP_EXT_CHANNELZ_SERVICE_PLUGIN_H #define GRPCPP_EXT_CHANNELZ_SERVICE_PLUGIN_H
#include <grpc/support/port_platform.h> #include <grpcpp/ext/channelz_service_plugin_impl.h>
#include <grpcpp/impl/server_builder_plugin.h>
#include <grpcpp/impl/server_initializer.h>
#include <grpcpp/support/config.h>
namespace grpc { namespace grpc {
namespace channelz { namespace channelz {
namespace experimental { namespace experimental {
/// Add channelz server plugin to \a ServerBuilder. This function should static inline void InitChannelzService() {
/// be called at static initialization time. This service is experimental ::grpc_impl::channelz::experimental::InitChannelzService();
/// for now. Track progress in https://github.com/grpc/grpc/issues/15988. }
void InitChannelzService();
} // namespace experimental } // namespace experimental
} // namespace channelz } // namespace channelz

@ -0,0 +1,41 @@
/*
*
* Copyright 2018 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_EXT_CHANNELZ_SERVICE_PLUGIN_IMPL_H
#define GRPCPP_EXT_CHANNELZ_SERVICE_PLUGIN_IMPL_H
#include <grpc/support/port_platform.h>
#include <grpcpp/impl/server_builder_plugin.h>
#include <grpcpp/impl/server_initializer.h>
#include <grpcpp/support/config.h>
namespace grpc_impl {
namespace channelz {
namespace experimental {
/// Add channelz server plugin to \a ServerBuilder. This function should
/// be called at static initialization time. This service is experimental
/// for now. Track progress in https://github.com/grpc/grpc/issues/15988.
void InitChannelzService();
} // namespace experimental
} // namespace channelz
} // namespace grpc_impl
#endif // GRPCPP_EXT_CHANNELZ_SERVICE_PLUGIN_IMPL_H

@ -67,13 +67,21 @@ CreateChannelzServicePlugin() {
new ChannelzServicePlugin()); new ChannelzServicePlugin());
} }
} // namespace experimental
} // namespace channelz
} // namespace grpc
namespace grpc_impl {
namespace channelz {
namespace experimental {
void InitChannelzService() { void InitChannelzService() {
static bool already_here = false; static bool already_here = false;
if (already_here) return; if (already_here) return;
already_here = true; already_here = true;
::grpc::ServerBuilder::InternalAddPluginFactory(&CreateChannelzServicePlugin); ::grpc::ServerBuilder::InternalAddPluginFactory(
&grpc::channelz::experimental::CreateChannelzServicePlugin);
} }
} // namespace experimental } // namespace experimental
} // namespace channelz } // namespace channelz
} // namespace grpc } // namespace grpc_impl

@ -6921,6 +6921,7 @@
], ],
"headers": [ "headers": [
"include/grpcpp/ext/channelz_service_plugin.h", "include/grpcpp/ext/channelz_service_plugin.h",
"include/grpcpp/ext/channelz_service_plugin_impl.h",
"src/cpp/server/channelz/channelz_service.h" "src/cpp/server/channelz/channelz_service.h"
], ],
"is_filegroup": false, "is_filegroup": false,
@ -6928,6 +6929,7 @@
"name": "grpcpp_channelz", "name": "grpcpp_channelz",
"src": [ "src": [
"include/grpcpp/ext/channelz_service_plugin.h", "include/grpcpp/ext/channelz_service_plugin.h",
"include/grpcpp/ext/channelz_service_plugin_impl.h",
"src/cpp/server/channelz/channelz_service.cc", "src/cpp/server/channelz/channelz_service.cc",
"src/cpp/server/channelz/channelz_service.h", "src/cpp/server/channelz/channelz_service.h",
"src/cpp/server/channelz/channelz_service_plugin.cc" "src/cpp/server/channelz/channelz_service_plugin.cc"

Loading…
Cancel
Save