Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 b407ebc89 -> f5a1c374c
remove seed from stress profile. cleanup yamls. ninja Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d667556d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d667556d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d667556d Branch: refs/heads/cassandra-2.1 Commit: d667556d060068a4a93e5331372b92468f0996d8 Parents: 4632673 Author: Jake Luciani <j...@apache.org> Authored: Fri Aug 1 09:23:02 2014 -0400 Committer: Jake Luciani <j...@apache.org> Committed: Fri Aug 1 09:23:02 2014 -0400 ---------------------------------------------------------------------- tools/cqlstress-counter-example.yaml | 7 +--- tools/cqlstress-example.yaml | 8 +---- tools/cqlstress-insanity-example.yaml | 18 +++-------- .../apache/cassandra/stress/StressProfile.java | 34 +++++++++++--------- .../org/apache/cassandra/stress/StressYaml.java | 1 - 5 files changed, 25 insertions(+), 43 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/d667556d/tools/cqlstress-counter-example.yaml ---------------------------------------------------------------------- diff --git a/tools/cqlstress-counter-example.yaml b/tools/cqlstress-counter-example.yaml index a65080a..cff14b6 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. http://git-wip-us.apache.org/repos/asf/cassandra/blob/d667556d/tools/cqlstress-example.yaml ---------------------------------------------------------------------- diff --git a/tools/cqlstress-example.yaml b/tools/cqlstress-example.yaml index a997529..d5c90a2 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. http://git-wip-us.apache.org/repos/asf/cassandra/blob/d667556d/tools/cqlstress-insanity-example.yaml ---------------------------------------------------------------------- diff --git a/tools/cqlstress-insanity-example.yaml b/tools/cqlstress-insanity-example.yaml index e94c9c3..ef1bb3a 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. http://git-wip-us.apache.org/repos/asf/cassandra/blob/d667556d/tools/stress/src/org/apache/cassandra/stress/StressProfile.java ---------------------------------------------------------------------- diff --git a/tools/stress/src/org/apache/cassandra/stress/StressProfile.java b/tools/stress/src/org/apache/cassandra/stress/StressProfile.java index 13f26a2..f24ec8c 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<String,Object> 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")); - - 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); + for (Map<String, Object> 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"); + + GeneratorConfig config = new GeneratorConfig(seedStr + name, clustering, size, population); + columnConfigs.put(name, config); + } } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/d667556d/tools/stress/src/org/apache/cassandra/stress/StressYaml.java ---------------------------------------------------------------------- diff --git a/tools/stress/src/org/apache/cassandra/stress/StressYaml.java b/tools/stress/src/org/apache/cassandra/stress/StressYaml.java index e94fa77..deea1fb 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;