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 4d853f9..87873d6 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 @@ -482,6 +482,7 @@ public class PerformanceEvaluation extends Configured implements Tool { public TestOptions(TestOptions that) { this.nomapred = that.nomapred; this.startRow = that.startRow; + this.size = that.size; this.perClientRunRows = that.perClientRunRows; this.numClientThreads = that.numClientThreads; this.totalRows = that.totalRows; @@ -501,6 +502,7 @@ public class PerformanceEvaluation extends Configured implements Tool { public boolean nomapred = false; public int startRow = 0; + public float size = 1.0f; public int perClientRunRows = ROWS_PER_GB; public int numClientThreads = 1; public int totalRows = ROWS_PER_GB; @@ -1216,11 +1218,28 @@ public class PerformanceEvaluation extends Configured implements Tool { continue; } + final String size = "--size="; + if (cmd.startsWith(size)) { + opts.size = Float.parseFloat(cmd.substring(size.length())); + continue; + } + Class cmdClass = determineCommandClass(cmd); if (cmdClass != null) { opts.numClientThreads = getNumClients(i + 1, args); - // number of rows specified - opts.totalRows = opts.perClientRunRows * opts.numClientThreads; + if (opts.size != DEFAULT_OPTS.size && + opts.perClientRunRows != DEFAULT_OPTS.perClientRunRows) { + throw new IllegalArgumentException(rows + " and " + size + " are mutually exclusive arguments."); + } + if (opts.size != DEFAULT_OPTS.size) { + // total size in GB specified + opts.totalRows = (int) opts.size * ROWS_PER_GB; + opts.perClientRunRows = opts.totalRows / opts.numClientThreads; + } else if (opts.perClientRunRows != DEFAULT_OPTS.perClientRunRows) { + // number of rows specified + opts.totalRows = opts.perClientRunRows * opts.numClientThreads; + opts.size = opts.totalRows / ROWS_PER_GB; + } runTest(cmdClass, opts); errCode = 0; break;