@InterfaceAudience.Private public abstract class FilterBase extends Filter
Filter.ReturnCode| Constructor and Description |
|---|
FilterBase() |
| Modifier and Type | Method and Description |
|---|---|
static Filter |
createFilterFromArguments(ArrayList<byte[]> filterArguments)
Given the filter's arguments it constructs the filter
|
boolean |
filterAllRemaining()
Filters that never filter all remaining can inherit this implementation that
never stops the filter early.
|
boolean |
filterRow()
Filters that never filter by rows based on previously gathered state from
Filter.filterKeyValue(Cell) can inherit this implementation that
never filters a row. |
void |
filterRowCells(List<Cell> ignored)
Filters that never filter by modifying the returned List of Cells can
inherit this implementation that does nothing.
|
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.
|
KeyValue |
getNextKeyHint(KeyValue currentKV)
Deprecated.
|
boolean |
hasFilterRow()
Fitlers that never filter by modifying the returned List of Cells can
inherit this implementation that does nothing.
|
boolean |
isFamilyEssential(byte[] name)
By default, we require all scan's column families to be present.
|
void |
reset()
Filters that are purely stateless and do nothing in their reset() methods can inherit
this null/empty implementation.
|
byte[] |
toByteArray()
Return length 0 byte array for Filters that don't require special serialization
|
String |
toString()
Return filter's info for debugging and logging purpose.
|
KeyValue |
transform(KeyValue currentKV)
Deprecated.
|
Cell |
transformCell(Cell v)
By default no transformation takes place
Give the filter a chance to transform the passed KeyValue.
|
filterKeyValue, isReversed, parseFrom, setReversedpublic void reset()
throws IOException
IOException.reset in class FilterIOException - in case an I/O or an filter specific failure needs to be signaled.public boolean filterRowKey(byte[] buffer,
int offset,
int length)
throws IOException
Filter.filterKeyValue(Cell) below.
Concrete implementers can signal a failure condition in their code by throwing an
IOException.filterRowKey in class Filterbuffer - buffer containing row keyoffset - offset into buffer where row key startslength - length of the row keyIOException - in case an I/O or an filter specific failure needs to be signaled.public boolean filterAllRemaining()
throws IOException
IOException.filterAllRemaining in class FilterIOException - in case an I/O or an filter specific failure needs to be signaled.public Cell transformCell(Cell v) throws IOException
transformCell in class Filterv - the KeyValue in questionIOException - in case an I/O or an filter specific failure needs to be signaled.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}.@Deprecated public KeyValue transform(KeyValue currentKV) throws IOException
transformCell(Cell).
This is for transition from 0.94 -> 0.96transform in class FilterIOExceptionpublic void filterRowCells(List<Cell> ignored) throws IOException
IOException.filterRowCells in class Filterignored - the list of Cells to be filteredIOException - in case an I/O or an filter specific failure needs to be signaled.public boolean hasFilterRow()
hasFilterRow in class Filterpublic boolean filterRow()
throws IOException
Filter.filterKeyValue(Cell) can inherit this implementation that
never filters a row.
Last chance to veto row based on previous Filter.filterKeyValue(Cell) calls. The filter
needs to retain state then return a particular value for this call if they wish to exclude a
row if a certain column is missing (for example).
Concrete implementers can signal a failure condition in their code by throwing an
IOException.filterRow in class FilterIOException - in case an I/O or an filter specific failure needs to be signaled.@Deprecated public KeyValue getNextKeyHint(KeyValue currentKV) throws IOException
getNextKeyHint in class FilterIOException - Function is Deprecated. Use Filter.getNextCellHint(Cell) instead.public Cell getNextCellHint(Cell currentKV) throws IOException
IOException.getNextCellHint in class FilterIOException - in case an I/O or an filter specific failure needs to be signaled.public boolean isFamilyEssential(byte[] name)
throws IOException
IOException.isFamilyEssential in class FilterIOException - in case an I/O or an filter specific failure needs to be signaled.public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
filterArguments - the filter's argumentspublic String toString()
public byte[] toByteArray()
throws IOException
toByteArray in class FilterIOException - in case an I/O or an filter specific failure needs to be signaled.Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.