本文整理汇总了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;
}
示例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);
}
示例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));
}
示例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;
}
示例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()));
}
示例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)));
}
示例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);
}
示例8: SSTableIntervalTree
import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
SSTableIntervalTree(Collection<Interval<PartitionPosition, SSTableReader>> intervals)
{
super(intervals);
}
示例9: SSTableIntervalTree
import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
private SSTableIntervalTree(Collection<Interval<RowPosition, SSTableReader>> intervals)
{
super(intervals, null);
}
示例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));
}
示例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;
}
示例12: addIndex
import org.apache.cassandra.utils.Interval; //导入依赖的package包/类
@Override
public void addIndex(SSTableIndex index)
{
intervals.add(Interval.create(index.minTerm(), index.maxTerm(), index));
}
示例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));
}