HBASE-17357 FIX PerformanceEvaluation parameters parsing triggers NPE.

check command name is not null, if null print usage and exit

Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
Dave Navarro 2017-01-20 10:41:36 -06:00 committed by Michael Stack
parent f7d1d25fd7
commit c64236584b
1 changed files with 6 additions and 0 deletions

View File

@ -2145,6 +2145,12 @@ public class PerformanceEvaluation extends Configured implements Tool {
throw new IllegalArgumentException("Number of clients must be > 0");
}
// cmdName should not be null, print help and exit
if (opts.cmdName == null) {
printUsage();
return errCode;
}
Class<? extends Test> cmdClass = determineCommandClass(opts.cmdName);
if (cmdClass != null) {
runTest(cmdClass, opts);