HBASE-27317 Rectifying the option for columnfamily as mandatory (#4773)
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
This commit is contained in:
parent
b3a04899a4
commit
efc757577a
|
@ -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 @@ public class StoreFileListFilePrettyPrinter extends Configured implements Tool {
|
|||
public boolean parseOptions(String[] args) throws ParseException, IOException {
|
||||
HelpFormatter formatter = new HelpFormatter();
|
||||
if (args.length == 0) {
|
||||
formatter
|
||||
.printHelp("sft [--file=</path/to/tracker/file> | --table=<namespace:tablename|tablename>"
|
||||
+ " --region=<regionname> [--columnFamily=<columnfamily>] ]", options, true);
|
||||
formatter.printHelp(cmdString, options, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -111,22 +111,19 @@ public class StoreFileListFilePrettyPrinter extends Configured implements Tool {
|
|||
regionName = cmd.getOptionValue(regionOption);
|
||||
if (StringUtils.isEmpty(regionName)) {
|
||||
err.println("Region name is not specified.");
|
||||
formatter.printHelp("sft [--file=</path/to/tracker/file> | --table=<namespace:tablename|"
|
||||
+ "tablename> --region=<regionname> [--columnFamily=<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=</path/to/tracker/file> | --table=<namespace:tablename|"
|
||||
+ "tablename> --region=<regionname> [--columnFamily=<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=</path/to/tracker/file> | --table=<namespace:tablename|"
|
||||
+ "tablename> --region=<regionname> [--columnFamily=<columnfamily>] ]", options, true);
|
||||
formatter.printHelp(cmdString, options, true);
|
||||
System.exit(1);
|
||||
}
|
||||
TableName tn = TableName.valueOf(tableNameWtihNS);
|
||||
|
|
Loading…
Reference in New Issue