From c0e7110f97d8fc03b0f2fcc991c4ab0650937b92 Mon Sep 17 00:00:00 2001 From: Jay Zhuang Date: Mon, 12 Dec 2016 06:20:57 -0800 Subject: [PATCH] Add timeUnit Days for cassandra-stress patch by Jay Zhuang; reviewed by jasobrown for CASSANDRA-13029 --- CHANGES.txt | 1 + .../apache/cassandra/stress/settings/SettingsCommand.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index dfb849d532..c4f4c1f8ef 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 3.12 + * Add timeUnit Days for cassandra-stress (CASSANDRA-13029) * Add mutation size and batch metrics (CASSANDRA-12649) * Add method to get size of endpoints to TokenMetadata (CASSANDRA-12999) * Fix primary index calculation for SASI (CASSANDRA-12910) diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommand.java b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommand.java index c3a171e7a6..1416b8bb18 100644 --- a/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommand.java +++ b/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommand.java @@ -96,6 +96,9 @@ public abstract class SettingsCommand implements Serializable case 'h': this.durationUnits = TimeUnit.HOURS; break; + case 'd': + this.durationUnits = TimeUnit.DAYS; + break; default: throw new IllegalStateException(); } @@ -135,7 +138,7 @@ public abstract class SettingsCommand implements Serializable static class Duration extends Options { - final OptionSimple duration = new OptionSimple("duration=", "[0-9]+[smh]", null, "Time to run in (in seconds, minutes or hours)", true); + final OptionSimple duration = new OptionSimple("duration=", "[0-9]+[smhd]", null, "Time to run in (in seconds, minutes, hours or days)", true); @Override public List options() {