mirror of https://github.com/apache/cassandra
Merge branch cassandra-2.1 into cassandra-2.2
This commit is contained in:
commit
263763ab9b
|
|
@ -5,6 +5,7 @@
|
|||
* Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474)
|
||||
* Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761)
|
||||
Merged from 2.1:
|
||||
* Make Stress compiles within eclipse (CASSANDRA-10807)
|
||||
* Cassandra Daemon should print JVM arguments (CASSANDRA-10764)
|
||||
* Allow cancellation of index summary redistribution (CASSANDRA-8805)
|
||||
* Fix Stress profile parsing on Windows (CASSANDRA-10808)
|
||||
|
|
|
|||
|
|
@ -31,13 +31,13 @@ public abstract class Generator<T>
|
|||
|
||||
public final String name;
|
||||
public final AbstractType<T> type;
|
||||
public final Class<T> clazz;
|
||||
public final Class<?> clazz;
|
||||
final long salt;
|
||||
final Distribution identityDistribution;
|
||||
final Distribution sizeDistribution;
|
||||
public final Distribution clusteringDistribution;
|
||||
|
||||
public Generator(AbstractType<T> type, GeneratorConfig config, String name, Class<T> clazz)
|
||||
public Generator(AbstractType<T> type, GeneratorConfig config, String name, Class<?> clazz)
|
||||
{
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
|
|
|
|||
|
|
@ -26,16 +26,17 @@ import java.util.List;
|
|||
|
||||
import org.apache.cassandra.db.marshal.ListType;
|
||||
|
||||
public class Lists extends Generator<List>
|
||||
public class Lists<T> extends Generator<List<T>>
|
||||
{
|
||||
final Generator valueType;
|
||||
final Object[] buffer;
|
||||
final Generator<T> valueType;
|
||||
final T[] buffer;
|
||||
|
||||
public Lists(String name, Generator valueType, GeneratorConfig config)
|
||||
@SuppressWarnings("unchecked")
|
||||
public Lists(String name, Generator<T> valueType, GeneratorConfig config)
|
||||
{
|
||||
super(ListType.getInstance(valueType.type, true), config, name, List.class);
|
||||
this.valueType = valueType;
|
||||
buffer = new Object[(int) sizeDistribution.maxValue()];
|
||||
buffer = (T[]) new Object[(int) sizeDistribution.maxValue()];
|
||||
}
|
||||
|
||||
public void setSeed(long seed)
|
||||
|
|
@ -45,7 +46,7 @@ public class Lists extends Generator<List>
|
|||
}
|
||||
|
||||
@Override
|
||||
public List generate()
|
||||
public List<T> generate()
|
||||
{
|
||||
int size = (int) sizeDistribution.next();
|
||||
for (int i = 0 ; i < size ; i++)
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@ import java.util.Set;
|
|||
|
||||
import org.apache.cassandra.db.marshal.SetType;
|
||||
|
||||
public class Sets extends Generator<Set>
|
||||
public class Sets<T> extends Generator<Set<T>>
|
||||
{
|
||||
final Generator valueType;
|
||||
final Generator<T> valueType;
|
||||
|
||||
public Sets(String name, Generator valueType, GeneratorConfig config)
|
||||
public Sets(String name, Generator<T> valueType, GeneratorConfig config)
|
||||
{
|
||||
super(SetType.getInstance(valueType.type, true), config, name, Set.class);
|
||||
this.valueType = valueType;
|
||||
|
|
@ -43,9 +43,9 @@ public class Sets extends Generator<Set>
|
|||
}
|
||||
|
||||
@Override
|
||||
public Set generate()
|
||||
public Set<T> generate()
|
||||
{
|
||||
final Set set = new HashSet();
|
||||
final Set<T> set = new HashSet<T>();
|
||||
int size = (int) sizeDistribution.next();
|
||||
for (int i = 0 ; i < size ; i++)
|
||||
set.add(valueType.generate());
|
||||
|
|
|
|||
Loading…
Reference in New Issue