@InterfaceAudience.Private public abstract class FilterListBase extends FilterBase
FilterListWithOR
, FilterListWithAND
.Filter.ReturnCode
Modifier and Type | Field and Description |
---|---|
protected ArrayList<Filter> |
filters |
private static int |
MAX_LOG_FILTERS |
protected ArrayList<Boolean> |
subFiltersIncludedCell
For each sub-filter in filter list, we save a boolean flag to indicate that whether the return
code of filterCell(c) for sub-filter is INCLUDE* (INCLUDE, INCLUDE_AND_NEXT_COL,
INCLUDE_AND_SEEK_NEXT_ROW) case.
|
Constructor and Description |
---|
FilterListBase(List<Filter> filters) |
Modifier and Type | Method and Description |
---|---|
abstract void |
addFilterLists(List<Filter> filters) |
protected static boolean |
checkAndGetReversed(List<Filter> rowFilters,
boolean defaultValue) |
protected int |
compareCell(Cell a,
Cell b) |
Filter.ReturnCode |
filterKeyValue(Cell c)
A way to filter based on the column family, column qualifier and/or the column value.
|
void |
filterRowCells(List<Cell> cells)
Filters that never filter by modifying the returned List of Cells can inherit this
implementation that does nothing.
|
protected abstract String |
formatLogFilters(List<Filter> logFilters) |
ArrayList<Filter> |
getFilters() |
boolean |
hasFilterRow()
Fitlers that never filter by modifying the returned List of Cells can
inherit this implementation that does nothing.
|
boolean |
isEmpty() |
boolean |
isFamilyEssential(byte[] name)
By default, we require all scan's column families to be present.
|
protected static boolean |
isInReturnCodes(Filter.ReturnCode testRC,
Filter.ReturnCode... returnCodes) |
void |
setReversed(boolean reversed)
alter the reversed scan flag
|
int |
size() |
String |
toString()
Return filter's info for debugging and logging purpose.
|
Cell |
transformCell(Cell c)
For FilterList, we can consider a filter list as a node in a tree.
|
areSerializedFieldsEqual, createFilterFromArguments, filterAllRemaining, filterRow, filterRowKey, filterRowKey, getNextCellHint, reset, toByteArray
filterCell, isReversed, parseFrom
private static final int MAX_LOG_FILTERS
protected ArrayList<Boolean> subFiltersIncludedCell
public FilterListBase(List<Filter> filters)
protected static boolean isInReturnCodes(Filter.ReturnCode testRC, Filter.ReturnCode... returnCodes)
protected static boolean checkAndGetReversed(List<Filter> rowFilters, boolean defaultValue)
public abstract void addFilterLists(List<Filter> filters)
public int size()
public boolean isEmpty()
public ArrayList<Filter> getFilters()
protected int compareCell(Cell a, Cell b)
public Cell transformCell(Cell c) throws IOException
transformCell
in class FilterBase
c
- The cell in question.IOException
The transformed KeyValue is what is eventually returned to the client. Most filters will
return the passed KeyValue unchanged.
,
for an example of a
transformation.
Concrete implementers can signal a failure condition in their code by throwing an
{@link IOException}.
public Filter.ReturnCode filterKeyValue(Cell c) throws IOException
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
c
- the Cell in questionIOException
- in case an I/O or an filter specific failure needs to be signaled.Filter.ReturnCode
public void filterRowCells(List<Cell> cells) throws IOException
IOException
.filterRowCells
in class FilterBase
cells
- the list of Cells to be filteredIOException
- in case an I/O or an filter specific failure needs to be signaled.public boolean hasFilterRow()
FilterBase
hasFilterRow
in class FilterBase
public boolean isFamilyEssential(byte[] name) throws IOException
FilterBase
IOException
.isFamilyEssential
in class FilterBase
IOException
- in case an I/O or an filter specific failure needs to be signaled.public void setReversed(boolean reversed)
Filter
setReversed
in class Filter
reversed
- flagpublic String toString()
FilterBase
toString
in class FilterBase
protected abstract String formatLogFilters(List<Filter> logFilters)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.