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 regionOption = "r";
|
||||||
private final String tableNameOption = "t";
|
private final String tableNameOption = "t";
|
||||||
|
|
||||||
|
private final String cmdString = "sft";
|
||||||
|
|
||||||
private String namespace;
|
private String namespace;
|
||||||
private String regionName;
|
private String regionName;
|
||||||
private String columnFamily;
|
private String columnFamily;
|
||||||
@ -96,9 +98,7 @@ public class StoreFileListFilePrettyPrinter extends Configured implements Tool {
|
|||||||
public boolean parseOptions(String[] args) throws ParseException, IOException {
|
public boolean parseOptions(String[] args) throws ParseException, IOException {
|
||||||
HelpFormatter formatter = new HelpFormatter();
|
HelpFormatter formatter = new HelpFormatter();
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
formatter
|
formatter.printHelp(cmdString, options, true);
|
||||||
.printHelp("sft [--file=</path/to/tracker/file> | --table=<namespace:tablename|tablename>"
|
|
||||||
+ " --region=<regionname> [--columnFamily=<columnfamily>] ]", options, true);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,22 +111,19 @@ public class StoreFileListFilePrettyPrinter extends Configured implements Tool {
|
|||||||
regionName = cmd.getOptionValue(regionOption);
|
regionName = cmd.getOptionValue(regionOption);
|
||||||
if (StringUtils.isEmpty(regionName)) {
|
if (StringUtils.isEmpty(regionName)) {
|
||||||
err.println("Region name is not specified.");
|
err.println("Region name is not specified.");
|
||||||
formatter.printHelp("sft [--file=</path/to/tracker/file> | --table=<namespace:tablename|"
|
formatter.printHelp(cmdString, options, true);
|
||||||
+ "tablename> --region=<regionname> [--columnFamily=<columnfamily>] ]", options, true);
|
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
columnFamily = cmd.getOptionValue(columnFamilyOption);
|
columnFamily = cmd.getOptionValue(columnFamilyOption);
|
||||||
if (StringUtils.isEmpty(columnFamily)) {
|
if (StringUtils.isEmpty(columnFamily)) {
|
||||||
err.println("Column family is not specified.");
|
err.println("Column family is not specified.");
|
||||||
formatter.printHelp("sft [--file=</path/to/tracker/file> | --table=<namespace:tablename|"
|
formatter.printHelp(cmdString, options, true);
|
||||||
+ "tablename> --region=<regionname> [--columnFamily=<columnfamily>] ]", options, true);
|
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
String tableNameWtihNS = cmd.getOptionValue(tableNameOption);
|
String tableNameWtihNS = cmd.getOptionValue(tableNameOption);
|
||||||
if (StringUtils.isEmpty(tableNameWtihNS)) {
|
if (StringUtils.isEmpty(tableNameWtihNS)) {
|
||||||
err.println("Table name is not specified.");
|
err.println("Table name is not specified.");
|
||||||
formatter.printHelp("sft [--file=</path/to/tracker/file> | --table=<namespace:tablename|"
|
formatter.printHelp(cmdString, options, true);
|
||||||
+ "tablename> --region=<regionname> [--columnFamily=<columnfamily>] ]", options, true);
|
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
TableName tn = TableName.valueOf(tableNameWtihNS);
|
TableName tn = TableName.valueOf(tableNameWtihNS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user