Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2562511CDB for ; Tue, 1 Jul 2014 19:25:12 +0000 (UTC) Received: (qmail 47736 invoked by uid 500); 1 Jul 2014 19:25:12 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 47624 invoked by uid 500); 1 Jul 2014 19:25:12 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 47527 invoked by uid 99); 1 Jul 2014 19:25:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jul 2014 19:25:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id BD0D09920D5; Tue, 1 Jul 2014 19:25:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bhavanki@apache.org To: commits@accumulo.apache.org Date: Tue, 01 Jul 2014 19:25:13 -0000 Message-Id: <008b3046db1e4f9abb0c0fa138aa6083@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/6] git commit: ACCUMULO-2947 Allow configuration of number of cells per mutation in mem stress test ACCUMULO-2947 Allow configuration of number of cells per mutation in mem stress test A new switch to the memory stress test Write utility, --max-cells-per-mutation, controls the maximum number of cells to be written in any mutation. If the maximum is hit before the configured row width, the current mutation is used and the next mutation picks up where it left off, in the same row. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/75c053d8 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/75c053d8 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/75c053d8 Branch: refs/heads/master Commit: 75c053d8f312020ea0e9ffcc66e26c9322ce380d Parents: d4d455f Author: Bill Havanki Authored: Thu Jun 26 17:21:05 2014 -0400 Committer: Bill Havanki Committed: Tue Jul 1 15:20:56 2014 -0400 ---------------------------------------------------------------------- .../test/stress/random/RandomMutations.java | 21 ++++++++++++++++---- .../accumulo/test/stress/random/Write.java | 5 ++++- .../test/stress/random/WriteOptions.java | 3 +++ test/system/stress/stress-env.sh.example | 4 ++++ test/system/stress/writer.sh | 2 +- 5 files changed, 29 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/75c053d8/test/src/main/java/org/apache/accumulo/test/stress/random/RandomMutations.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/stress/random/RandomMutations.java b/test/src/main/java/org/apache/accumulo/test/stress/random/RandomMutations.java index c4504b2..679b983 100644 --- a/test/src/main/java/org/apache/accumulo/test/stress/random/RandomMutations.java +++ b/test/src/main/java/org/apache/accumulo/test/stress/random/RandomMutations.java @@ -21,24 +21,37 @@ import org.apache.accumulo.core.data.Mutation; public class RandomMutations extends Stream { private final RandomByteArrays rows, column_families, column_qualifiers, values; private final RandomWithinRange row_widths; + private final int max_cells_per_mutation; + private byte[] current_row; + private int cells_remaining_in_row; public RandomMutations(RandomByteArrays rows, RandomByteArrays column_families, - RandomByteArrays column_qualifiers, RandomByteArrays values, RandomWithinRange row_widths) { + RandomByteArrays column_qualifiers, RandomByteArrays values, RandomWithinRange row_widths, + int max_cells_per_mutation) { this.rows = rows; this.column_families = column_families; this.column_qualifiers = column_qualifiers; this.values = values; this.row_widths = row_widths; + this.max_cells_per_mutation = (max_cells_per_mutation > 0 ? max_cells_per_mutation : Integer.MAX_VALUE); + + current_row = null; + cells_remaining_in_row = 0; } // TODO should we care about timestamps? @Override public Mutation next() { - Mutation m = new Mutation(rows.next()); - final int cells = row_widths.next(); - for(int i = 0; i < cells; ++i) { + if (cells_remaining_in_row == 0) { + current_row = rows.next(); + cells_remaining_in_row = row_widths.next(); + } + Mutation m = new Mutation(current_row); + final int cells = Math.min(cells_remaining_in_row, max_cells_per_mutation); + for(int i = 1; i <= cells; i++) { m.put(column_families.next(), column_qualifiers.next(), values.next()); } + cells_remaining_in_row -= cells; return m; } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/75c053d8/test/src/main/java/org/apache/accumulo/test/stress/random/Write.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/stress/random/Write.java b/test/src/main/java/org/apache/accumulo/test/stress/random/Write.java index 9c29871..bb679ad 100644 --- a/test/src/main/java/org/apache/accumulo/test/stress/random/Write.java +++ b/test/src/main/java/org/apache/accumulo/test/stress/random/Write.java @@ -83,7 +83,10 @@ public class Write { new RandomWithinRange( opts.row_width_seed, opts.rowWidthMin(), - opts.rowWidthMax()))); + opts.rowWidthMax()), + // max cells per mutation + opts.max_cells_per_mutation) + ); while(true) { dw.next(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/75c053d8/test/src/main/java/org/apache/accumulo/test/stress/random/WriteOptions.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/stress/random/WriteOptions.java b/test/src/main/java/org/apache/accumulo/test/stress/random/WriteOptions.java index c213528..3e6e647 100644 --- a/test/src/main/java/org/apache/accumulo/test/stress/random/WriteOptions.java +++ b/test/src/main/java/org/apache/accumulo/test/stress/random/WriteOptions.java @@ -72,6 +72,9 @@ class WriteOptions extends ClientOnDefaultTable { @Parameter(names = "--row-width-seed", description = "seed for generating the number of cells within a row (a row's \"width\")") int row_width_seed = 444; + @Parameter(names = "--max-cells-per-mutation", description = "maximum number of cells per mutation; non-positive value implies no limit") + int max_cells_per_mutation = -1; + @Parameter(names = "--write-delay", description = "milliseconds to wait between writes") long write_delay = 0L; http://git-wip-us.apache.org/repos/asf/accumulo/blob/75c053d8/test/system/stress/stress-env.sh.example ---------------------------------------------------------------------- diff --git a/test/system/stress/stress-env.sh.example b/test/system/stress/stress-env.sh.example index 1360c67..6efb24f 100644 --- a/test/system/stress/stress-env.sh.example +++ b/test/system/stress/stress-env.sh.example @@ -52,5 +52,9 @@ CQ_SEED='--cq-seed 3' VALUE_SEED='--value-seed 4' ROW_WIDTH_SEED='--row-width-seed 5' +# This is the maximum number of cells to include in each mutation written out. +# A non-positive value implies no limit. +MAX_CELLS_PER_MUTATION='--max-cells-per-mutation -1' + # This is the delay in milliseconds between writes. Use <= 0 for no delay. WRITE_DELAY='--write-delay 0' http://git-wip-us.apache.org/repos/asf/accumulo/blob/75c053d8/test/system/stress/writer.sh ---------------------------------------------------------------------- diff --git a/test/system/stress/writer.sh b/test/system/stress/writer.sh index 7d9b283..ef26fed 100755 --- a/test/system/stress/writer.sh +++ b/test/system/stress/writer.sh @@ -37,6 +37,6 @@ host=$(hostname) # TBD - --clear-table option ${ACCUMULO_HOME}/bin/accumulo org.apache.accumulo.test.stress.random.Write $INSTANCE $USERPASS $ROW_RANGE $CF_RANGE $CQ_RANGE $VALUE_RANGE \ - $ROW_SEED $CF_SEED $CQ_SEED $VALUE_SEED $ROW_WIDTH $ROW_WIDTH_SEED $WRITE_DELAY \ + $ROW_SEED $CF_SEED $CQ_SEED $VALUE_SEED $ROW_WIDTH $ROW_WIDTH_SEED $MAX_CELLS_PER_MUTATION $WRITE_DELAY \ > $LOG_DIR/${ts}_${host}_writer.out \ 2> $LOG_DIR/${ts}_${host}_writer.err