@InterfaceAudience.Public @InterfaceStability.Evolving public class MultiRowRangeFilter extends FilterBase
Modifier and Type | Class and Description |
---|---|
static class |
MultiRowRangeFilter.RowRange |
Filter.ReturnCode
Modifier and Type | Field and Description |
---|---|
private Filter.ReturnCode |
currentReturnCode |
private boolean |
done |
private boolean |
EXCLUSIVE |
private int |
index |
private boolean |
initialized |
private MultiRowRangeFilter.RowRange |
range |
private List<MultiRowRangeFilter.RowRange> |
rangeList |
private static int |
ROW_BEFORE_FIRST_RANGE |
Constructor and Description |
---|
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.
|
boolean |
filterAllRemaining()
Filters that never filter all remaining can inherit this implementation that
never stops the filter early.
|
Filter.ReturnCode |
filterKeyValue(Cell ignored)
A way to filter based on the column family, column qualifier and/or the column value.
|
boolean |
filterRowKey(byte[] buffer,
int offset,
int length)
Filters that do not filter by row key can inherit this implementation that
never filters anything.
|
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.
|
private int |
getNextRangeIndex(byte[] rowKey)
calculate the position where the row key in the ranges list.
|
List<MultiRowRangeFilter.RowRange> |
getRowRanges() |
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, getNextKeyHint, hasFilterRow, isFamilyEssential, reset, toString, transform, transformCell
isReversed, setReversed
private List<MultiRowRangeFilter.RowRange> rangeList
private static final int ROW_BEFORE_FIRST_RANGE
private boolean EXCLUSIVE
private boolean done
private boolean initialized
private int index
private MultiRowRangeFilter.RowRange range
private Filter.ReturnCode currentReturnCode
public MultiRowRangeFilter(List<MultiRowRangeFilter.RowRange> list) throws IOException
list
- A list of RowRange
IOException
- throw an exception if the range list is not in an natural order or any
RowRange
is invalidpublic boolean filterAllRemaining()
FilterBase
IOException
.filterAllRemaining
in class FilterBase
public List<MultiRowRangeFilter.RowRange> getRowRanges()
public boolean filterRowKey(byte[] buffer, int offset, int length)
FilterBase
Filter.filterKeyValue(Cell)
below.
Concrete implementers can signal a failure condition in their code by throwing an
IOException
.filterRowKey
in class FilterBase
buffer
- buffer containing row keyoffset
- offset into buffer where row key startslength
- length of the row keypublic 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 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 compareprivate int getNextRangeIndex(byte[] rowKey)
rowKey
- the row key to calculatepublic 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–2019 The Apache Software Foundation. All rights reserved.