This is an automated email from the ASF dual-hosted git repository.

jiashuo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git

commit 45d4bb90aaec354b7d5613116e123e524b9a41fc
Author: Jiashuo <[email protected]>
AuthorDate: Wed Mar 30 11:43:44 2022 +0800

    refactor(dup_enhancement#24): delete useless `freezed` argument (#935)
---
 src/shell/commands/duplication.cpp | 18 ++++--------------
 src/shell/main.cpp                 |  3 +--
 2 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/src/shell/commands/duplication.cpp 
b/src/shell/commands/duplication.cpp
index 3119be4..862f4c3 100644
--- a/src/shell/commands/duplication.cpp
+++ b/src/shell/commands/duplication.cpp
@@ -38,12 +38,6 @@ bool add_dup(command_executor *e, shell_context *sc, 
arguments args)
         fmt::print(stderr, "too many params\n");
         return false;
     }
-    for (const auto &flag : cmd.flags()) {
-        if (flag != "f" && flag != "freeze") {
-            fmt::print(stderr, "unknown flag {}\n", flag);
-            return false;
-        }
-    }
 
     if (!cmd(1)) {
         fmt::print(stderr, "missing param <app_name>\n");
@@ -63,9 +57,7 @@ bool add_dup(command_executor *e, shell_context *sc, 
arguments args)
         return true;
     }
 
-    bool freeze = cmd[{"-f", "--freeze"}];
-
-    auto err_resp = sc->ddl_client->add_dup(app_name, remote_cluster_name, 
freeze);
+    auto err_resp = sc->ddl_client->add_dup(app_name, remote_cluster_name);
     dsn::error_s err = err_resp.get_error();
     std::string hint;
     if (err.is_ok()) {
@@ -74,10 +66,9 @@ bool add_dup(command_executor *e, shell_context *sc, 
arguments args)
     }
     if (!err.is_ok()) {
         fmt::print(stderr,
-                   "adding duplication failed [app: {}, remote: {}, freeze: 
{}, error: {}]\n",
+                   "adding duplication failed [app: {}, remote: {}, error: 
{}]\n",
                    app_name,
                    remote_cluster_name,
-                   freeze,
                    err.description());
         if (!hint.empty()) {
             fmt::print(stderr, "detail:\n  {}\n", hint);
@@ -85,12 +76,11 @@ bool add_dup(command_executor *e, shell_context *sc, 
arguments args)
     } else {
         const auto &resp = err_resp.get_value();
         fmt::print("adding duplication succeed [app: {}, remote: {}, appid: 
{}, dupid: "
-                   "{}, freeze: {}]\n",
+                   "{}]\n",
                    app_name,
                    remote_cluster_name,
                    resp.appid,
-                   resp.dupid,
-                   freeze);
+                   resp.dupid);
     }
     return true;
 }
diff --git a/src/shell/main.cpp b/src/shell/main.cpp
index 897e24a..b1fa1f5 100644
--- a/src/shell/main.cpp
+++ b/src/shell/main.cpp
@@ -449,8 +449,7 @@ static command_executor commands[] = {
         "[-s|--skip_prompt] [-o|--output file_name]",
         ddd_diagnose,
     },
-    // todo(jiashuo1) [-f|--freezed] is Deprecated, it will be removed later
-    {"add_dup", "add duplication", "<app_name> <remote_cluster_name> 
[-f|--freezed]", add_dup},
+    {"add_dup", "add duplication", "<app_name> <remote_cluster_name>", 
add_dup},
     {"query_dup", "query duplication info", "<app_name> [-d|--detail]", 
query_dup},
     {"remove_dup", "remove duplication", "<app_name> <dup_id>", remove_dup},
     {"start_dup", "start duplication", "<app_name> <dup_id>", start_dup},

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to