Package org.apache.hadoop.hbase.filter
Class MultiRowRangeFilter.RangeIteration
java.lang.Object
org.apache.hadoop.hbase.filter.MultiRowRangeFilter.RangeIteration
- Enclosing class:
- MultiRowRangeFilter
Abstraction over the ranges of rows to return from this filter, regardless of forward or
reverse scans being used. This Filter can use this class, agnostic of iteration direction, as
the same algorithm can be applied in both cases.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate booleanprivate List<? extends MultiRowRangeFilter.BasicRowRange>private booleanprivate final List<MultiRowRangeFilter.RowRange> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static List<MultiRowRangeFilter.ReversedRowRange>Rebuilds the sorted ranges (by startKey) into an equivalent sorted list of ranges, only by stopKey instead.<T extends MultiRowRangeFilter.BasicRowRange>
Tget(int i) Gets the RowRange at the given offset.intgetNextRangeIndex(byte[] rowKey) Calculates the position where the given rowkey fits in the ranges list.booleanReturns true if the first matching row range was found.(package private) voidinitialize(boolean reversed) booleanReturns true if the current range's key is exclusivebooleanReturns true if this class has been initialized by callinginitialize(boolean).booleanisIterationComplete(int index) Returns true if we exhausted searching all row ranges.voidResets the exclusive flag.voidSetsfoundFirstRangetotrue, indicating that we found a matching row range.
-
Field Details
-
exclusive
-
initialized
-
foundFirstRange
-
reversed
-
sortedAndMergedRanges
-
ranges
-
-
Constructor Details
-
RangeIteration
-
-
Method Details
-
initialize
-
flipAndReverseRanges
static List<MultiRowRangeFilter.ReversedRowRange> flipAndReverseRanges(List<MultiRowRangeFilter.RowRange> ranges) Rebuilds the sorted ranges (by startKey) into an equivalent sorted list of ranges, only by stopKey instead. Descending order and the ReversedRowRange compareTo implementation make sure that we can use Collections.binarySearch(). -
getNextRangeIndex
Calculates the position where the given rowkey fits in the ranges list.- Parameters:
rowKey- the row key to calculate- Returns:
- index the position of the row key
-
setFoundFirstRange
SetsfoundFirstRangetotrue, indicating that we found a matching row range. -
get
Gets the RowRange at the given offset. -
hasFoundFirstRange
Returns true if the first matching row range was found. -
isExclusive
Returns true if the current range's key is exclusive -
resetExclusive
Resets the exclusive flag. -
isInitialized
Returns true if this class has been initialized by callinginitialize(boolean). -
isIterationComplete
Returns true if we exhausted searching all row ranges.
-