You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2021/04/09 10:51:28 UTC

[GitHub] [incubator-pegasus] Smityz commented on a change in pull request #718: fix: overload dump_write_request shouldn't auto-reply to client

Smityz commented on a change in pull request #718:
URL: https://github.com/apache/incubator-pegasus/pull/718#discussion_r610532265



##########
File path: src/server/pegasus_server_impl.cpp
##########
@@ -2846,49 +2846,35 @@ std::string pegasus_server_impl::dump_write_request(dsn::message_ex *request)
 {
     dsn::task_code rpc_code(request->rpc_code());
     if (rpc_code == dsn::apps::RPC_RRDB_RRDB_PUT) {
-        auto put = put_rpc::auto_reply(request).request();
+        auto put = put_rpc(request).request();
         ::dsn::blob hash_key, sort_key;
         pegasus_restore_key(put.key, hash_key, sort_key);
-        std::string request("put:");
-        request.append("hash_key=")
-            .append(pegasus::utils::c_escape_string(hash_key))
-            .append(",sort_key=")
-            .append(pegasus::utils::c_escape_string(sort_key));
-        return request;
+        return fmt::format("put: hash_key={}, sort_key={}",
+                           pegasus::utils::c_escape_string(hash_key),
+                           pegasus::utils::c_escape_string(sort_key));
     }
 
     if (rpc_code == dsn::apps::RPC_RRDB_RRDB_MULTI_PUT) {
-        auto multi_put = multi_put_rpc::auto_reply(request).request();
-        std::string request("multi_put:");
-        request.append("hash_key=")
-            .append(pegasus::utils::c_escape_string((multi_put.hash_key))
-                        .append(",multi_put_count=")
-                        .append(std::to_string(multi_put.kvs.size())));
-        return request;
+        auto multi_put = multi_put_rpc(request).request();
+        return fmt::format("multi_put: hash_key={}, multi_put_count={}",
+                           pegasus::utils::c_escape_string(multi_put.hash_key),
+                           std::to_string(multi_put.kvs.size()));

Review comment:
       no need to use `std::to_string`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org