acelyc111 commented on code in PR #1993:
URL:
https://github.com/apache/incubator-pegasus/pull/1993#discussion_r1584194538
##########
src/shell/commands/duplication.cpp:
##########
@@ -82,14 +75,32 @@ bool add_dup(command_executor *e, shell_context *sc,
arguments args)
}
// Check if the boolean option is specified.
- bool is_duplicating_checkpoint = cmd[{"-s", "--sst"}];
+ const auto is_duplicating_checkpoint = cmd[{"-s", "--sst"}];
// Read the app name of the remote cluster, if any.
// Otherwise, use app_name as the remote_app_name.
- std::string remote_app_name(cmd({"-a", "--remote_app_name"},
app_name).str());
+ const std::string remote_app_name(cmd({"-a", "--remote_app_name"},
app_name).str());
+
+ // Read the replica count of the remote app, if any.
+ const auto &remote_replica_count_ss = cmd({"-r",
"--remote_replica_count"});
+
+ // 0 represents that remote_replica_count is missing, which means the
remote_replica_count
+ // would be set as the replica count of source app.
+ int32_t remote_replica_count = 0;
+ if (static_cast<bool>(remote_replica_count_ss)) {
Review Comment:
Is it possible to use macros in src/shell/command_helper.h to simplify the
code?
you can improve the macros if they don't meet requirements.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]