Build and formatting fixes

pull/23693/head
Karthik Ravi Shankar 5 years ago
parent 390132c87f
commit ab775de1a2
  1. 2
      gRPC-C++.podspec
  2. 15
      include/grpcpp/channel.h
  3. 8
      include/grpcpp/completion_queue.h
  4. 9
      include/grpcpp/generic/generic_stub.h
  5. 5
      include/grpcpp/impl/codegen/async_generic_service.h
  6. 6
      include/grpcpp/impl/codegen/async_stream_impl.h
  7. 2
      include/grpcpp/impl/codegen/async_unary_call_impl.h
  8. 2
      include/grpcpp/impl/codegen/call_op_set.h
  9. 2
      include/grpcpp/impl/codegen/client_callback_impl.h
  10. 2
      include/grpcpp/impl/codegen/client_unary_call.h
  11. 9
      include/grpcpp/impl/codegen/completion_queue.h
  12. 8
      include/grpcpp/impl/codegen/delegating_channel.h
  13. 38
      include/grpcpp/impl/codegen/server_interface.h
  14. 8
      include/grpcpp/impl/codegen/service_type.h
  15. 8
      include/grpcpp/impl/codegen/sync_stream_impl.h
  16. 4
      include/grpcpp/server_builder.h
  17. 4
      include/grpcpp/server_builder_impl.h
  18. 45
      include/grpcpp/server_impl.h
  19. 4
      src/cpp/server/async_generic_service.cc
  20. 19
      src/cpp/server/server_builder.cc
  21. 4
      src/cpp/server/server_context.cc

@ -79,7 +79,6 @@ Pod::Spec.new do |s|
ss.source_files = 'include/grpcpp/alarm.h',
'include/grpcpp/alarm_impl.h',
'include/grpcpp/channel.h',
'include/grpcpp/channel_impl.h',
'include/grpcpp/client_context.h',
'include/grpcpp/completion_queue.h',
'include/grpcpp/create_channel.h',
@ -111,6 +110,7 @@ Pod::Spec.new do |s|
'include/grpcpp/impl/codegen/client_interceptor.h',
'include/grpcpp/impl/codegen/client_unary_call.h',
'include/grpcpp/impl/codegen/completion_queue.h',
'include/grpcpp/impl/codegen/completion_queue_tag.h',
'include/grpcpp/impl/codegen/config.h',
'include/grpcpp/impl/codegen/core_codegen.h',
'include/grpcpp/impl/codegen/core_codegen_interface.h',

@ -25,7 +25,7 @@
#include <grpcpp/impl/call.h>
#include <grpcpp/impl/codegen/channel_interface.h>
#include <grpcpp/impl/codegen/client_interceptor.h>
#include <grpcpp/impl/codegen/completion_queue_impl.h>
#include <grpcpp/impl/codegen/completion_queue.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/grpc_library.h>
#include <grpcpp/impl/codegen/sync.h>
@ -37,7 +37,7 @@ namespace testing {
class ChannelTestPeer;
} // namespace testing
std::shared_ptr<::grpc_impl::Channel> CreateChannelInternal(
std::shared_ptr<Channel> CreateChannelInternal(
const std::string& host, grpc_channel* c_channel,
std::vector<
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
@ -87,23 +87,22 @@ class Channel final : public ::grpc::ChannelInterface,
::grpc::internal::Call CreateCall(const ::grpc::internal::RpcMethod& method,
::grpc_impl::ClientContext* context,
::grpc_impl::CompletionQueue* cq) override;
::grpc::CompletionQueue* cq) override;
void PerformOpsOnCall(::grpc::internal::CallOpSetInterface* ops,
::grpc::internal::Call* call) override;
void* RegisterMethod(const char* method) override;
void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline,
::grpc_impl::CompletionQueue* cq,
void* tag) override;
::grpc::CompletionQueue* cq, void* tag) override;
bool WaitForStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline) override;
::grpc_impl::CompletionQueue* CallbackCQ() override;
::grpc::CompletionQueue* CallbackCQ() override;
::grpc::internal::Call CreateCallInternal(
const ::grpc::internal::RpcMethod& method,
::grpc_impl::ClientContext* context, ::grpc_impl::CompletionQueue* cq,
::grpc_impl::ClientContext* context, ::grpc::CompletionQueue* cq,
size_t interceptor_pos) override;
const std::string host_;
@ -116,7 +115,7 @@ class Channel final : public ::grpc::ChannelInterface,
// with this channel (if any). It is set on the first call to CallbackCQ().
// It is _not owned_ by the channel; ownership belongs with its internal
// shutdown callback tag (invoked when the CQ is fully shutdown).
::grpc_impl::CompletionQueue* callback_cq_ = nullptr;
::grpc::CompletionQueue* callback_cq_ = nullptr;
std::vector<
std::unique_ptr<::grpc::experimental::ClientInterceptorFactoryInterface>>

