当前位置: 首页>>代码示例>>Java>>正文


Java DynamicList类代码示例

本文整理汇总了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;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:35,代码来源:SeedManager.java

示例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;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:9,代码来源:Seed.java

示例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());
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:30,代码来源:SeedManager.java

示例4: remove

import org.apache.cassandra.stress.util.DynamicList; //导入依赖的package包/类
public void remove(DynamicList<Seed> sampleFrom)
{
    sampleFrom.remove(poolNode);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:Seed.java


注:本文中的org.apache.cassandra.stress.util.DynamicList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。