@InterfaceAudience.Public public class MultiRowRangeFilter extends FilterBase
Modifier and Type | Class and Description |
---|---|
private static class |
MultiRowRangeFilter.BasicRowRange |
private static class |
MultiRowRangeFilter.RangeIteration
Abstraction over the ranges of rows to return from this filter, regardless of forward or
reverse scans being used.
|
private static class |
MultiRowRangeFilter.ReversedRowRange
Internal RowRange that reverses the sort-order to handle reverse scans.
|
static class |
MultiRowRangeFilter.RowRange |
Filter.ReturnCode
Modifier and Type | Field and Description |
---|---|
private Filter.ReturnCode |
currentReturnCode |
private boolean |
done |
private int |
index |
private MultiRowRangeFilter.BasicRowRange |
range |
private List<MultiRowRangeFilter.RowRange> |
rangeList |
private MultiRowRangeFilter.RangeIteration |
ranges |
private static int |
ROW_BEFORE_FIRST_RANGE |
Constructor and Description |
---|
MultiRowRangeFilter(byte[][] rowKeyPrefixes)
Constructor for creating a
MultiRowRangeFilter from multiple rowkey prefixes. |
MultiRowRangeFilter(List<MultiRowRangeFilter.RowRange> list) |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
areSerializedFieldsEqual(Filter o)
Default implementation so that writers of custom filters aren't forced to implement.
|
private static List<MultiRowRangeFilter.RowRange> |
createRangeListFromRowKeyPrefixes(byte[][] rowKeyPrefixes) |
boolean |
equals(Object obj) |
boolean |
filterAllRemaining()
Filters that never filter all remaining can inherit this implementation that
never stops the filter early.
|
Filter.ReturnCode |
filterCell(Cell ignored)
A way to filter based on the column family, column qualifier and/or the column value.
|
Filter.ReturnCode |
filterKeyValue(Cell ignored)
Deprecated.
|
boolean |
filterRowKey(Cell firstRowCell)
Filters a row based on the row key.
|
Cell |
getNextCellHint(Cell currentKV)
Filters that are not sure which key must be next seeked to, can inherit
this implementation that, by default, returns a null Cell.
|
List<MultiRowRangeFilter.RowRange> |
getRowRanges() |
int |
hashCode() |
static MultiRowRangeFilter |
parseFrom(byte[] pbBytes) |
static List<MultiRowRangeFilter.RowRange> |
sortAndMerge(List<MultiRowRangeFilter.RowRange> ranges)
sort the ranges and if the ranges with overlap, then merge them.
|
private static void |
throwExceptionForInvalidRanges(List<MultiRowRangeFilter.RowRange> invalidRanges,
boolean details) |
byte[] |
toByteArray()
Return length 0 byte array for Filters that don't require special serialization
|
createFilterFromArguments, filterRow, filterRowCells, filterRowKey, hasFilterRow, isFamilyEssential, reset, toString, transformCell
isReversed, setReversed
private static final int ROW_BEFORE_FIRST_RANGE
private final List<MultiRowRangeFilter.RowRange> rangeList
private final MultiRowRangeFilter.RangeIteration ranges
private boolean done
private int index
private MultiRowRangeFilter.BasicRowRange range
private Filter.ReturnCode currentReturnCode
public MultiRowRangeFilter(List<MultiRowRangeFilter.RowRange> list)
list
- A list of RowRange
public MultiRowRangeFilter(byte[][] rowKeyPrefixes)
MultiRowRangeFilter
from multiple rowkey prefixes.
As MultiRowRangeFilter
javadoc says (See the solution 1 of the first statement),
if you try to create a filter list that scans row keys corresponding to given prefixes (e.g.,
FilterList
composed of multiple PrefixFilter
s), this constructor
provides a way to avoid creating an inefficient one.rowKeyPrefixes
- the array of byte arrayprivate static List<MultiRowRangeFilter.RowRange> createRangeListFromRowKeyPrefixes(byte[][] rowKeyPrefixes)
public List<MultiRowRangeFilter.RowRange> getRowRanges()
public boolean filterAllRemaining()
FilterBase
IOException
.filterAllRemaining
in class FilterBase
public boolean filterRowKey(Cell firstRowCell)
Filter
Filter.filterCell(Cell)
below.
If Filter.filterAllRemaining()
returns true, then Filter.filterRowKey(Cell)
should
also return true.
Concrete implementers can signal a failure condition in their code by throwing an
IOException
.filterRowKey
in class FilterBase
firstRowCell
- The first cell coming in the new row@Deprecated public Filter.ReturnCode filterKeyValue(Cell ignored)
Filter
ReturnCode.NEXT_ROW
, it should return
ReturnCode.NEXT_ROW
until Filter.reset()
is called just in case the caller calls
for the next row.
Concrete implementers can signal a failure condition in their code by throwing an
IOException
.filterKeyValue
in class Filter
ignored
- the Cell in questionFilter.ReturnCode
public Filter.ReturnCode filterCell(Cell ignored)
Filter
ReturnCode.NEXT_ROW
, it should return
ReturnCode.NEXT_ROW
until Filter.reset()
is called just in case the caller calls
for the next row.
Concrete implementers can signal a failure condition in their code by throwing an
IOException
.filterCell
in class Filter
ignored
- the Cell in questionFilter.ReturnCode
public Cell getNextCellHint(Cell currentKV)
FilterBase
IOException
.getNextCellHint
in class FilterBase
public byte[] toByteArray()
FilterBase
toByteArray
in class FilterBase
public static MultiRowRangeFilter parseFrom(byte[] pbBytes) throws DeserializationException
pbBytes
- A pb serialized instanceDeserializationException
boolean areSerializedFieldsEqual(Filter o)
FilterBase
areSerializedFieldsEqual
in class FilterBase
o
- the filter to comparepublic static List<MultiRowRangeFilter.RowRange> sortAndMerge(List<MultiRowRangeFilter.RowRange> ranges)
ranges
- the list of ranges to sort and merge.private static void throwExceptionForInvalidRanges(List<MultiRowRangeFilter.RowRange> invalidRanges, boolean details)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.