Merge branch 'cassandra-2.1' into cassandra-2.2

This commit is contained in:
Benedict Elliott Smith 2015-08-23 11:30:43 +01:00
commit a6d6540446
2 changed files with 41 additions and 1 deletions

View File

@ -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");
}
}
}

View File

@ -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<BigDecimal>
{
public BigDecimals(String name, GeneratorConfig config)
{
super(DecimalType.instance, config, name, BigDecimal.class);
}
@Override
public BigDecimal generate()
{
return BigDecimal.valueOf(identityDistribution.next());
}
}