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
Modifier and TypeFieldDescriptionprivate boolean
private boolean
private boolean
private List<? extends MultiRowRangeFilter.BasicRowRange>
private boolean
private final List<MultiRowRangeFilter.RowRange>
-
Constructor Summary
-
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.int
getNextRangeIndex
(byte[] rowKey) Calculates the position where the given rowkey fits in the ranges list.boolean
Returns true if the first matching row range was found.(package private) void
initialize
(boolean reversed) boolean
Returns true if the current range's key is exclusiveboolean
Returns true if this class has been initialized by callinginitialize(boolean)
.boolean
isIterationComplete
(int index) Returns true if we exhausted searching all row ranges.void
Resets the exclusive flag.void
SetsfoundFirstRange
totrue
, 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
SetsfoundFirstRange
totrue
, 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.
-