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


Java Interval类代码示例

本文整理汇总了Java中org.apache.cassandra.utils.Interval的典型用法代码示例。如果您正苦于以下问题:Java Interval类的具体用法?Java Interval怎么用?Java Interval使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Interval类属于org.apache.cassandra.utils包,在下文中一共展示了Interval类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildIntervals

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
public static List<Interval<PartitionPosition, SSTableReader>> buildIntervals(Iterable<SSTableReader> sstables)
{
    List<Interval<PartitionPosition, SSTableReader>> intervals = new ArrayList<>(Iterables.size(sstables));
    for (SSTableReader sstable : sstables)
        intervals.add(Interval.<PartitionPosition, SSTableReader>create(sstable.first, sstable.last, sstable));
    return intervals;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:8,代码来源:SSTableIntervalTree.java

示例2: buildIntervalTree

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
public static SSTableIntervalTree buildIntervalTree(Iterable<SSTableReader> sstables)
{
    List<Interval<RowPosition, SSTableReader>> intervals = new ArrayList<>(Iterables.size(sstables));
    for (SSTableReader sstable : sstables)
        intervals.add(Interval.<RowPosition, SSTableReader>create(sstable.first, sstable.last, sstable));
    return new SSTableIntervalTree(intervals);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:DataTracker.java

示例3: sstablesInBounds

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
public List<SSTableReader> sstablesInBounds(AbstractBounds<RowPosition> rowBounds)
{
    if (intervalTree.isEmpty())
        return Collections.emptyList();
    RowPosition stopInTree = rowBounds.right.isMinimum(liveMemtables.get(0).cfs.partitioner) ? intervalTree.max() : rowBounds.right;
    return intervalTree.search(Interval.<RowPosition, SSTableReader>create(rowBounds.left, stopInTree));
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:DataTracker.java

示例4: PrefixTermTree

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
public PrefixTermTree(ByteBuffer min, ByteBuffer max,
                      Trie<ByteBuffer, Set<SSTableIndex>> trie,
                      IntervalTree<ByteBuffer, SSTableIndex, Interval<ByteBuffer, SSTableIndex>> ranges,
                      OnDiskIndexBuilder.Mode mode)
{
    super(min, max, ranges);

    this.mode = mode;
    this.trie = trie;
}
 
开发者ID:xedin,项目名称:sasi,代码行数:11,代码来源:PrefixTermTree.java

示例5: View

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
public View(ColumnIndex index, AbstractType<?> keyValidator,
            Collection<SSTableIndex> currentView,
            Collection<SSTableReader> oldSSTables,
            Set<SSTableIndex> newIndexes)
{
    Map<Descriptor, SSTableIndex> newView = new HashMap<>();

    AbstractType<?> validator = index.getValidator();
    TermTree.Builder termTreeBuilder = (validator instanceof AsciiType || validator instanceof UTF8Type)
                                        ? new PrefixTermTree.Builder(index.getMode().mode, validator)
                                        : new RangeTermTree.Builder(index.getMode().mode, validator);

    List<Interval<ByteBuffer, SSTableIndex>> keyIntervals = new ArrayList<>();
    for (SSTableIndex sstableIndex : Iterables.concat(currentView, newIndexes))
    {
        SSTableReader sstable = sstableIndex.getSSTable();
        if (oldSSTables.contains(sstable) || sstable.isMarkedCompacted() || newView.containsKey(sstable.descriptor))
        {
            sstableIndex.release();
            continue;
        }

        newView.put(sstable.descriptor, sstableIndex);

        termTreeBuilder.add(sstableIndex);
        keyIntervals.add(Interval.create(sstableIndex.minKey(), sstableIndex.maxKey(), sstableIndex));
    }

    this.view = newView;
    this.termTree = termTreeBuilder.build();
    this.keyIntervalTree = IntervalTree.build(keyIntervals, keyValidator);

    if (keyIntervalTree.intervalCount() != termTree.intervalCount())
        throw new IllegalStateException(String.format("mismatched sizes for intervals tree for keys vs terms: %d != %d", keyIntervalTree.intervalCount(), termTree.intervalCount()));
}
 
开发者ID:xedin,项目名称:sasi,代码行数:36,代码来源:View.java

示例6: search

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
@Override
public Set<SSTableIndex> search(Expression e)
{
    ByteBuffer minTerm = e.lower == null ? min : e.lower.value;
    ByteBuffer maxTerm = e.upper == null ? max : e.upper.value;

    return new HashSet<>(rangeTree.search(Interval.create(minTerm, maxTerm, (SSTableIndex) null)));
}
 
开发者ID:xedin,项目名称:sasi,代码行数:9,代码来源:RangeTermTree.java

示例7: buildIntervalTree

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
public static SSTableIntervalTree buildIntervalTree(Iterable<SSTableReader> sstables)
{
    List<Interval<RowPosition, SSTableReader>> intervals = new ArrayList<Interval<RowPosition, SSTableReader>>(Iterables.size(sstables));
    for (SSTableReader sstable : sstables)
        intervals.add(Interval.<RowPosition, SSTableReader>create(sstable.first, sstable.last, sstable));
    return new SSTableIntervalTree(intervals);
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:8,代码来源:DataTracker.java

示例8: SSTableIntervalTree

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
SSTableIntervalTree(Collection<Interval<PartitionPosition, SSTableReader>> intervals)
{
    super(intervals);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:5,代码来源:SSTableIntervalTree.java

示例9: SSTableIntervalTree

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
private SSTableIntervalTree(Collection<Interval<RowPosition, SSTableReader>> intervals)
{
    super(intervals, null);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:DataTracker.java

示例10: match

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
public List<SSTableIndex> match(ByteBuffer minKey, ByteBuffer maxKey)
{
    return keyIntervalTree.search(Interval.create(minKey, maxKey, (SSTableIndex) null));
}
 
开发者ID:xedin,项目名称:sasi,代码行数:5,代码来源:View.java

示例11: RangeTermTree

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
public RangeTermTree(ByteBuffer min, ByteBuffer max, IntervalTree<ByteBuffer, SSTableIndex, Interval<ByteBuffer, SSTableIndex>> rangeTree)
{
    this.min = min;
    this.max = max;
    this.rangeTree = rangeTree;
}
 
开发者ID:xedin,项目名称:sasi,代码行数:7,代码来源:RangeTermTree.java

示例12: addIndex

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
@Override
public void addIndex(SSTableIndex index)
{
    intervals.add(Interval.create(index.minTerm(), index.maxTerm(), index));
}
 
开发者ID:xedin,项目名称:sasi,代码行数:6,代码来源:RangeTermTree.java

示例13: sstablesInBounds

import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
public List<SSTableReader> sstablesInBounds(AbstractBounds<RowPosition> rowBounds)
{
    RowPosition stopInTree = rowBounds.right.isMinimum(liveMemtables.get(0).cfs.partitioner) ? intervalTree.max() : rowBounds.right;
    return intervalTree.search(Interval.<RowPosition, SSTableReader>create(rowBounds.left, stopInTree));
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:6,代码来源:DataTracker.java


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