diff --git a/tools/stress/src/org/apache/cassandra/stress/StressProfile.java b/tools/stress/src/org/apache/cassandra/stress/StressProfile.java index 272f3c75a1..9c9b9213a1 100644 --- a/tools/stress/src/org/apache/cassandra/stress/StressProfile.java +++ b/tools/stress/src/org/apache/cassandra/stress/StressProfile.java @@ -514,6 +514,7 @@ public class StressProfile implements Serializable case BOOLEAN: return new Booleans(name, config); case DECIMAL: + return new BigDecimals(name, config); case DOUBLE: return new Doubles(name, config); case FLOAT: @@ -535,7 +536,7 @@ public class StressProfile implements Serializable case LIST: return new Lists(name, getGenerator(name, type.getTypeArguments().get(0), config), config); default: - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException("Because of this name: "+name+" if you removed it from the yaml and are still seeing this, make sure to drop table"); } } } diff --git a/tools/stress/src/org/apache/cassandra/stress/generate/values/BigDecimals.java b/tools/stress/src/org/apache/cassandra/stress/generate/values/BigDecimals.java new file mode 100644 index 0000000000..42758edc8d --- /dev/null +++ b/tools/stress/src/org/apache/cassandra/stress/generate/values/BigDecimals.java @@ -0,0 +1,39 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.cassandra.stress.generate.values; + +import org.apache.cassandra.db.marshal.DecimalType; + +import java.math.BigDecimal; + +public class BigDecimals extends Generator +{ + public BigDecimals(String name, GeneratorConfig config) + { + super(DecimalType.instance, config, name, BigDecimal.class); + } + + @Override + public BigDecimal generate() + { + return BigDecimal.valueOf(identityDistribution.next()); + } +}