From efc757577a95baf13584ff0a3fdb9788031a6b2c Mon Sep 17 00:00:00 2001 From: Abhradeep Kundu Date: Wed, 14 Sep 2022 17:11:02 +0530 Subject: [PATCH] HBASE-27317 Rectifying the option for columnfamily as mandatory (#4773) Signed-off-by: Peter Somogyi --- .../StoreFileListFilePrettyPrinter.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/storefiletracker/StoreFileListFilePrettyPrinter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/storefiletracker/StoreFileListFilePrettyPrinter.java index 9338f2f63320..1025a4759cfb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/storefiletracker/StoreFileListFilePrettyPrinter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/storefiletracker/StoreFileListFilePrettyPrinter.java @@ -61,6 +61,8 @@ public class StoreFileListFilePrettyPrinter extends Configured implements Tool { private final String regionOption = "r"; private final String tableNameOption = "t"; + private final String cmdString = "sft"; + private String namespace; private String regionName; private String columnFamily; @@ -96,9 +98,7 @@ private void init() { public boolean parseOptions(String[] args) throws ParseException, IOException { HelpFormatter formatter = new HelpFormatter(); if (args.length == 0) { - formatter - .printHelp("sft [--file= | --table=" - + " --region= [--columnFamily=] ]", options, true); + formatter.printHelp(cmdString, options, true); return false; } @@ -111,22 +111,19 @@ public boolean parseOptions(String[] args) throws ParseException, IOException { regionName = cmd.getOptionValue(regionOption); if (StringUtils.isEmpty(regionName)) { err.println("Region name is not specified."); - formatter.printHelp("sft [--file= | --table= --region= [--columnFamily=] ]", options, true); + formatter.printHelp(cmdString, options, true); System.exit(1); } columnFamily = cmd.getOptionValue(columnFamilyOption); if (StringUtils.isEmpty(columnFamily)) { err.println("Column family is not specified."); - formatter.printHelp("sft [--file= | --table= --region= [--columnFamily=] ]", options, true); + formatter.printHelp(cmdString, options, true); System.exit(1); } String tableNameWtihNS = cmd.getOptionValue(tableNameOption); if (StringUtils.isEmpty(tableNameWtihNS)) { err.println("Table name is not specified."); - formatter.printHelp("sft [--file= | --table= --region= [--columnFamily=] ]", options, true); + formatter.printHelp(cmdString, options, true); System.exit(1); } TableName tn = TableName.valueOf(tableNameWtihNS);