Package org.apache.hadoop.hbase.filter
Class FilterListBase
java.lang.Object
org.apache.hadoop.hbase.filter.Filter
org.apache.hadoop.hbase.filter.FilterBase
org.apache.hadoop.hbase.filter.FilterListBase
- Direct Known Subclasses:
FilterListWithAND
,FilterListWithOR
Base class for FilterList. Currently, we have two sub-classes to extend this class:
FilterListWithOR
, FilterListWithAND
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
addFilterLists
(List<Filter> filters) protected static boolean
checkAndGetReversed
(List<Filter> rowFilters, boolean defaultValue) protected int
compareCell
(Cell a, Cell b) 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) boolean
Filters 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 flagint
size()
toString()
Return filter's info for debugging and logging purpose.For FilterList, we can consider a filter list as a node in a tree.Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
areSerializedFieldsEqual, createFilterFromArguments, filterAllRemaining, filterRow, filterRowKey, getNextCellHint, reset, toByteArray
Methods inherited from class org.apache.hadoop.hbase.filter.Filter
filterCell, isReversed, parseFrom
-
Field Details
-
MAX_LOG_FILTERS
- See Also:
-
filters
-
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. if true, we need to transform cell for the sub-filter.
-
-
Constructor Details
-
FilterListBase
-
-
Method Details
-
isInReturnCodes
protected static boolean isInReturnCodes(Filter.ReturnCode testRC, Filter.ReturnCode... returnCodes) -
checkAndGetReversed
-
addFilterLists
-
size
-
isEmpty
-
getFilters
-
compareCell
-
transformCell
For FilterList, we can consider a filter list as a node in a tree. sub-filters of the filter list are children of the relative node. The logic of transforming cell of a filter list, well, we can consider it as the process of post-order tree traverse. For a node , before we traverse the current child, we should set the traverse result (transformed cell) of previous node(s) as the initial value. (HBASE-18879).- Overrides:
transformCell
in classFilterBase
- Parameters:
c
- The cell in question.- Returns:
- the transformed cell.
- Throws:
IOException
- in case an I/O or an filter specific failure needs to be signaled.- See Also:
-
filterRowCells
Filters that never filter by modifying the returned List of Cells can inherit this implementation that does nothing. Filters that never filter by modifying the returned List of Cells can inherit this implementation that does nothing. Chance to alter the list of Cells to be submitted. Modifications to the list will carry on Concrete implementers can signal a failure condition in their code by throwing anIOException
.- Overrides:
filterRowCells
in classFilterBase
- Parameters:
cells
- the list of Cells to be filtered- Throws:
IOException
- in case an I/O or an filter specific failure needs to be signaled.
-
hasFilterRow
Description copied from class:FilterBase
Filters that never filter by modifying the returned List of Cells can inherit this implementation that does nothing. Primarily used to check for conflicts with scans(such as scans that do not read a full row at a time).- Overrides:
hasFilterRow
in classFilterBase
- Returns:
- True if this filter actively uses filterRowCells(List) or filterRow().
-
isFamilyEssential
Description copied from class:FilterBase
By default, we require all scan's column families to be present. Our subclasses may be more precise. Check that given column family is essential for filter to check row. Most filters always return true here. But some could have more sophisticated logic which could significantly reduce scanning process by not even touching columns until we are 100% sure that it's data is needed in result. Concrete implementers can signal a failure condition in their code by throwing anIOException
.- Overrides:
isFamilyEssential
in classFilterBase
- Throws:
IOException
- in case an I/O or an filter specific failure needs to be signaled.
-
setReversed
Description copied from class:Filter
alter the reversed scan flag- Overrides:
setReversed
in classFilter
- Parameters:
reversed
- flag
-
toString
Description copied from class:FilterBase
Return filter's info for debugging and logging purpose.- Overrides:
toString
in classFilterBase
-
formatLogFilters
-