Skip to content

Commit

Permalink
Don't let stress write warmup data if n=0
Browse files Browse the repository at this point in the history
patch by Eduard Tudenhoefner; reviewed by Stefania Alborghetti for CASSANDRA-13773
  • Loading branch information
Eduard Tudenhoefner authored and Stefania Alborghetti committed Aug 22, 2017
1 parent ec85b4a commit 6a1b1f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
@@ -1,4 +1,5 @@
3.0.15
* Don't let stress write warmup data if n=0 (CASSANDRA-13773)
* Gossip thread slows down when using batch commit log (CASSANDRA-12966)
* Randomize batchlog endpoint selection with only 1 or 2 racks (CASSANDRA-12884)
* Fix digest calculation for counter cells (CASSANDRA-13750)
Expand Down
11 changes: 8 additions & 3 deletions tools/stress/src/org/apache/cassandra/stress/StressAction.java
Expand Up @@ -54,6 +54,13 @@ public void run()
// creating keyspace and column families
settings.maybeCreateKeyspaces();

if (settings.command.count == 0)
{
output.println("N=0: SCHEMA CREATED, NOTHING ELSE DONE.");
settings.disconnect();
return;
}

output.println("Sleeping 2s...");
Uninterruptibles.sleepUninterruptibly(2, TimeUnit.SECONDS);

Expand Down Expand Up @@ -87,9 +94,7 @@ private void warmup(OpDistributionFactory operations)
{
PrintStream warmupOutput = new PrintStream(new OutputStream() { @Override public void write(int b) throws IOException { } } );
// do 25% of iterations as warmup but no more than 50k (by default hotspot compiles methods after 10k invocations)
int iterations = (settings.command.count > 0
? Math.min(50000, (int)(settings.command.count * 0.25))
: 50000) * settings.node.nodes.size();
int iterations = Math.min(50000, (int) (settings.command.count * 0.25)) * settings.node.nodes.size();
int threads = 100;

if (settings.rate.maxThreads > 0)
Expand Down

0 comments on commit 6a1b1f2

Please sign in to comment.