瀏覽代碼

clang-format

Vijay Pai 9 年之前
父節點
當前提交
16e45702ac
共有 2 個文件被更改,包括 22 次插入32 次删除
  1. 14 20
      test/cpp/qps/client_async.cc
  2. 8 12
      test/cpp/qps/server_async.cc

+ 14 - 20
test/cpp/qps/client_async.cc

@@ -94,8 +94,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext {
       std::function<
       std::function<
           std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>(
           std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>(
               BenchmarkService::Stub*, grpc::ClientContext*, const RequestType&,
               BenchmarkService::Stub*, grpc::ClientContext*, const RequestType&,
-              CompletionQueue*)>
-          start_req,
+              CompletionQueue*)> start_req,
       std::function<void(grpc::Status, ResponseType*)> on_done)
       std::function<void(grpc::Status, ResponseType*)> on_done)
       : ClientRpcContext(channel_id),
       : ClientRpcContext(channel_id),
         context_(),
         context_(),
@@ -141,8 +140,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext {
   std::function<void(grpc::Status, ResponseType*)> callback_;
   std::function<void(grpc::Status, ResponseType*)> callback_;
   std::function<std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>(
   std::function<std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>(
       BenchmarkService::Stub*, grpc::ClientContext*, const RequestType&,
       BenchmarkService::Stub*, grpc::ClientContext*, const RequestType&,
-      CompletionQueue*)>
-      start_req_;
+      CompletionQueue*)> start_req_;
   grpc::Status status_;
   grpc::Status status_;
   double start_;
   double start_;
   std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>
   std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>
@@ -161,12 +159,11 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
   using Client::closed_loop_;
   using Client::closed_loop_;
   using ClientImpl<StubType, RequestType>::channels_;
   using ClientImpl<StubType, RequestType>::channels_;
   using ClientImpl<StubType, RequestType>::request_;
   using ClientImpl<StubType, RequestType>::request_;
-  AsyncClient(
-      const ClientConfig& config,
-      std::function<ClientRpcContext*(int, StubType*, const RequestType&)>
-          setup_ctx,
-      std::function<std::unique_ptr<StubType>(std::shared_ptr<Channel>)>
-          create_stub)
+  AsyncClient(const ClientConfig& config,
+              std::function<ClientRpcContext*(int, StubType*,
+                                              const RequestType&)> setup_ctx,
+              std::function<std::unique_ptr<StubType>(std::shared_ptr<Channel>)>
+                  create_stub)
       : ClientImpl<StubType, RequestType>(config, create_stub),
       : ClientImpl<StubType, RequestType>(config, create_stub),
         num_async_threads_(NumThreads(config)),
         num_async_threads_(NumThreads(config)),
         channel_lock_(new std::mutex[config.client_channels()]),
         channel_lock_(new std::mutex[config.client_channels()]),
@@ -408,8 +405,7 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext {
       std::function<std::unique_ptr<
       std::function<std::unique_ptr<
           grpc::ClientAsyncReaderWriter<RequestType, ResponseType>>(
           grpc::ClientAsyncReaderWriter<RequestType, ResponseType>>(
           BenchmarkService::Stub*, grpc::ClientContext*, CompletionQueue*,
           BenchmarkService::Stub*, grpc::ClientContext*, CompletionQueue*,
-          void*)>
-          start_req,
+          void*)> start_req,
       std::function<void(grpc::Status, ResponseType*)> on_done)
       std::function<void(grpc::Status, ResponseType*)> on_done)
       : ClientRpcContext(channel_id),
       : ClientRpcContext(channel_id),
         context_(),
         context_(),
@@ -461,10 +457,10 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext {
   ResponseType response_;
   ResponseType response_;
   bool (ClientRpcContextStreamingImpl::*next_state_)(bool, Histogram*);
   bool (ClientRpcContextStreamingImpl::*next_state_)(bool, Histogram*);
   std::function<void(grpc::Status, ResponseType*)> callback_;
   std::function<void(grpc::Status, ResponseType*)> callback_;
-  std::function<std::unique_ptr<
-      grpc::ClientAsyncReaderWriter<RequestType, ResponseType>>(
-      BenchmarkService::Stub*, grpc::ClientContext*, CompletionQueue*, void*)>
-      start_req_;
+  std::function<
+      std::unique_ptr<grpc::ClientAsyncReaderWriter<RequestType, ResponseType>>(
+          BenchmarkService::Stub*, grpc::ClientContext*, CompletionQueue*,
+          void*)> start_req_;
   grpc::Status status_;
   grpc::Status status_;
   double start_;
   double start_;
   std::unique_ptr<grpc::ClientAsyncReaderWriter<RequestType, ResponseType>>
   std::unique_ptr<grpc::ClientAsyncReaderWriter<RequestType, ResponseType>>
@@ -508,8 +504,7 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext {
       int channel_id, grpc::GenericStub* stub, const ByteBuffer& req,
       int channel_id, grpc::GenericStub* stub, const ByteBuffer& req,
       std::function<std::unique_ptr<grpc::GenericClientAsyncReaderWriter>(
       std::function<std::unique_ptr<grpc::GenericClientAsyncReaderWriter>(
           grpc::GenericStub*, grpc::ClientContext*,
           grpc::GenericStub*, grpc::ClientContext*,
-          const grpc::string& method_name, CompletionQueue*, void*)>
-          start_req,
+          const grpc::string& method_name, CompletionQueue*, void*)> start_req,
       std::function<void(grpc::Status, ByteBuffer*)> on_done)
       std::function<void(grpc::Status, ByteBuffer*)> on_done)
       : ClientRpcContext(channel_id),
       : ClientRpcContext(channel_id),
         context_(),
         context_(),
