本文整理汇总了Java中org.apache.accumulo.core.data.Range.isInfiniteStopKey方法的典型用法代码示例。如果您正苦于以下问题:Java Range.isInfiniteStopKey方法的具体用法?Java Range.isInfiniteStopKey怎么用?Java Range.isInfiniteStopKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.accumulo.core.data.Range
的用法示例。
在下文中一共展示了Range.isInfiniteStopKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: appendServerSideRanges
import org.apache.accumulo.core.data.Range; //导入方法依赖的package包/类
/**
* @param serverSideRanges
* List of server side filters.
* @param originalRange
* Range to convert.
* @param startKeys
* Set of start key filters.
* @param endKeys
* Set of end key filters.
* @param prefix
* What portion of the key are we filtering?
*/
private void appendServerSideRanges(Collection<Range> serverSideRanges, Range originalRange, List<MutableEntry> startKeys, List<MutableEntry> endKeys,
PartialKey prefix) {
if (prefix == null) {
serverSideRanges.add(new Range());
return;
}
if (originalRange.isInfiniteStartKey()) {
for (MutableEntry endKey : endKeys) {
serverSideRanges.add(new Range(null, true, endKey.toKey().followingKey(prefix), false));
}
} else if (originalRange.isInfiniteStopKey()) {
for (MutableEntry startKey : startKeys) {
serverSideRanges.add(new Range(startKey.toKey(), true, null, true));
}
} else {
Iterator<MutableEntry> startKeyIterator = startKeys.iterator();
Iterator<MutableEntry> endKeyIterator = endKeys.iterator();
while (startKeyIterator.hasNext()) {
serverSideRanges.add(new Range(startKeyIterator.next().toKey(), true, endKeyIterator.next().toKey().followingKey(prefix), false));
}
}
}
示例2: rangeContainsRange
import org.apache.accumulo.core.data.Range; //导入方法依赖的package包/类
private static boolean rangeContainsRange(final Range r1, final Range r2) {
// 1. If r1.start is infinite, r1 contains r2.start
if (!r1.isInfiniteStartKey()) {
// 2. Otherwise, if r2.start is infinite, r1 can't contain r2
if (r2.isInfiniteStartKey()) {
return false;
}
final Key start2 = r2.getStartKey();
// 3. If r2 is inclusive, r1 needs to contain r2's start key.
if (r2.isStartKeyInclusive()) {
if (!r1.contains(start2)) {
return false;
}
}
// 4. Otherwise, the only failure is if r2's start key comes first (they can be equal)
else if (start2.compareTo(r1.getStartKey()) < 0) {
return false;
}
}
// Similar logic for end points
if (!r1.isInfiniteStopKey()) {
if (r2.isInfiniteStopKey()) {
return false;
}
final Key end2 = r2.getEndKey();
if (r2.isEndKeyInclusive()) {
if (!r1.contains(end2)) {
return false;
}
}
else if (end2.compareTo(r1.getEndKey()) > 0) {
return false;
}
}
return true;
}