use of org.apache.cassandra.stress.Operation in project cassandra by apache.
the class SampledOpDistributionFactory method get.
public OpDistribution get(boolean isWarmup, MeasurementSink sink) {
PartitionGenerator generator = newGenerator();
List<Pair<Operation, Double>> operations = new ArrayList<>();
for (Map.Entry<T, Double> ratio : ratios.entrySet()) {
List<? extends Operation> ops = get(new Timer(ratio.getKey().toString(), sink), generator, ratio.getKey(), isWarmup);
for (Operation op : ops) operations.add(new Pair<>(op, ratio.getValue() / ops.size()));
}
return new SampledOpDistribution(new EnumeratedDistribution<>(operations), clustering.get());
}