Class RangeIterator<K extends java.lang.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>
,java.io.Closeable
,java.lang.AutoCloseable
,java.util.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 java.lang.Comparable<K>,T extends CombinedValue<K>> extends AbstractGuavaIterator<T> implements java.io.Closeable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RangeIterator.Builder<K extends java.lang.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
Constructors Modifier Constructor Description RangeIterator(K min, K max, long count)
protected
RangeIterator(RangeIterator.Builder.Statistics<K,T> statistics)
RangeIterator(RangeIterator<K,T> range)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description long
getCount()
K
getCurrent()
K
getMaximum()
K
getMinimum()
protected static <K extends java.lang.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 java.lang.Comparable<K>,D extends CombinedValue<K>>
booleanisOverlapping(RangeIterator<K,D> a, RangeIterator<K,D> b)
protected abstract void
performSkipTo(K nextToken)
protected T
recomputeNext()
T
skipTo(K nextToken)
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 iteratorprotected boolean
tryToComputeNext()
-
Methods inherited from class org.apache.cassandra.utils.AbstractGuavaIterator
computeNext, endOfData, hasNext, next, peek, remove
-
-
-
-
Constructor Detail
-
RangeIterator
protected RangeIterator(RangeIterator.Builder.Statistics<K,T> statistics)
-
RangeIterator
public RangeIterator(RangeIterator<K,T> range)
-
-
Method Detail
-
getMinimum
public final K getMinimum()
-
getCurrent
public final K getCurrent()
-
getMaximum
public final K getMaximum()
-
getCount
public final long getCount()
-
skipTo
public final T skipTo(K nextToken)
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
protected abstract void performSkipTo(K nextToken)
-
recomputeNext
protected T recomputeNext()
-
tryToComputeNext
protected boolean tryToComputeNext()
- Overrides:
tryToComputeNext
in classAbstractGuavaIterator<T extends CombinedValue<K>>
-
isOverlapping
protected static <K extends java.lang.Comparable<K>,D extends CombinedValue<K>> boolean isOverlapping(RangeIterator<K,D> a, RangeIterator<K,D> b)
-
isOverlapping
protected static <K extends java.lang.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.
-
-