@InterfaceAudience.Public public class MultiRowRangeFilter extends org.apache.hadoop.hbase.filter.FilterBase
Modifier and Type | Class and Description |
---|---|
static class |
MultiRowRangeFilter.RowRange |
Filter.ReturnCode
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 |
---|---|
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.
|
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)
Parse a serialized representation of
MultiRowRangeFilter |
static List<MultiRowRangeFilter.RowRange> |
sortAndMerge(List<MultiRowRangeFilter.RowRange> ranges)
sort the ranges and if the ranges with overlap, then merge them.
|
byte[] |
toByteArray()
Returns The filter serialized using pb
|
createFilterFromArguments, filterRow, filterRowCells, hasFilterRow, isFamilyEssential, reset, toString, transformCell
isReversed, setReversed
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 arraypublic List<MultiRowRangeFilter.RowRange> getRowRanges()
public boolean filterAllRemaining()
org.apache.hadoop.hbase.filter.FilterBase
IOException
.filterAllRemaining
in class org.apache.hadoop.hbase.filter.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 org.apache.hadoop.hbase.filter.FilterBase
firstRowCell
- The first cell coming in the new rowpublic 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)
org.apache.hadoop.hbase.filter.FilterBase
IOException
.getNextCellHint
in class org.apache.hadoop.hbase.filter.FilterBase
public byte[] toByteArray()
toByteArray
in class org.apache.hadoop.hbase.filter.FilterBase
public static MultiRowRangeFilter parseFrom(byte[] pbBytes) throws org.apache.hadoop.hbase.exceptions.DeserializationException
MultiRowRangeFilter
pbBytes
- A pb serialized instanceMultiRowRangeFilter
org.apache.hadoop.hbase.exceptions.DeserializationException
- if an error occurredtoByteArray()
public static List<MultiRowRangeFilter.RowRange> sortAndMerge(List<MultiRowRangeFilter.RowRange> ranges)
ranges
- the list of ranges to sort and merge.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.