This is an automated email from the ASF dual-hosted git repository. alexey pushed a commit to branch branch-1.17.x in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 44f4b930a8c2a4babc41870678683845694f3975 Author: kedeng <kdeng...@gmail.com> AuthorDate: Tue Apr 9 14:44:26 2024 +0800 KUDU-3326 correct error messages in tool usage instructions This patch mainly fixes the error messages in the recall tool as follows: ` Usage: kudu table recall <master_addresses> <tablet_id> [-new_table_name=<name>] ` We expect to recall tables in soft delete state using the table ID, not the tablet ID. The correct output is as follows: ` Usage: kudu table recall <master_addresses> <table_id> [-new_table_name=<name>] ` This is just about correcting the errors in the prompts and does not involve any related recall logic. Therefore, there are no additional unit tests added. Change-Id: Ib1c6df0806eee78280b00f6a528d42d434a63e2f Reviewed-on: http://gerrit.cloudera.org:8080/21266 Reviewed-by: Alexey Serbin <ale...@apache.org> Tested-by: Alexey Serbin <ale...@apache.org> (cherry picked from commit d06f35db2e5a0e93a3dcab0d3b26e4443914df89) Reviewed-on: http://gerrit.cloudera.org:8080/21273 Reviewed-by: Yingchun Lai <laiyingc...@apache.org> --- src/kudu/tools/tool_action_common.cc | 1 + src/kudu/tools/tool_action_common.h | 1 + src/kudu/tools/tool_action_table.cc | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/kudu/tools/tool_action_common.cc b/src/kudu/tools/tool_action_common.cc index d878d4173..6ee9ce6ec 100644 --- a/src/kudu/tools/tool_action_common.cc +++ b/src/kudu/tools/tool_action_common.cc @@ -272,6 +272,7 @@ const char* const kDestMasterAddressesArgDesc = "Either comma-separated list of "master addresses where each address is of form 'hostname:port', or a cluster name if it has " "been configured in ${KUDU_CONFIG}/kudurc"; const char* const kTableNameArg = "table_name"; +const char* const kTableIdArg = "table_id"; const char* const kTabletIdArg = "tablet_id"; const char* const kTabletIdArgDesc = "Tablet Identifier"; const char* const kTabletIdsCsvArg = "tablet_ids"; diff --git a/src/kudu/tools/tool_action_common.h b/src/kudu/tools/tool_action_common.h index 157c4aa86..d314788b2 100644 --- a/src/kudu/tools/tool_action_common.h +++ b/src/kudu/tools/tool_action_common.h @@ -69,6 +69,7 @@ extern const char* const kMasterAddressesArgDesc; extern const char* const kDestMasterAddressesArg; extern const char* const kDestMasterAddressesArgDesc; extern const char* const kTableNameArg; +extern const char* const kTableIdArg; extern const char* const kTabletIdArg; extern const char* const kTabletIdArgDesc; extern const char* const kTabletIdsCsvArg; diff --git a/src/kudu/tools/tool_action_table.cc b/src/kudu/tools/tool_action_table.cc index 9cc084bc5..f613445c3 100644 --- a/src/kudu/tools/tool_action_table.cc +++ b/src/kudu/tools/tool_action_table.cc @@ -826,7 +826,7 @@ Status SetRowCountLimit(const RunnerContext& context) { } Status RecallTable(const RunnerContext& context) { - const string& table_id = FindOrDie(context.required_args, kTabletIdArg); + const string& table_id = FindOrDie(context.required_args, kTableIdArg); client::sp::shared_ptr<KuduClient> client; RETURN_NOT_OK(CreateKuduClient(context, &client)); return client->RecallTable(table_id, FLAGS_new_table_name); @@ -1858,7 +1858,7 @@ unique_ptr<Mode> BuildTableMode() { ActionBuilder("recall", &RecallTable) .Description("Recall a deleted but still reserved table") .AddRequiredParameter({ kMasterAddressesArg, kMasterAddressesArgDesc }) - .AddRequiredParameter({ kTabletIdArg, "ID of the table to recall" }) + .AddRequiredParameter({ kTableIdArg, "ID of the table to recall" }) .AddOptionalParameter("new_table_name") .Build();