@@ -566,8 +561,7 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext {
   std::function<void(grpc::Status, ByteBuffer*)> callback_;
   std::function<void(grpc::Status, ByteBuffer*)> callback_;
   std::function<std::unique_ptr<grpc::GenericClientAsyncReaderWriter>(
   std::function<std::unique_ptr<grpc::GenericClientAsyncReaderWriter>(
       grpc::GenericStub*, grpc::ClientContext*, const grpc::string&,
       grpc::GenericStub*, grpc::ClientContext*, const grpc::string&,
-      CompletionQueue*, void*)>
-      start_req_;
+      CompletionQueue*, void*)> start_req_;
   grpc::Status status_;
   grpc::Status status_;
   double start_;
   double start_;
   std::unique_ptr<grpc::GenericClientAsyncReaderWriter> stream_;
   std::unique_ptr<grpc::GenericClientAsyncReaderWriter> stream_;

+ 8 - 12
test/cpp/qps/server_async.cc

@@ -72,8 +72,7 @@ class AsyncQpsServerTest : public Server {
                          CompletionQueue *, ServerCompletionQueue *, void *)>
                          CompletionQueue *, ServerCompletionQueue *, void *)>
           request_streaming_function,
           request_streaming_function,
       std::function<grpc::Status(const PayloadConfig &, const RequestType *,
       std::function<grpc::Status(const PayloadConfig &, const RequestType *,
-                                 ResponseType *)>
-          process_rpc)
+                                 ResponseType *)> process_rpc)
       : Server(config) {
       : Server(config) {
     char *server_address = NULL;
     char *server_address = NULL;
 
 
@@ -191,8 +190,7 @@ class AsyncQpsServerTest : public Server {
     ServerRpcContextUnaryImpl(
     ServerRpcContextUnaryImpl(
         std::function<void(ServerContextType *, RequestType *,
         std::function<void(ServerContextType *, RequestType *,
                            grpc::ServerAsyncResponseWriter<ResponseType> *,
                            grpc::ServerAsyncResponseWriter<ResponseType> *,
-                           void *)>
-            request_method,
+                           void *)> request_method,
         std::function<grpc::Status(const RequestType *, ResponseType *)>
         std::function<grpc::Status(const RequestType *, ResponseType *)>
             invoke_method)
             invoke_method)
         : srv_ctx_(new ServerContextType),
         : srv_ctx_(new ServerContextType),
@@ -389,14 +387,12 @@ static Status ProcessGenericRPC(const PayloadConfig &payload_config,
 }
 }
 
 
 std::unique_ptr<Server> CreateAsyncServer(const ServerConfig &config) {
 std::unique_ptr<Server> CreateAsyncServer(const ServerConfig &config) {
-  return std::unique_ptr<Server>(
-      new AsyncQpsServerTest<SimpleRequest, SimpleResponse,
-                             BenchmarkService::AsyncService,
-                             grpc::ServerContext>(
-          config, RegisterBenchmarkService,
-          &BenchmarkService::AsyncService::RequestUnaryCall,
-          &BenchmarkService::AsyncService::RequestStreamingCall,
-          ProcessSimpleRPC));
+  return std::unique_ptr<Server>(new AsyncQpsServerTest<
+      SimpleRequest, SimpleResponse, BenchmarkService::AsyncService,
+      grpc::ServerContext>(
+      config, RegisterBenchmarkService,
+      &BenchmarkService::AsyncService::RequestUnaryCall,
+      &BenchmarkService::AsyncService::RequestStreamingCall, ProcessSimpleRPC));
 }
 }
 std::unique_ptr<Server> CreateAsyncGenericServer(const ServerConfig &config) {
 std::unique_ptr<Server> CreateAsyncGenericServer(const ServerConfig &config) {
   return std::unique_ptr<Server>(
   return std::unique_ptr<Server>(