Class RangeIterator<K extends Comparable<K>,T extends CombinedValue<K>>
java.lang.Object
org.apache.cassandra.utils.AbstractGuavaIterator<T>
org.apache.cassandra.index.sasi.utils.RangeIterator<K,T>
- All Implemented Interfaces:
com.google.common.collect.PeekingIterator<T>,Closeable,AutoCloseable,Iterator<T>
- Direct Known Subclasses:
KeyRangeIterator,OnDiskIndexIterator,Operation,RangeIntersectionIterator.BounceIntersectionIterator,RangeIntersectionIterator.LookupIntersectionIterator,RangeIterator.Builder.EmptyRangeIterator,RangeUnionIterator,TermIterator,TokenTree.TokenTreeIterator
public abstract class RangeIterator<K extends Comparable<K>,T extends CombinedValue<K>>
extends AbstractGuavaIterator<T>
implements Closeable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRangeIterator.Builder<K extends Comparable<K>,D extends CombinedValue<K>> Nested classes/interfaces inherited from class org.apache.cassandra.utils.AbstractGuavaIterator
AbstractGuavaIterator.State -
Field Summary
Fields inherited from class org.apache.cassandra.utils.AbstractGuavaIterator
next, state -
Constructor Summary
ConstructorsModifierConstructorDescriptionRangeIterator(K min, K max, long count) protectedRangeIterator(RangeIterator.Builder.Statistics<K, T> statistics) RangeIterator(RangeIterator<K, T> range) -
Method Summary
Modifier and TypeMethodDescriptionfinal longgetCount()final Kfinal Kfinal Kprotected static <K extends Comparable<K>,D extends CombinedValue<K>>
booleanisOverlapping(K min, K max, RangeIterator<K, D> b) Ranges are overlapping the following cases: * When they have a common subrange: min b.current max b.max +---------|--------------+------------| b.current min max b.max |--------------+---------+------------| min b.current b.max max +----------|-------------|------------+ If either range is empty, they're disjoint.protected static <K extends Comparable<K>,D extends CombinedValue<K>>
booleanisOverlapping(RangeIterator<K, D> a, RangeIterator<K, D> b) protected abstract voidperformSkipTo(K nextToken) protected Tfinal TWhen called, this iterators current position should be skipped forwards until finding either: 1) an element equal to or bigger than next 2) the end of the iteratorprotected booleanMethods inherited from class org.apache.cassandra.utils.AbstractGuavaIterator
computeNext, endOfData, hasNext, next, peek, removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
RangeIterator
-
RangeIterator
-
RangeIterator
-
-
Method Details
-
getMinimum
-
getCurrent
-
getMaximum
-
getCount
public final long getCount() -
skipTo
When called, this iterators current position should be skipped forwards until finding either: 1) an element equal to or bigger than next 2) the end of the iterator- Parameters:
nextToken- value to skip the iterator forward until matching- Returns:
- The next current token after the skip was performed
-
performSkipTo
-
recomputeNext
-
tryToComputeNext
protected boolean tryToComputeNext()- Overrides:
tryToComputeNextin classAbstractGuavaIterator<T extends CombinedValue<K>>
-
isOverlapping
protected static <K extends Comparable<K>,D extends CombinedValue<K>> boolean isOverlapping(RangeIterator<K, D> a, RangeIterator<K, D> b) -
isOverlapping
protected static <K extends Comparable<K>,D extends CombinedValue<K>> boolean isOverlapping(K min, K max, RangeIterator<K, D> b) Ranges are overlapping the following cases: * When they have a common subrange: min b.current max b.max +---------|--------------+------------| b.current min max b.max |--------------+---------+------------| min b.current b.max max +----------|-------------|------------+ If either range is empty, they're disjoint.
-