本文整理汇总了Java中org.apache.cassandra.stress.util.DynamicList类的典型用法代码示例。如果您正苦于以下问题:Java DynamicList类的具体用法?Java DynamicList怎么用?Java DynamicList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DynamicList类属于org.apache.cassandra.stress.util包,在下文中一共展示了DynamicList类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SeedManager
import org.apache.cassandra.stress.util.DynamicList; //导入依赖的package包/类
public SeedManager(StressSettings settings)
{
Generator writes, reads;
if (settings.generate.sequence != null)
{
long[] seq = settings.generate.sequence;
if (settings.generate.readlookback != null)
{
LookbackableWriteGenerator series = new LookbackableWriteGenerator(seq[0], seq[1], settings.generate.wrap, settings.generate.readlookback.get());
writes = series;
reads = series.reads;
}
else
{
writes = reads = new SeriesGenerator(seq[0], seq[1], settings.generate.wrap);
}
}
else
{
writes = reads = new RandomGenerator(settings.generate.distribution.get());
}
this.visits = settings.insert.visits.get();
this.writes = writes;
this.reads = reads;
Distribution sample = settings.insert.revisit.get();
this.sampleOffset = Math.min(sample.minValue(), sample.maxValue());
long sampleSize = 1 + Math.max(sample.minValue(), sample.maxValue()) - sampleOffset;
if (sampleOffset < 0 || sampleSize > Integer.MAX_VALUE)
throw new IllegalArgumentException("sample range is invalid");
this.sampleFrom = new DynamicList<>((int) sampleSize);
this.sample = DistributionInverted.invert(sample);
this.sampleSize = (int) sampleSize;
this.updateSampleImmediately = visits.average() > 1;
}
示例2: save
import org.apache.cassandra.stress.util.DynamicList; //导入依赖的package包/类
public boolean save(DynamicList<Seed> sampleFrom, int maxSize)
{
DynamicList.Node poolNode = sampleFrom.append(this, maxSize);
if (poolNode == null)
return false;
this.poolNode = poolNode;
return true;
}
示例3: SeedManager
import org.apache.cassandra.stress.util.DynamicList; //导入依赖的package包/类
public SeedManager(StressSettings settings)
{
Generator writes, reads;
if (settings.generate.sequence != null)
{
long[] seq = settings.generate.sequence;
if (settings.generate.readlookback != null)
{
LookbackableWriteGenerator series = new LookbackableWriteGenerator(seq[0], seq[1], settings.generate.wrap, settings.generate.readlookback.get());
writes = series;
reads = series.reads;
}
else
{
writes = reads = new SeriesGenerator(seq[0], seq[1], settings.generate.wrap);
}
}
else
{
writes = reads = new RandomGenerator(settings.generate.distribution.get());
}
this.visits = settings.insert.visits.get();
this.writes = writes;
this.reads = reads;
this.sample = DistributionInverted.invert(settings.insert.revisit.get());
if (sample.maxValue() > Integer.MAX_VALUE || sample.minValue() < 0)
throw new IllegalArgumentException();
this.sampleFrom = new DynamicList<>((int) sample.maxValue());
}
示例4: remove
import org.apache.cassandra.stress.util.DynamicList; //导入依赖的package包/类
public void remove(DynamicList<Seed> sampleFrom)
{
sampleFrom.remove(poolNode);
}