本文整理汇总了Java中org.apache.cassandra.utils.IntervalTree类的典型用法代码示例。如果您正苦于以下问题:Java IntervalTree类的具体用法?Java IntervalTree怎么用?Java IntervalTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IntervalTree类属于org.apache.cassandra.utils包,在下文中一共展示了IntervalTree类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: PrefixTermTree
import org.apache.cassandra.utils.IntervalTree; //导入依赖的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
示例2: View
import org.apache.cassandra.utils.IntervalTree; //导入依赖的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
示例3: build
import org.apache.cassandra.utils.IntervalTree; //导入依赖的package包/类
@Override
public TermTree build()
{
return new PrefixTermTree(min, max, trie, IntervalTree.build(intervals, comparator), mode);
}
开发者ID:xedin,项目名称:sasi,代码行数:6,代码来源:PrefixTermTree.java
示例4: RangeTermTree
import org.apache.cassandra.utils.IntervalTree; //导入依赖的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
示例5: build
import org.apache.cassandra.utils.IntervalTree; //导入依赖的package包/类
@Override
public TermTree build()
{
return new RangeTermTree(min, max, IntervalTree.build(intervals, comparator));
}
开发者ID:xedin,项目名称:sasi,代码行数:6,代码来源:RangeTermTree.java
注:本文中的org.apache.cassandra.utils.IntervalTree类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论