@ -16,9 +16,9 @@
*
*/
#ifndef GRPCPP_COMPLETION_QUEUE_IMPL_H
#define GRPCPP_COMPLETION_QUEUE_IMPL_H
#ifndef GRPCPP_COMPLETION_QUEUE_H
#define GRPCPP_COMPLETION_QUEUE_H
#include <grpcpp/impl/codegen/completion_queue_impl.h>
#include <grpcpp/impl/codegen/completion_queue.h>
#endif // GRPCPP_COMPLETION_QUEUE_IMPL_H
#endif // GRPCPP_COMPLETION_QUEUE_H

@ -54,7 +54,7 @@ class TemplatedGenericStub final {
std::unique_ptr<
::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>>
PrepareCall(ClientContext* context, const std::string& method,
::grpc_impl::CompletionQueue* cq) {
::grpc::CompletionQueue* cq) {
return CallInternal(channel_.get(), context, method, cq, false, nullptr);
}
@ -64,8 +64,7 @@ class TemplatedGenericStub final {
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
std::unique_ptr<::grpc_impl::ClientAsyncResponseReader<ResponseType>>
PrepareUnaryCall(ClientContext* context, const std::string& method,
const RequestType& request,
::grpc_impl::CompletionQueue* cq) {
const RequestType& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr<
::grpc_impl::ClientAsyncResponseReader<ResponseType>>(
grpc_impl::internal::ClientAsyncResponseReaderFactory<
@ -85,7 +84,7 @@ class TemplatedGenericStub final {
std::unique_ptr<
::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>>
Call(ClientContext* context, const std::string& method,
::grpc_impl::CompletionQueue* cq, void* tag) {
::grpc::CompletionQueue* cq, void* tag) {
return CallInternal(channel_.get(), context, method, cq, true, tag);
}
@ -204,7 +203,7 @@ class TemplatedGenericStub final {
std::unique_ptr<
::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>>
CallInternal(grpc::ChannelInterface* channel, ClientContext* context,
const std::string& method, ::grpc_impl::CompletionQueue* cq,
const std::string& method, ::grpc::CompletionQueue* cq,
bool start, void* tag) {
return std::unique_ptr<
::grpc_impl::ClientAsyncReaderWriter<RequestType, ResponseType>>(

@ -80,9 +80,8 @@ class AsyncGenericService final {
void RequestCall(GenericServerContext* ctx,
GenericServerAsyncReaderWriter* reader_writer,
::grpc_impl::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq,
void* tag);
::grpc::CompletionQueue* call_cq,
::grpc::ServerCompletionQueue* notification_cq, void* tag);
private:
friend class grpc_impl::Server;

@ -178,7 +178,7 @@ class ClientAsyncReaderFactory {
/// used to send to the server when starting the call.
template <class W>
static ClientAsyncReader<R>* Create(::grpc::ChannelInterface* channel,
::grpc_impl::CompletionQueue* cq,
::grpc::CompletionQueue* cq,
const ::grpc::internal::RpcMethod& method,
::grpc_impl::ClientContext* context,
const W& request, bool start, void* tag) {
@ -327,7 +327,7 @@ class ClientAsyncWriterFactory {
/// method of this instance.
template <class R>
static ClientAsyncWriter<W>* Create(::grpc::ChannelInterface* channel,
::grpc_impl::CompletionQueue* cq,
::grpc::CompletionQueue* cq,
const ::grpc::internal::RpcMethod& method,
::grpc_impl::ClientContext* context,
R* response, bool start, void* tag) {
@ -493,7 +493,7 @@ class ClientAsyncReaderWriterFactory {
/// Note that \a context will be used to fill in custom initial metadata
/// used to send to the server when starting the call.
static ClientAsyncReaderWriter<W, R>* Create(
::grpc::ChannelInterface* channel, ::grpc_impl::CompletionQueue* cq,
::grpc::ChannelInterface* channel, ::grpc::CompletionQueue* cq,
const ::grpc::internal::RpcMethod& method,
::grpc_impl::ClientContext* context, bool start, void* tag) {
::grpc::internal::Call call = channel->CreateCall(method, context, cq);

@ -77,7 +77,7 @@ class ClientAsyncResponseReaderFactory {
/// used to send to the server when starting the call.
template <class W>
static ClientAsyncResponseReader<R>* Create(
::grpc::ChannelInterface* channel, ::grpc_impl::CompletionQueue* cq,
::grpc::ChannelInterface* channel, ::grpc::CompletionQueue* cq,
const ::grpc::internal::RpcMethod& method,
::grpc_impl::ClientContext* context, const W& request, bool start) {
::grpc::internal::Call call = channel->CreateCall(method, context, cq);

@ -30,7 +30,7 @@
#include <grpcpp/impl/codegen/call_hook.h>
#include <grpcpp/impl/codegen/call_op_set_interface.h>
#include <grpcpp/impl/codegen/client_context_impl.h>
#include <grpcpp/impl/codegen/completion_queue_impl.h>
#include <grpcpp/impl/codegen/completion_queue.h>
#include <grpcpp/impl/codegen/completion_queue_tag.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>

@ -60,7 +60,7 @@ class CallbackUnaryCallImpl {
::grpc_impl::ClientContext* context,
const InputMessage* request, OutputMessage* result,
std::function<void(::grpc::Status)> on_completion) {
::grpc_::CompletionQueue* cq = channel->CallbackCQ();
::grpc::CompletionQueue* cq = channel->CallbackCQ();
GPR_CODEGEN_ASSERT(cq != nullptr);
grpc::internal::Call call(channel->CreateCall(method, context, cq));

@ -49,7 +49,7 @@ class BlockingUnaryCallImpl {
BlockingUnaryCallImpl(ChannelInterface* channel, const RpcMethod& method,
grpc_impl::ClientContext* context,
const InputMessage& request, OutputMessage* result) {
::grpc_impl::CompletionQueue cq(grpc_completion_queue_attributes{
::grpc::CompletionQueue cq(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING,
nullptr}); // Pluckable completion queue
::grpc::internal::Call call(channel->CreateCall(method, context, &cq));

@ -284,7 +284,7 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
friend class ::grpc::internal::BlockingUnaryCallImpl;
// Friends that need access to constructor for callback CQ
friend class ::grpc_impl::Channel;
friend class ::grpc::Channel;
// For access to Register/CompleteAvalanching
template <class Op1, class Op2, class Op3, class Op4, class Op5, class Op6>
@ -382,14 +382,14 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
}
}
void RegisterServer(const Server* server) {
void RegisterServer(const ::grpc_impl::Server* server) {
(void)server;
#ifndef NDEBUG
grpc::internal::MutexLock l(&server_list_mutex_);
server_list_.push_back(server);
#endif
}
void UnregisterServer(const Server* server) {
void UnregisterServer(const ::grpc_impl::Server* server) {
(void)server;
#ifndef NDEBUG
grpc::internal::MutexLock l(&server_list_mutex_);
@ -412,7 +412,8 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
// NDEBUG, instantiate it in all cases since otherwise the size will be
// inconsistent.
mutable grpc::internal::Mutex server_list_mutex_;
std::list<const Server*> server_list_ /* GUARDED_BY(server_list_mutex_) */;
std::list<const ::grpc_impl::Server*>
server_list_ /* GUARDED_BY(server_list_mutex_) */;
};
/// A specific type of completion queue used by the processing of notifications

@ -40,7 +40,7 @@ class DelegatingChannel : public ::grpc::ChannelInterface {
private:
internal::Call CreateCall(const internal::RpcMethod& method,
ClientContext* context,
::grpc_impl::CompletionQueue* cq) final {
::grpc::CompletionQueue* cq) final {
return delegate_channel()->CreateCall(method, context, cq);
}
@ -55,7 +55,7 @@ class DelegatingChannel : public ::grpc::ChannelInterface {
void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline,
::grpc_impl::CompletionQueue* cq,
::grpc::CompletionQueue* cq,
void* tag) override {
delegate_channel()->NotifyOnStateChangeImpl(last_observed, deadline, cq,
tag);
@ -68,13 +68,13 @@ class DelegatingChannel : public ::grpc::ChannelInterface {
internal::Call CreateCallInternal(const internal::RpcMethod& method,
ClientContext* context,
::grpc_impl::CompletionQueue* cq,
::grpc::CompletionQueue* cq,
size_t interceptor_pos) final {
return delegate_channel()->CreateCallInternal(method, context, cq,
interceptor_pos);
}
::grpc_impl::CompletionQueue* CallbackCQ() final {
::grpc::CompletionQueue* CallbackCQ() final {
return delegate_channel()->CallbackCQ();
}

@ -31,16 +31,13 @@
#include <grpcpp/impl/codegen/rpc_service_method.h>
#include <grpcpp/impl/codegen/server_context_impl.h>
namespace grpc_impl {
class ServerCompletionQueue;
} // namespace grpc_impl
namespace grpc {
class AsyncGenericService;
class Channel;
class CompletionQueue;
class GenericServerContext;
class ServerCompletionQueue;
class ServerCredentials;
class Service;
@ -181,8 +178,7 @@ class ServerInterface : public internal::CallHook {
/// caller is required to keep all completion queues live until the server is
/// destroyed.
/// \param num_cqs How many completion queues does \a cqs hold.
virtual void Start(::grpc_impl::ServerCompletionQueue** cqs,
size_t num_cqs) = 0;
virtual void Start(::grpc::ServerCompletionQueue** cqs, size_t num_cqs) = 0;
virtual void ShutdownInternal(gpr_timespec deadline) = 0;
@ -199,8 +195,8 @@ class ServerInterface : public internal::CallHook {
::grpc_impl::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq,
void* tag, bool delete_on_finalize);
::grpc::ServerCompletionQueue* notification_cq, void* tag,
bool delete_on_finalize);
virtual ~BaseAsyncRequest();
bool FinalizeResult(void** tag, bool* status) override;
@ -213,7 +209,7 @@ class ServerInterface : public internal::CallHook {
::grpc_impl::ServerContext* const context_;
internal::ServerAsyncStreamingInterface* const stream_;
::grpc::CompletionQueue* const call_cq_;
::grpc_impl::ServerCompletionQueue* const notification_cq_;
::grpc::ServerCompletionQueue* const notification_cq_;
void* const tag_;
const bool delete_on_finalize_;
grpc_call* call_;
@ -229,7 +225,7 @@ class ServerInterface : public internal::CallHook {
::grpc_impl::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq,
::grpc::ServerCompletionQueue* notification_cq,
void* tag, const char* name,
internal::RpcMethod::RpcType type);
@ -247,7 +243,7 @@ class ServerInterface : public internal::CallHook {
protected:
void IssueRequest(void* registered_method, grpc_byte_buffer** payload,
::grpc_impl::ServerCompletionQueue* notification_cq);
::grpc::ServerCompletionQueue* notification_cq);
const char* name_;
const internal::RpcMethod::RpcType type_;
};
@ -259,7 +255,7 @@ class ServerInterface : public internal::CallHook {
::grpc_impl::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq,
::grpc::ServerCompletionQueue* notification_cq,
void* tag)
: RegisteredAsyncRequest(
server, context, stream, call_cq, notification_cq, tag,
@ -278,7 +274,7 @@ class ServerInterface : public internal::CallHook {
::grpc_impl::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq,
::grpc::ServerCompletionQueue* notification_cq,
void* tag, Message* request)
: RegisteredAsyncRequest(
server, context, stream, call_cq, notification_cq, tag,
@ -334,7 +330,7 @@ class ServerInterface : public internal::CallHook {
GenericAsyncRequest(ServerInterface* server, GenericServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq,
::grpc::ServerCompletionQueue* notification_cq,
void* tag, bool delete_on_finalize);
bool FinalizeResult(void** tag, bool* status) override;
@ -348,7 +344,7 @@ class ServerInterface : public internal::CallHook {
::grpc_impl::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq,
::grpc::ServerCompletionQueue* notification_cq,
void* tag, Message* message) {
GPR_CODEGEN_ASSERT(method);
new PayloadAsyncRequest<Message>(method, this, context, stream, call_cq,
@ -359,18 +355,18 @@ class ServerInterface : public internal::CallHook {
::grpc_impl::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq,
::grpc::ServerCompletionQueue* notification_cq,
void* tag) {
GPR_CODEGEN_ASSERT(method);
new NoPayloadAsyncRequest(method, this, context, stream, call_cq,
notification_cq, tag);
}
void RequestAsyncGenericCall(
GenericServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq, void* tag) {
void RequestAsyncGenericCall(GenericServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc::ServerCompletionQueue* notification_cq,
void* tag) {
new GenericAsyncRequest(this, context, stream, call_cq, notification_cq,
tag, true);
}

@ -131,7 +131,7 @@ class Service {
Message* request,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq,
::grpc::ServerCompletionQueue* notification_cq,
void* tag) {
// Typecast the index to size_t for indexing into a vector
// while preserving the API that existed before a compiler
@ -144,7 +144,7 @@ class Service {
int index, ::grpc_impl::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq, void* tag) {
::grpc::ServerCompletionQueue* notification_cq, void* tag) {
size_t idx = static_cast<size_t>(index);
server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq,
notification_cq, tag);
@ -154,7 +154,7 @@ class Service {
int index, ::grpc_impl::ServerContext* context, Message* request,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq, void* tag) {
::grpc::ServerCompletionQueue* notification_cq, void* tag) {
size_t idx = static_cast<size_t>(index);
server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq,
notification_cq, tag, request);
@ -163,7 +163,7 @@ class Service {
int index, ::grpc_impl::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
::grpc::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq, void* tag) {
::grpc::ServerCompletionQueue* notification_cq, void* tag) {
size_t idx = static_cast<size_t>(index);
server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq,
notification_cq, tag);

@ -21,7 +21,7 @@
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/channel_interface.h>
#include <grpcpp/impl/codegen/client_context_impl.h>
#include <grpcpp/impl/codegen/completion_queue_impl.h>
#include <grpcpp/impl/codegen/completion_queue.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/server_context_impl.h>
#include <grpcpp/impl/codegen/service_type.h>
@ -232,7 +232,7 @@ class ClientReader final : public ClientReaderInterface<R> {
private:
friend class internal::ClientReaderFactory<R>;
::grpc_impl::ClientContext* context_;
::grpc_impl::CompletionQueue cq_;
::grpc::CompletionQueue cq_;
::grpc::internal::Call call_;
/// Block to create a stream and write the initial metadata and \a request
@ -400,7 +400,7 @@ class ClientWriter : public ClientWriterInterface<W> {
::grpc::internal::CallOpGenericRecvMessage,
::grpc::internal::CallOpClientRecvStatus>
finish_ops_;
::grpc_impl::CompletionQueue cq_;
::grpc::CompletionQueue cq_;
::grpc::internal::Call call_;
};
@ -544,7 +544,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
friend class internal::ClientReaderWriterFactory<W, R>;
::grpc_impl::ClientContext* context_;
::grpc_impl::CompletionQueue cq_;
::grpc::CompletionQueue cq_;
::grpc::internal::Call call_;
/// Block to create a stream and write the initial metadata and \a request

@ -163,7 +163,7 @@ class ServerBuilder {
/// not polling the completion queue frequently) will have a significantly
/// negative performance impact and hence should not be used in production
/// use cases.
std::unique_ptr<grpc_impl::ServerCompletionQueue> AddCompletionQueue(
std::unique_ptr<grpc::ServerCompletionQueue> AddCompletionQueue(
bool is_frequently_polled = true);
//////////////////////////////////////////////////////////////////////////////
@ -378,7 +378,7 @@ class ServerBuilder {
SyncServerSettings sync_server_settings_;
/// List of completion queues added via \a AddCompletionQueue method.
std::vector<grpc_impl::ServerCompletionQueue*> cqs_;
std::vector<grpc::ServerCompletionQueue*> cqs_;
std::shared_ptr<grpc::ServerCredentials> creds_;
std::vector<std::unique_ptr<grpc::ServerBuilderPlugin>> plugins_;

@ -167,7 +167,7 @@ class ServerBuilder {
/// not polling the completion queue frequently) will have a significantly
/// negative performance impact and hence should not be used in production
/// use cases.
std::unique_ptr<grpc_impl::ServerCompletionQueue> AddCompletionQueue(
std::unique_ptr<grpc::ServerCompletionQueue> AddCompletionQueue(
bool is_frequently_polled = true);
//////////////////////////////////////////////////////////////////////////////
@ -383,7 +383,7 @@ class ServerBuilder {
SyncServerSettings sync_server_settings_;
/// List of completion queues added via \a AddCompletionQueue method.
std::vector<grpc_impl::ServerCompletionQueue*> cqs_;
std::vector<grpc::ServerCompletionQueue*> cqs_;
std::shared_ptr<grpc::ServerCredentials> creds_;
std::vector<std::unique_ptr<grpc::ServerBuilderPlugin>> plugins_;

@ -27,12 +27,12 @@
#include <grpc/compression.h>
#include <grpc/support/atm.h>
#include <grpcpp/channel_impl.h>
#include <grpcpp/completion_queue_impl.h>
#include <grpcpp/channel.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/health_check_service_interface.h>
#include <grpcpp/impl/call.h>
#include <grpcpp/impl/codegen/client_interceptor.h>
#include <grpcpp/impl/codegen/completion_queue_impl.h>
#include <grpcpp/impl/codegen/completion_queue.h>
#include <grpcpp/impl/codegen/grpc_library.h>
#include <grpcpp/impl/codegen/server_interface.h>
#include <grpcpp/impl/rpc_service_method.h>
@ -109,7 +109,7 @@ class Server : public grpc::ServerInterface, private grpc::GrpcLibraryCodegen {
}
/// Establish a channel for in-process communication
std::shared_ptr<Channel> InProcessChannel(const ChannelArguments& args);
std::shared_ptr<grpc::Channel> InProcessChannel(const ChannelArguments& args);
/// NOTE: class experimental_type is not part of the public API of this class.
/// TODO(yashykt): Integrate into public API when this is no longer
@ -120,7 +120,7 @@ class Server : public grpc::ServerInterface, private grpc::GrpcLibraryCodegen {
/// Establish a channel for in-process communication with client
/// interceptors
std::shared_ptr<Channel> InProcessChannelWithInterceptors(
std::shared_ptr<grpc::Channel> InProcessChannelWithInterceptors(
const ChannelArguments& args,
std::vector<std::unique_ptr<
grpc::experimental::ClientInterceptorFactoryInterface>>
@ -179,18 +179,19 @@ class Server : public grpc::ServerInterface, private grpc::GrpcLibraryCodegen {
///
/// \param sync_cq_timeout_msec The timeout to use when calling AsyncNext() on
/// server completion queues passed via sync_server_cqs param.
Server(ChannelArguments* args,
std::shared_ptr<std::vector<std::unique_ptr<ServerCompletionQueue>>>
sync_server_cqs,
int min_pollers, int max_pollers, int sync_cq_timeout_msec,
std::vector<
std::shared_ptr<grpc::internal::ExternalConnectionAcceptorImpl>>
acceptors,
grpc_resource_quota* server_rq = nullptr,
std::vector<std::unique_ptr<
grpc::experimental::ServerInterceptorFactoryInterface>>
interceptor_creators = std::vector<std::unique_ptr<
grpc::experimental::ServerInterceptorFactoryInterface>>());
Server(
ChannelArguments* args,
std::shared_ptr<std::vector<std::unique_ptr<grpc::ServerCompletionQueue>>>
sync_server_cqs,
int min_pollers, int max_pollers, int sync_cq_timeout_msec,
std::vector<
std::shared_ptr<grpc::internal::ExternalConnectionAcceptorImpl>>
acceptors,
grpc_resource_quota* server_rq = nullptr,
std::vector<std::unique_ptr<
grpc::experimental::ServerInterceptorFactoryInterface>>
interceptor_creators = std::vector<std::unique_ptr<
grpc::experimental::ServerInterceptorFactoryInterface>>());
/// Start the server.
///
@ -198,7 +199,7 @@ class Server : public grpc::ServerInterface, private grpc::GrpcLibraryCodegen {
/// caller is required to keep all completion queues live until the server is
/// destroyed.
/// \param num_cqs How many completion queues does \a cqs hold.
void Start(ServerCompletionQueue** cqs, size_t num_cqs) override;
void Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) override;
grpc_server* server() override { return server_; }
@ -287,7 +288,7 @@ class Server : public grpc::ServerInterface, private grpc::GrpcLibraryCodegen {
return max_receive_message_size_;
}
CompletionQueue* CallbackCQ() override;
grpc::CompletionQueue* CallbackCQ() override;
grpc_impl::ServerInitializer* initializer();
@ -315,7 +316,7 @@ class Server : public grpc::ServerInterface, private grpc::GrpcLibraryCodegen {
/// The following completion queues are ONLY used in case of Sync API
/// i.e. if the server has any services with sync methods. The server uses
/// these completion queues to poll for new RPCs
std::shared_ptr<std::vector<std::unique_ptr<ServerCompletionQueue>>>
std::shared_ptr<std::vector<std::unique_ptr<grpc::ServerCompletionQueue>>>
sync_server_cqs_;
/// List of \a ThreadManager instances (one for each cq in
@ -373,12 +374,12 @@ class Server : public grpc::ServerInterface, private grpc::GrpcLibraryCodegen {
// with this server (if any). It is set on the first call to CallbackCQ().
// It is _not owned_ by the server; ownership belongs with its internal
// shutdown callback tag (invoked when the CQ is fully shutdown).
CompletionQueue* callback_cq_ /* GUARDED_BY(mu_) */ = nullptr;
grpc::CompletionQueue* callback_cq_ /* GUARDED_BY(mu_) */ = nullptr;
// List of CQs passed in by user that must be Shutdown only after Server is
// Shutdown. Even though this is only used with NDEBUG, instantiate it in all
// cases since otherwise the size will be inconsistent.
std::vector<CompletionQueue*> cq_list_;
std::vector<grpc::CompletionQueue*> cq_list_;
};
} // namespace grpc_impl

@ -24,8 +24,8 @@ namespace grpc {
void AsyncGenericService::RequestCall(
GenericServerContext* ctx, GenericServerAsyncReaderWriter* reader_writer,
::grpc_impl::CompletionQueue* call_cq,
::grpc_impl::ServerCompletionQueue* notification_cq, void* tag) {
::grpc::CompletionQueue* call_cq,
::grpc::ServerCompletionQueue* notification_cq, void* tag) {
server_->RequestAsyncGenericCall(ctx, reader_writer, call_cq, notification_cq,
tag);
}

@ -68,14 +68,14 @@ ServerBuilder::~ServerBuilder() {
}
}
std::unique_ptr<grpc_impl::ServerCompletionQueue>
ServerBuilder::AddCompletionQueue(bool is_frequently_polled) {
grpc_impl::ServerCompletionQueue* cq = new grpc_impl::ServerCompletionQueue(
std::unique_ptr<grpc::ServerCompletionQueue> ServerBuilder::AddCompletionQueue(
bool is_frequently_polled) {
grpc::ServerCompletionQueue* cq = new grpc::ServerCompletionQueue(
GRPC_CQ_NEXT,
is_frequently_polled ? GRPC_CQ_DEFAULT_POLLING : GRPC_CQ_NON_LISTENING,
nullptr);
cqs_.push_back(cq);
return std::unique_ptr<grpc_impl::ServerCompletionQueue>(cq);
return std::unique_ptr<grpc::ServerCompletionQueue>(cq);
}
ServerBuilder& ServerBuilder::RegisterService(Service* service) {
@ -275,11 +275,10 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
// This is different from the completion queues added to the server via
// ServerBuilder's AddCompletionQueue() method (those completion queues
// are in 'cqs_' member variable of ServerBuilder object)
std::shared_ptr<
std::vector<std::unique_ptr<grpc_impl::ServerCompletionQueue>>>
std::shared_ptr<std::vector<std::unique_ptr<grpc::ServerCompletionQueue>>>
sync_server_cqs(
std::make_shared<std::vector<
std::unique_ptr<grpc_impl::ServerCompletionQueue>>>());
std::make_shared<
std::vector<std::unique_ptr<grpc::ServerCompletionQueue>>>());
bool has_frequently_polled_cqs = false;
for (const auto& cq : cqs_) {
@ -307,8 +306,8 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
// Create completion queues to listen to incoming rpc requests
for (int i = 0; i < sync_server_settings_.num_cqs; i++) {
sync_server_cqs->emplace_back(new grpc_impl::ServerCompletionQueue(
GRPC_CQ_NEXT, polling_type, nullptr));
sync_server_cqs->emplace_back(
new grpc::ServerCompletionQueue(GRPC_CQ_NEXT, polling_type, nullptr));
}
}

@ -27,7 +27,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/call.h>
#include <grpcpp/impl/codegen/completion_queue_impl.h>
#include <grpcpp/impl/codegen/completion_queue.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/support/time.h>
@ -89,7 +89,7 @@ class ServerContextBase::CompletionOp final
bool FinalizeResult(void** tag, bool* status) override;
bool CheckCancelled(CompletionQueue* cq) {
bool CheckCancelled(grpc::CompletionQueue* cq) {
cq->TryPluck(this);
return CheckCancelledNoPluck();
}

Loading…
Cancel
Save