hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [29/50] [abbrv] hbase git commit: HBASE-17357 FIX PerformanceEvaluation parameters parsing triggers NPE.
Date Mon, 23 Jan 2017 23:02:02 GMT
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>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/c74cf129
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/c74cf129
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/c74cf129

Branch: refs/heads/HBASE-16961
Commit: c74cf12925b810b7a59c5b639834508f00054053
Parents: 7901805
Author: Dave Navarro <mrdavenavarro@gmail.com>
Authored: Fri Jan 20 10:41:36 2017 -0600
Committer: Michael Stack <stack@apache.org>
Committed: Fri Jan 20 22:51:57 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/PerformanceEvaluation.java    | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c74cf129/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index d1fb7f8..7f1c640 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
@@ -2223,6 +2223,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);


Mime
View raw message