From d667556d060068a4a93e5331372b92468f0996d8 Mon Sep 17 00:00:00 2001 From: Jake Luciani Date: Fri, 1 Aug 2014 09:23:02 -0400 Subject: [PATCH] remove seed from stress profile. cleanup yamls. ninja --- tools/cqlstress-counter-example.yaml | 7 +---- tools/cqlstress-example.yaml | 8 +---- tools/cqlstress-insanity-example.yaml | 18 +++-------- .../cassandra/stress/StressProfile.java | 30 +++++++++++-------- .../apache/cassandra/stress/StressYaml.java | 1 - 5 files changed, 23 insertions(+), 41 deletions(-) diff --git a/tools/cqlstress-counter-example.yaml b/tools/cqlstress-counter-example.yaml index a65080adcd..cff14b64a0 100644 --- a/tools/cqlstress-counter-example.yaml +++ b/tools/cqlstress-counter-example.yaml @@ -52,12 +52,11 @@ table_definition: | # # If preceded by ~, the distribution is inverted # -# Defaults for all columns are size: uniform(1..256), identity: uniform(1..1024) +# Defaults for all columns are size: uniform(4..8), population: uniform(1..100B), cluster: fixed(1) # columnspec: - name: name - clustering: uniform(1..100) size: uniform(1..4) - name: count population: fixed(1) @@ -79,7 +78,3 @@ insert: queries: simple1: select * from counttest where name = ? -# -# In order to generate data consistently we need something to generate a unique key for this schema profile. -# -seed: changing this string changes the generated data. its hashcode is used as the random seed. diff --git a/tools/cqlstress-example.yaml b/tools/cqlstress-example.yaml index a997529174..d5c90a2159 100644 --- a/tools/cqlstress-example.yaml +++ b/tools/cqlstress-example.yaml @@ -62,13 +62,12 @@ table_definition: | # # If preceded by ~, the distribution is inverted # -# Defaults for all columns are size: uniform(1..256), identity: uniform(1..1024) +# Defaults for all columns are size: uniform(4..8), population: uniform(1..100B), cluster: fixed(1) # columnspec: - name: name size: uniform(1..10) population: uniform(1..1M) # the range of unique values to select for the field (default is 100Billion) - - name: choice - name: date cluster: uniform(1..4) - name: lval @@ -92,8 +91,3 @@ insert: queries: simple1: select * from typestest where name = ? and choice = ? LIMIT 100 range1: select * from typestest where name = ? and choice = ? and date >= ? LIMIT 100 - -# -# In order to generate data consistently we need something to generate a unique key for this schema profile. -# -seed: changing this string changes the generated data. its hashcode is used as the random seed. diff --git a/tools/cqlstress-insanity-example.yaml b/tools/cqlstress-insanity-example.yaml index e94c9c32e9..ef1bb3aa3a 100644 --- a/tools/cqlstress-insanity-example.yaml +++ b/tools/cqlstress-insanity-example.yaml @@ -64,26 +64,20 @@ table_definition: | # # If preceded by ~, the distribution is inverted # -# Defaults for all columns are size: uniform(1..256), population: uniform(1..100B) +# Defaults for all columns are size: uniform(4..8), population: uniform(1..100B), cluster: fixed(1) # columnspec: - - name: name - clustering: uniform(1..4) - name: date - clustering: gaussian(1..20) + cluster: gaussian(1..20) - name: lval population: fixed(1) - - name: dates - clustering: uniform(1..100) - - name: inets - clustering: uniform(1..200) - - name: value + insert: partitions: fixed(1) # number of unique partitions to update in a single operation # if perbatch < 1, multiple batches will be used but all partitions will # occur in all batches (unless already finished); only the row counts will vary - pervisit: uniform(1..10)/100K # ratio of rows each partition should update in a single visit to the partition, + pervisit: uniform(1..10)/10 # ratio of rows each partition should update in a single visit to the partition, # as a proportion of the total possible for the partition perbatch: fixed(1)/1 # number of rows each partition should update in a single batch statement, # as a proportion of the proportion we are inserting this visit @@ -96,7 +90,3 @@ insert: queries: simple1: select * from insanitytest where name = ? and choice = ? LIMIT 100 -# -# In order to generate data consistently we need something to generate a unique key for this schema profile. -# -seed: changing this string changes the generated data. its hashcode is used as the random seed. diff --git a/tools/stress/src/org/apache/cassandra/stress/StressProfile.java b/tools/stress/src/org/apache/cassandra/stress/StressProfile.java index 13f26a250a..f24ec8c599 100644 --- a/tools/stress/src/org/apache/cassandra/stress/StressProfile.java +++ b/tools/stress/src/org/apache/cassandra/stress/StressProfile.java @@ -111,7 +111,7 @@ public class StressProfile implements Serializable keyspaceCql = yaml.keyspace_definition; tableName = yaml.table; tableCql = yaml.table_definition; - seedStr = yaml.seed; + seedStr = "seed for stress"; queries = yaml.queries; insert = yaml.insert; @@ -140,21 +140,25 @@ public class StressProfile implements Serializable } columnConfigs = new HashMap<>(); - for (Map spec : yaml.columnspec) + + if (yaml.columnspec != null) { - lowerCase(spec); - String name = (String) spec.remove("name"); - DistributionFactory population = !spec.containsKey("population") ? null : OptionDistribution.get((String) spec.remove("population")); - DistributionFactory size = !spec.containsKey("size") ? null : OptionDistribution.get((String) spec.remove("size")); - DistributionFactory clustering = !spec.containsKey("cluster") ? null : OptionDistribution.get((String) spec.remove("cluster")); + for (Map spec : yaml.columnspec) + { + lowerCase(spec); + String name = (String) spec.remove("name"); + DistributionFactory population = !spec.containsKey("population") ? null : OptionDistribution.get((String) spec.remove("population")); + DistributionFactory size = !spec.containsKey("size") ? null : OptionDistribution.get((String) spec.remove("size")); + DistributionFactory clustering = !spec.containsKey("cluster") ? null : OptionDistribution.get((String) spec.remove("cluster")); - if (!spec.isEmpty()) - throw new IllegalArgumentException("Unrecognised option(s) in column spec: " + spec); - if (name == null) - throw new IllegalArgumentException("Missing name argument in column spec"); + if (!spec.isEmpty()) + throw new IllegalArgumentException("Unrecognised option(s) in column spec: " + spec); + if (name == null) + throw new IllegalArgumentException("Missing name argument in column spec"); - GeneratorConfig config = new GeneratorConfig(yaml.seed + name, clustering, size, population); - columnConfigs.put(name, config); + GeneratorConfig config = new GeneratorConfig(seedStr + name, clustering, size, population); + columnConfigs.put(name, config); + } } } diff --git a/tools/stress/src/org/apache/cassandra/stress/StressYaml.java b/tools/stress/src/org/apache/cassandra/stress/StressYaml.java index e94fa77e2d..deea1fbde0 100644 --- a/tools/stress/src/org/apache/cassandra/stress/StressYaml.java +++ b/tools/stress/src/org/apache/cassandra/stress/StressYaml.java @@ -25,7 +25,6 @@ import java.util.Map; public class StressYaml { - public String seed; public String keyspace; public String keyspace_definition; public String table;