Merge branch 'cassandra-2.1' into trunk

This commit is contained in:
Benedict Elliott Smith 2014-12-17 09:28:17 +00:00
commit e6c5982fa3
3 changed files with 5 additions and 16 deletions

View File

@ -169,7 +169,6 @@ public abstract class PartitionIterator implements Iterator<Row>
// so that we know with what chance we reached there, and we adjust our roll at that level by that amount
final double[] chancemodifier = new double[generator.clusteringComponents.size()];
final double[] rollmodifier = new double[generator.clusteringComponents.size()];
final ThreadLocalRandom random = ThreadLocalRandom.current();
// track where in the partition we are, and where we are limited to
final int[] position = new int[generator.clusteringComponents.size()];
@ -240,7 +239,7 @@ public abstract class PartitionIterator implements Iterator<Row>
}
// seek to our start position
switch (seek(isWrite ? position : null))
switch (seek(isWrite ? position : 0))
{
case END_OF_PARTITION:
return false;
@ -382,6 +381,7 @@ public abstract class PartitionIterator implements Iterator<Row>
private boolean advance(int depth, boolean first)
{
ThreadLocalRandom random = ThreadLocalRandom.current();
// advance the leaf component
clusteringComponents[depth].poll();
position[depth]++;
@ -548,9 +548,9 @@ public abstract class PartitionIterator implements Iterator<Row>
private State setHasNext(boolean hasNext)
{
this.hasNext = hasNext;
if (!hasNext)
{
this.hasNext = false;
boolean isLast = finishedPartition();
if (isWrite)
{
@ -562,7 +562,6 @@ public abstract class PartitionIterator implements Iterator<Row>
}
return isLast ? State.END_OF_PARTITION : State.AFTER_LIMIT;
}
this.hasNext = hasNext;
return State.SUCCESS;
}
}

View File

@ -44,15 +44,10 @@ public class SchemaInsert extends SchemaStatement
public SchemaInsert(Timer timer, StressSettings settings, PartitionGenerator generator, SeedManager seedManager, Distribution batchSize, RatioDistribution useRatio, Integer thriftId, PreparedStatement statement, ConsistencyLevel cl, BatchStatement.Type batchType)
{
super(timer, settings, spec(generator, seedManager, batchSize, useRatio), statement, thriftId, cl, ValidationType.NOT_FAIL);
super(timer, settings, new DataSpec(generator, seedManager, batchSize, useRatio), statement, thriftId, cl, ValidationType.NOT_FAIL);
this.batchType = batchType;
}
private static DataSpec spec(PartitionGenerator generator, SeedManager seedManager, Distribution partitionCount, RatioDistribution useRatio)
{
return new DataSpec(generator, seedManager, partitionCount, useRatio);
}
private class JavaDriverRun extends Runner
{
final JavaDriverClient client;

View File

@ -54,16 +54,11 @@ public class SchemaQuery extends SchemaStatement
public SchemaQuery(Timer timer, StressSettings settings, PartitionGenerator generator, SeedManager seedManager, Integer thriftId, PreparedStatement statement, ConsistencyLevel cl, ValidationType validationType, ArgSelect argSelect)
{
super(timer, settings, spec(generator, seedManager, statement.getVariables().size(), argSelect), statement, thriftId, cl, validationType);
super(timer, settings, new DataSpec(generator, seedManager, new DistributionFixed(1), argSelect == ArgSelect.MULTIROW ? statement.getVariables().size() : 1), statement, thriftId, cl, validationType);
this.argSelect = argSelect;
randomBuffer = new Object[argumentIndex.length][argumentIndex.length];
}
static DataSpec spec(PartitionGenerator generator, SeedManager seedManager, int argCount, ArgSelect argSelect)
{
return new DataSpec(generator, seedManager, new DistributionFixed(1), argSelect == ArgSelect.MULTIROW ? argCount : 1);
}
private class JavaDriverRun extends Runner
{
final JavaDriverClient client;